Statistics
| Revision:

root / tmp / org.txm.setups / shared / win / txm.nsi @ 2859

History | View | Annotate | Download (15.2 kB)

1
!include MUI2.nsh
2

    
3
!include nsDialogs.nsh
4

    
5
!include LogicLib.nsh
6

    
7
;general
8

    
9
Name "TXM TXMVERSION"
10

    
11
;!define Version ""
12
!define Version "-TXMVERSION"
13

    
14

    
15
OutFile "../TXM_TXMDATEVERSION_Win64_installer.exe"
16

    
17
InstallDir "$PROGRAMFILES64\TXM${Version}"
18

    
19
RequestExecutionLevel admin
20

    
21
;compression
22

    
23
;SetCompressor /FINAL /SOLID lzma
24

    
25
;SetCompressorDictSize 64
26

    
27

    
28
;interface configuration
29

    
30
!define MUI_HEADERIMAGE
31

    
32
!define MUI_HEADERIMAGE_RIGHT
33

    
34
!define MUI_HEADERIMAGE_BITMAP "header.bmp"
35

    
36
!define MUI_HEADERIMAGE_UNBITMAP "header.bmp"
37

    
38
!define MUI_ICON "install.ico"
39

    
40
!define MUI_UNICON "uninstall.ico"
41

    
42
!define MUI_WELCOMEFINISHPAGE_BITMAP "welcome.bmp" ; optional
43

    
44

    
45
;Welcome conf
46

    
47
;!define MUI_WELCOMEFINISHPAGE_BITMAP "welcome.bmp" ; optional
48

    
49
!define MUI_WELCOMEPAGE_TITLE $(WelcomeTitleMessage)
50

    
51
!define MUI_WELCOMEPAGE_TEXT $(WelcomeTextMessage)
52

    
53

    
54
;Finish conf
55

    
56
!define MUI_FINISHPAGE_TITLE $(FinishTitleMessage)
57

    
58
!define MUI_FINISHPAGE_TEXT $(FinishTextMessage)
59

    
60

    
61
;pages
62

    
63

    
64
!insertmacro MUI_PAGE_WELCOME
65

    
66
;!insertmacro MUI_PAGE_LICENSE "license_agreement.txt"  
67
!insertmacro MUI_PAGE_DIRECTORY
68

    
69
Page Custom MyCustomPage MyCustomLeave
70
Var Dialog
71
Var Checkbox1
72

    
73
Var CheckState1 ; Stored globally so we remember the choice if the user presses the back button and goes back to our page
74
Var Checkbox2
75

    
76
Var CheckState2 ; Stored globally so we remember the choice if the user presses the back button and goes back to our page
77
Function MyCustomPage
78
	!insertmacro MUI_HEADER_TEXT $(AdvancedOptionsTitle) $(AdvancedOptionsSubTitle)
79

    
80
	nsDialogs::Create 1018
81
	Pop $Dialog
82

    
83
	${If} $Dialog == error
84
		Abort
85
	${EndIf}
86

    
87
	${NSD_CreateCheckBox} 0 0 100% 30% $(LocalInstallMessage)
88
	Pop $Checkbox1
89
	
90
;	${NSD_Check} $Checkbox1
91

    
92
	${NSD_CreateCheckBox} 0 30% 100% 30% $(AskUserDirMessage)
93
	Pop $Checkbox2
94
	
95
;	${NSD_Check} $Checkbox2
96

    
97
	nsDialogs::Show
98
FunctionEnd
99

    
100
Function MyCustomLeave
101
  ${NSD_GetState} $Checkbox1 $CheckState1
102

    
103
  ${If} $CheckState1 <> 0
104
  
105
    file ROAMINGINSTALL
106
    
107
  ${EndIf}
108

    
109
  ${NSD_GetState} $Checkbox2 $CheckState2
110

    
111
  ${If} $CheckState2 <> 0
112
  
113
    file ASKUSERDIRECTORY
114
    
115
  ${EndIf}
116
FunctionEnd
117

    
118

    
119
!insertmacro MUI_PAGE_INSTFILES
120

    
121
!insertmacro MUI_UNPAGE_CONFIRM
122

    
123
!insertmacro MUI_UNPAGE_INSTFILES
124

    
125
!insertmacro MUI_PAGE_FINISH
126

    
127

    
128
;Languages
129

    
130
!insertmacro MUI_LANGUAGE "English"
131
!insertmacro MUI_LANGUAGE "French"
132
!insertmacro MUI_LANGUAGE "Russian"
133

    
134
;Lang Strings ENGLISH
135
LangString AdvancedOptionsTitle ${LANG_ENGLISH} "Advanced options"
136
LangString AdvancedOptionsSubTitle ${LANG_ENGLISH} "Check these options only for specific Windows configurations"
137
LangString LocalInstallMessage ${LANG_ENGLISH} "Do not use local user directory (check this option to use a roaming Windows account home directory)."
138

    
139
LangString AskUserDirMessage ${LANG_ENGLISH} "Do not use the user directory to store the TXM working directory (check this option to store corpora on a USB stick or on a remote directory. In this case, the working directory path will be asked at each TXM launch)."
140

    
141
LangString InfosTitleMessage ${LANG_ENGLISH} "For your information"
142

    
143
LangString InfosTextMessage ${LANG_ENGLISH} "If TXM is already installed on this machine, it will first be removed by this installer (TXM corpora will NOT be removed).$\nClose the window to cancel installation.$\n$\nMinimum requirements: Windows 7 64bit"
144

    
145
LangString WelcomeTitleMessage ${LANG_ENGLISH} "Welcome to TXM setup"
146

    
147
LangString WelcomeTextMessage ${LANG_ENGLISH} "TXM is provided to you free of charge. In return, in the spirit of open-source software development, you are invited to participate in its improvement. To do this, you don't have to be a software developer, you can:$\n * send us your publications or course materials related to your use of TXM;$\n * suggest corrections or improvements;$\n * translate in your language the interface or documentation;$\n * Setup a research project involving TXM adaptation and use;$\n * etc.$\n$\n See the 'Contribute' page on the TXM users' wiki: https://groupes.renater.fr/wiki/txm-users/public/contribuer $\n$\n Don't hesitate to contact us for more information at 'textometrie AT groupes.renater DOT fr'."
148

    
149
LangString FinishTitleMessage ${LANG_ENGLISH} "Installation done"
150

    
151
LangString FinishTextMessage ${LANG_ENGLISH} "The installation is done. A 'TXM' entry has been added to the 'Start' menu.$\nIf you want to automatically tag and lemmatize your corpora with the TreeTagger software during import, you need to follow additional installation instructions given in the 'Help > Install TreeTagger' menu."
152

    
153
LangString ErrorArch32Message ${LANG_ENGLISH} "This setup is for 32bit systems but your system seems to be 64bit. Please download and install the 64bit version of TXM for this machine. Continue to install anyway?"
154

    
155
LangString ErrorArch64Message ${LANG_ENGLISH} "This setup is for 64bit systems but your system seems to be 32bit. Please download and install the 32bit version of TXM for this machine. Continue to install anyway?"
156

    
157
LangString UninstallWindowsMessage ${LANG_ENGLISH} "TXM TXMVERSION is already installed on this machine.$\n$\nClick `OK` to uninstall the previous version first (TXM TXMVERSION corpora will NOT be removed).$\nOr click `Cancel` to abort this installation.$\nPlease ensure that no TXM TXMVERSION is running during the installation process."
158

    
159

    
160
;Lang Strings FRENCH
161
LangString AdvancedOptionsTitle ${LANG_FRENCH} "Options avanc?es"
162
LangString AdvancedOptionsSubTitle ${LANG_FRENCH} "Ne cocher ces options que pour des configurations Windows particuli?res"
163
LangString LocalInstallMessage ${LANG_FRENCH} "Ne pas utiliser le r?pertoire utilisateur local (cocher cette option si vous souhaitez utiliser un r?pertoire de connexion de compte itin?rant)."
164

    
165
LangString AskUserDirMessage ${LANG_FRENCH} "Ne pas utiliser le r?pertoire utilisateur comme r?pertoire de travail de TXM (cocher cette option pour stocker les corpus sur une cl? USB ou sur un disque distant. Dans ce cas, le chemin du r?pertoire de travail sera demand? chaque lancement de TXM)."
166

    
167
LangString InfosTitleMessage ${LANG_FRENCH} "Pour votre information"
168

    
169
LangString InfosTextMessage ${LANG_FRENCH} "Si TXM est d?j? install? sur cette machine, cet installeur le supprimera pour commencer (les corpus existants ne seront pas supprim?s). Pour annuler l'installation, vous pouvez fermer cette fen?tre.$\n$\nConfiguration minimum: Windows Vista 64bit"
170

    
171
LangString WelcomeTitleMessage ${LANG_FRENCH} "Bienvenue dans l'installeur de TXM"
172

    
173
LangString WelcomeTextMessage ${LANG_FRENCH} "TXM vous est fourni gracieusement. En contre-partie, dans l'esprit du logiciel libre, vous ?tes invit? ? participer ? son am?lioration. Pour cela, vous n'?tes pas oblig? d'?tre d?veloppeur informatique, vous pouvez :$\n * transmettre vos publications ou supports de cours ;$\n * proposer des corrections ou am?liorations ;$\n *  traduire l'interface ou la documentation ;$\n * monter un projet pour adapter TXM ? vos besoins ;$\n * etc.$\n$\n Voir la rubrique 'Contribuer' du wiki des utilisateurs de TXM : https://groupes.renater.fr/wiki/txm-users/public/contribuer $\n$\n N'h?sitez pas ? nous contacter pour de plus amples informations : 'textometrie AT groupes.renater DOT fr'."
174

    
175
LangString FinishTitleMessage ${LANG_FRENCH} "Installation termin?e."
176

    
177
LangString FinishTextMessage ${LANG_FRENCH} "L'installation s'est correctement termin?e. Une entr?e 'TXM' a ?t? ajout?e au menu D?marrer.$\n$\nSi vous souhaitez ?tiqueter et lemmatiser automatiquement vos corpus avec le logiciel TreeTagger lors de l'import, vous devez suivre les instructions d'installation suppl?mentaires fournies dans le menu 'Aide > Installer TreeTagger'."
178

    
179
LangString ErrorArch32Message ${LANG_FRENCH} "La version de TXM que vous allez installer est pour un syst?me 32 bits, or votre syst?me semble ?tre 64 bits. Il faudrait t?l?charger et installer la version 64 bits de TXM. Voulez-vous malgr? tout continuer cette installation ?"
180

    
181
LangString ErrorArch64Message ${LANG_FRENCH} "La version de TXM que vous allez installer est pour un syst?me 64 bits, or votre syst?me semble ?tre 32 bits. Il faudrait t?l?charger et installer la version 32 bits de TXM. Voulez-vous malgr? tout continuer cette installation ?"
182

    
183
LangString UninstallWindowsMessage ${LANG_FRENCH} "TXM TXMVERSION est d?j? install? sur cette machine. Veuillez cliquer sur 'OK' pour d?sinstaller cette version au pr?alable (les corpus seront conserv?s). Ou cliquez sur 'Annuler' pour interrompre l'installation. Merci de vous assurer que TXM TXMVERSION n'est pas en cours d'ex?cution pendant l'installation."
184

    
185
;END OF LANG MESSAGES
186

    
187

    
188
Function .onInit
189

    
190
	;!insertmacro MUI_LANGDLL_DISPLAY
191
	
192

    
193
	setOutPath $INSTDIR
194
	
195

    
196
		ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TXM${Version}" "UninstallString"
197
		
198
		StrCmp $R0 "" done
199
		
200

    
201
		MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION $(UninstallWindowsMessage) IDOK uninst
202

    
203
		Abort
204

    
205

    
206

    
207
	;Run the uninstaller
208
	
209
	uninst:
210
	
211
		ClearErrors
212
		
213
		ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
214
		
215
		IfErrors no_remove_uninstaller done
216
		
217
		no_remove_uninstaller:
218
		
219
	done:
220
	
221
FunctionEnd
222

    
223
Section "Copy files" SecFiles
224
	
225
	#we install txm in INSTDIR
226
	
227
	SetOutPath $INSTDIR
228
	
229
File /r configuration
230
File /r doc
231
File /r features
232
File /r jre
233
File /r p2
234
File /r plugins
235
File /r readme
236
File /r redist
237
File /r samples
238
File artifacts.xml
239
File cqpjni.dll
240
File header.bmp
241
File IEShims.dll
242
File install.ico
243
File libcharset-1.dll
244
File libglib-2.0-0.dll
245
File libgnurx-0.dll
246
File libiconv-2.dll
247
File libintl-8.dll
248
File libpcre-1.dll
249
File LICENSE.TXT
250
File license_agreement.txt
251
File license_agreement_fr.txt
252
File LICENSE_FR.TXT
253
File OpenAppDataDirectory.bat
254
File pcre3.dll
255
File StartDialog.jar
256
File TXM.bat
257
File launcher.exe
258
File TXM.ico
259
File launcher.ini
260
File "TXM debug.bat"
261
File uninstall.ico
262
	
263
	# hide TXM.exe
264
	SetFileAttributes "$INSTDIR/TXM.exe" HIDDEN
265
	
266
	# the users right on install dir to enable updates
267
	
268
	AccessControl::GrantOnFile "$INSTDIR\TXM" "(S-1-5-32-545)" "FullAccess"
269
	
270
	#we set the shortcuts
271
	
272
	SetShellVarContext all
273
	
274
	CreateDirectory "$SMPROGRAMS\TXM${Version}"
275
	
276
	CreateShortCut "$SMPROGRAMS\TXM${Version}\TXM${Version}.lnk" "$INSTDIR\TXM.bat" "" "$INSTDIR\TXM.ico" 0
277
	CreateShortCut "$SMPROGRAMS\TXM${Version}\TXM${Version} debug.lnk" "$INSTDIR\TXM debug.bat" "" "$INSTDIR\TXM.ico" 0
278
	CreateShortCut "$SMPROGRAMS\TXM${Version}\uninstall TXM${Version}.lnk" "$INSTDIR\uninstall.exe"
279
	#CreateShortCut "$SMPROGRAMS\TXM${Version}\Manuel utilisateur FR.pdf.lnk" "$INSTDIR\doc\Manuel de TXM 0.7 FR.pdf"
280
	#CreateShortCut "$SMPROGRAMS\TXM${Version}\User Manual EN.pdf.lnk" "$INSTDIR\doc\TXM 0.7 Manual EN.pdf"
281
	
282

    
283
	; Store installation folder
284
	
285
	WriteRegStr HKCU "Software\TXM${Version}" "" $INSTDIR
286
	
287
	#register the TXM uninstall to windows programs
288
	
289
	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TXM${Version}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
290
	
291
	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TXM${Version}" "DisplayName" "TXM${Version}  - The Textometrie project builds the new generation of modular and open-source textometry platform and application. The scientific project web site is http://textometrie.ens-lsh.fr/?lang=en. "
292
	
293
	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TXM${Version}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
294

    
295

    
296
	#we create the uninstaller
297
	
298
	WriteUninstaller "$INSTDIR\uninstall.exe"
299
	
300

    
301

    
302
SectionEnd
303

    
304
Function WriteToFile
305

    
306
	Exch $0 ;file to write to
307
	
308
	Exch
309
	
310
	Exch $1 ;text to write
311
	
312
	FileOpen $0 $0 a #open file
313
	
314
	FileSeek $0 0 END #go to end
315
	
316
	FileWrite $0 $1 #write to file
317
	
318
	FileClose $0
319
	
320
	Pop $1
321
	
322
	Pop $0
323
	
324
FunctionEnd
325

    
326

    
327
### TimeStamp
328

    
329
!ifndef TimeStamp
330

    
331
    !define TimeStamp "!insertmacro _TimeStamp"
332
    
333
    !macro _TimeStamp FormatedString
334
    
335
        !ifdef __UNINSTALL__
336
	
337
            Call un.__TimeStamp
338
	    
339
        !else
340
	
341
            Call __TimeStamp
342
	    
343
        !endif
344
	
345
        Pop ${FormatedString}
346
	
347
    !macroend
348
    
349
 
350
!macro __TimeStamp UN
351

    
352

    
353
Function ${UN}__TimeStamp
354

    
355
    ClearErrors
356
    
357
    ## Store the needed Registers on the stack
358
    
359
        Push $0 ; Stack $0
360
	
361
        Push $1 ; Stack $1 $0
362
	
363
        Push $2 ; Stack $2 $1 $0
364
	
365
        Push $3 ; Stack $3 $2 $1 $0
366
	
367
        Push $4 ; Stack $4 $3 $2 $1 $0
368
	
369
        Push $5 ; Stack $5 $4 $3 $2 $1 $0
370
	
371
        Push $6 ; Stack $6 $5 $4 $3 $2 $1 $0
372
	
373
        Push $7 ; Stack $7 $6 $5 $4 $3 $2 $1 $0
374
	
375
        ;Push $8 ; Stack $8 $7 $6 $5 $4 $3 $2 $1 $0
376
	
377
 
378
    ## Call System API to get the current system Time
379
    
380
        System::Alloc 16
381
	
382
        Pop $0
383
	
384
        System::Call 'kernel32::GetLocalTime(i) i(r0)'
385
	
386
        System::Call '*$0(&i2, &i2, &i2, &i2, &i2, &i2, &i2, &i2)i (.r1, .r2, n, .r3, .r4, .r5, .r6, .r7)'
387
	
388
        System::Free $0
389
	
390
 
391
        IntFmt $2 "%02i" $2
392
	
393
        IntFmt $3 "%02i" $3
394
	
395
        IntFmt $4 "%02i" $4
396
	
397
        IntFmt $5 "%02i" $5
398
	
399
        IntFmt $6 "%02i" $6
400
	
401
 
402
    ## Generate Timestamp
403
    
404
        ;StrCpy $0 "YEAR=$1$\nMONTH=$2$\nDAY=$3$\nHOUR=$4$\nMINUITES=$5$\nSECONDS=$6$\nMS$7"
405
	
406
        StrCpy $0 "$1$2$3$4$5$6.$7"
407
	
408
 
409
    ## Restore the Registers and add Timestamp to the Stack
410
    
411
        ;Pop $8  ; Stack $7 $6 $5 $4 $3 $2 $1 $0
412
	
413
        Pop $7  ; Stack $6 $5 $4 $3 $2 $1 $0
414
	
415
        Pop $6  ; Stack $5 $4 $3 $2 $1 $0
416
	
417
        Pop $5  ; Stack $4 $3 $2 $1 $0
418
	
419
        Pop $4  ; Stack $3 $2 $1 $0
420
	
421
        Pop $3  ; Stack $2 $1 $0
422
	
423
        Pop $2  ; Stack $1 $0
424
	
425
        Pop $1  ; Stack $0
426
	
427
        Exch $0 ; Stack ${TimeStamp}
428
	
429
 
430
FunctionEnd
431

    
432
!macroend
433

    
434
!insertmacro __TimeStamp ""
435

    
436
!insertmacro __TimeStamp "un."
437

    
438
!endif
439

    
440
###########
441

    
442

    
443
Section "WriteInstallStamp" secStamp
444

    
445
	${TimeStamp} $0
446
	
447
	Push "$0"
448
	
449
	Push "$INSTDIR\STAMP" ;file to write to 
450
	
451
	Call WriteToFile
452
	
453
SectionEnd
454

    
455

    
456
Section "WriteInstallPrefs" secPrefs
457

    
458
	#we set the default preferences
459
	
460
	;!define pathToCqp "$INSTDIR\cwb\bin\win32\cqpserver.exe"
461
	
462
	;!define pathToCqpLib "$INSTDIR\cwb\bin\"
463
	
464
	;!define pathToInit "$INSTDIR\cwb\cqpserver.init"
465
	
466
	;!define pathToR "$INSTDIR\R\bin\x64\Rterm.exe"
467
	
468
	;!define pathToTT "$PROGRAMFILES\treetagger"
469
	
470
	;!define pathToTTMod "$PROGRAMFILES\treetagger\models"
471
	
472

    
473
	;FileOpen $4 "$INSTDIR\install.prefs" a
474
	
475
	;FileSeek $4 0 END
476
	
477
	;FileWrite $4 "$\r$\ncqi_server_path_to_cqplib=${pathToCqpLib}"
478
	
479
	;FileWrite $4 "$\r$\ncqi_server_path_to_executable=${pathToCqp}"
480
	
481
	;FileWrite $4 "$\r$\ncqi_server_path_to_init_file=${pathToInit}"
482
	
483
	;FileWrite $4 "$\r$\nr_path_to_executable=${pathToR}"
484
	
485
	;FileWrite $4 "$\r$\ntreetagger_install_path=${pathToTT}"
486
	
487
	;FileWrite $4 "$\r$\ntreetagger_models_path=${pathToTTMod}"
488
	
489
	;FileClose $4 ; and close the file
490
	
491
SectionEnd
492

    
493

    
494
;UninstallText "This will uninstall TXM"
495

    
496

    
497

    
498
;uninstaller section start
499

    
500
Section "Uninstall"
501

    
502
	SetShellVarContext all
503
	
504
	# Delete installation key
505
	
506
	DeleteRegKey /ifempty HKCU "Software\TXM${Version}"
507
	
508
	# Delete uninstaller key
509
	
510
	DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TXM${Version}"
511
	
512
	# we remove the software
513
	
514
	RMDir /r $INSTDIR
515
	
516
	RMDir /r "$SMPROGRAMS\TXM${Version}"
517
	
518
SectionEnd
519