Révision 748

tmp/trunk/org.txm.setups/shared/win/TXM.bat (revision 748)
1
set installdir=%~dp0
2
set DEBUG=0
3
set VERSION=0.8.0
4
set USERHOME=%USERPROFILE%\
5

  
6
IF NOT EXIST ROAMINGINSTALL GOTO ROAMINGINSTALLDONE
7
echo "The 'roaming' install option is set."
8
set USERHOME=%HOMEDRIVE%%HOMEPATH%\
9
echo "USERHOME set to %USERHOME%"
10

  
11
:ROAMINGINSTALLDONE
12

  
13
IF NOT EXIST ASKUSERDIRECTORY GOTO ASKUSERDIRECTORYDONE
14
echo "The 'ask user directory' install option is set."
15
for /f "tokens=*" %%a in ('TXM\jre\bin\java -jar StartDialog.jar') do set USERHOME=%%a\
16
echo "USERHOME set to %USERHOME%"
17

  
18
:ASKUSERDIRECTORYDONE
19

  
20
IF EXIST "%USERHOME%" GOTO USERHOMEOK
21
echo "%USERHOME% does not exist. Aborting"
22
msg * "TXM could not start using the USERHOME='%USERHOME%' directory."
23
GOTO:EOF
24

  
25
:USERHOMEOK
26

  
27
set TXMHOME=%USERHOME%TXM_%VERSION%\
28
set DOTTXM=%TXMHOME%.txm\
29

  
30
mkdir "%TXMHOME%" 
31

  
32
mkdir "%DOTTXM%" 
33

  
34
(
35
echo "TXM: getting install date from %installdir%STAMP and %DOTTXM%STAMP files" 
36
Fc "%installdir%STAMP" "%DOTTXM%STAMP" 
37
) >"%TXMHOME%TXMOutputLogs.txt" 2>"%TXMHOME%TXMErrorLogs.txt" 
38

  
39
IF errorlevel 1 (goto :install) else (goto :run)
40

  
41
:install
42

  
43
(
44
echo "New TXM install: it's the first launch after the installation." 
45
del "%temp%\org.txm.rcpapplication.prefs" 
46
copy "%DOTTXM%configuration\.settings\org.txm.rcpapplication.prefs" "%temp%\org.txm.rcpapplication.prefs" 
47
copy "%DOTTXM%.metadata\.plugins\org.eclipse.core.runtime\.settings\org.txm.rcpapplication.prefs" "%temp%\org.txm.rcpapplication.prefs" 
48
copy "%DOTTXM%data\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.txm.rcpapplication.prefs" "%temp%\org.txm.rcpapplication.prefs" 
49

  
50
rmdir "%DOTTXM%" /s /q
51
IF errorlevel 1 (echo "TXM: failed to delete %DOTTXM% directory.")
52

  
53
mkdir "%DOTTXM%" 
54
IF errorlevel 1 (echo "TXM: failed to create %DOTTXM% directory.")
55

  
56
copy "%installdir%TXM.ini" "%DOTTXM%TXM.ini" 
57
IF errorlevel 1 (echo "TXM: failed to copy %DOTTXM%TXM.ini file")
58

  
59
copy "%temp%\org.txm.rcpapplication.prefs" "%DOTTXM%org.txm.rcpapplication.prefs" 
60

  
61
mkdir "%DOTTXM%user" 
62
IF errorlevel 1 (echo "TXM: failed to create %DOTTXM%user directory.")
63

  
64
mkdir "%DOTTXM%data" 
65
IF errorlevel 1 (echo "TXM: failed to create %DOTTXM%data directory.")
66

  
67
copy "%installdir%STAMP" "%DOTTXM%STAMP" 
68
IF errorlevel 1 (echo "TXM: failed to copy %DOTTXM%STAMP file")
69

  
70
) >"%TXMHOME%TXMOutputLogs.txt" 2>"%TXMHOME%TXMErrorLogs.txt" 
71

  
72
:run
73

  
74
(
75

  
76
set _JAVA_OPTIONS=-Duser.home="%USERHOME%"
77

  
78
echo running "%installdir%TXM.exe" -run --launcher.ini "%DOTTXM%TXM.ini" -data "%DOTTXM%data" -user "%DOTTXM%user" -install "%installdir%" 
79

  
80
"%installdir%\TXM.exe" -run --launcher.ini "%DOTTXM%TXM.ini" -data "%DOTTXM%data" -user "%DOTTXM%user" -install "%installdir%" 
81

  
82
) >"%TXMHOME%TXMOutputLogs.txt" 2>"%TXMHOME%TXMErrorLogs.txt" 
tmp/trunk/org.txm.setups/shared/win/OpenAppDataDirectory.bat (revision 748)
1
@start explorer "%appdata%"
tmp/trunk/org.txm.setups/shared/win/txm.nsi (revision 748)
1
!include MUI2.nsh
+!include MUI2.nsh
2 1

  
3
!include nsDialogs.nsh
+!include nsDialogs.nsh
4 2

  
5
!include LogicLib.nsh
+!include LogicLib.nsh
6 3

  
7
+;general
8 4

  
9
;general
+Name "TXM 0.8.0"
10 5

  
11
Name "TXM 0.8.0"
+OutFile "TXM_0.8.0_Win64_installer.exe"
12 6

  
13
OutFile "TXM_0.8.0_Win64_installer.exe"
+InstallDir "$PROGRAMFILES64\TXM"
14 7

  
15
InstallDir "$PROGRAMFILES64\TXM"
+RequestExecutionLevel admin
16 8

  
17
RequestExecutionLevel admin
+;compression
18 9

  
19
+SetCompressor /FINAL /SOLID lzma
20 10

  
21
;compression
+SetCompressorDictSize 64
22 11

  
23
SetCompressor /FINAL /SOLID lzma
 
24
SetCompressorDictSize 64
+;interface configuration
25 12

  
26
+!define MUI_HEADERIMAGE
27 13

  
28
;interface configuration
+!define MUI_HEADERIMAGE_RIGHT
29 14

  
30
!define MUI_HEADERIMAGE
+!define MUI_HEADERIMAGE_BITMAP "header.bmp"
31 15

  
32
!define MUI_HEADERIMAGE_RIGHT
+!define MUI_HEADERIMAGE_UNBITMAP "header.bmp"
33 16

  
34
!define MUI_HEADERIMAGE_BITMAP "header.bmp"
+!define MUI_ICON "install.ico"
35 17

  
36
!define MUI_HEADERIMAGE_UNBITMAP "header.bmp"
+!define MUI_UNICON "uninstall.ico"
37 18

  
38
!define MUI_ICON "install.ico"
+!define MUI_WELCOMEFINISHPAGE_BITMAP "welcome.bmp" ; optional
39 19

  
40
!define MUI_UNICON "uninstall.ico"
 
41
!define MUI_WELCOMEFINISHPAGE_BITMAP "welcome.bmp" ; optional
+;Welcome conf
42 20

  
43
+;!define MUI_WELCOMEFINISHPAGE_BITMAP "welcome.bmp" ; optional
44 21

  
45
;Welcome conf
+!define MUI_WELCOMEPAGE_TITLE $(WelcomeTitleMessage)
46 22

  
47
;!define MUI_WELCOMEFINISHPAGE_BITMAP "welcome.bmp" ; optional
+!define MUI_WELCOMEPAGE_TEXT $(WelcomeTextMessage)
48 23

  
49
!define MUI_WELCOMEPAGE_TITLE $(WelcomeTitleMessage)
 
50
!define MUI_WELCOMEPAGE_TEXT $(WelcomeTextMessage)
+;Finish conf
51 24

  
52
+!define MUI_FINISHPAGE_TITLE $(FinishTitleMessage)
53 25

  
54
;Finish conf
+!define MUI_FINISHPAGE_TEXT $(FinishTextMessage)
55 26

  
56
!define MUI_FINISHPAGE_TITLE $(FinishTitleMessage)
 
57
!define MUI_FINISHPAGE_TEXT $(FinishTextMessage)
+;pages
58 27

  
59
 
60
;pages
+!insertmacro MUI_PAGE_WELCOME
61 28

  
62
-
63
!insertmacro MUI_PAGE_WELCOME
-
64 29
;!insertmacro MUI_PAGE_LICENSE "license_agreement.txt"  
65 30
!insertmacro MUI_PAGE_DIRECTORY
66 31

  
......
131 122

  
132 123

  
133 124
;Languages
-
125
 !insertmacro MUI_LANGUAGE "English"
-!insertmacro MUI_LANGUAGE "French"
126
!insertmacro MUI_LANGUAGE "French"
 !insertmacro MUI_LANGUAGE "Russian"
-
134

  
127
 ;Lang Strings ENGLISH
135 128
LangString AdvancedOptionsTitle ${LANG_ENGLISH} "Advanced options"
136 129
LangString AdvancedOptionsSubTitle ${LANG_ENGLISH} "Check these options only for specific Windows configurations"
......
164 154

  
165 155

  
166 156
;Lang Strings FRENCH
167
LangString AdvancedOptionsTitle ${LANG_FRENCH} "Options avanc�es"
168
LangString AdvancedOptionsSubTitle ${LANG_FRENCH} "Ne cocher ces options que pour des configurations Windows particuli�res"
169
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)."
+LangString AdvancedOptionsTitle ${LANG_FRENCH} "Options avanc?es"
157
LangString AdvancedOptionsSubTitle ${LANG_FRENCH} "Ne cocher ces options que pour des configurations Windows particuli?res"
158
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)."
 
170
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)."
+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)."
 
171 159
LangString InfosTitleMessage ${LANG_FRENCH} "Pour votre information"
 
172
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"
+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"
 
173 160
LangString WelcomeTitleMessage ${LANG_FRENCH} "Bienvenue dans l'installeur de TXM"
 
174
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'."
+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'."
 
175
LangString FinishTitleMessage ${LANG_FRENCH} "Installation termin�e."
+LangString FinishTitleMessage ${LANG_FRENCH} "Installation termin?e."
 
176
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'."
+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'."
 
177
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 ?"
+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 ?"
 
178
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 ?"
+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 ?"
 
179
LangString UninstallWindowsMessage ${LANG_FRENCH} "TXM 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 n'est pas en cours d'ex�cution pendant l'installation."
+LangString UninstallWindowsMessage ${LANG_FRENCH} "TXM 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 n'est pas en cours d'ex?cution pendant l'installation."
 
180 161
 
......
238 228

  
239 229
	done:
 
240
FunctionEnd
+FunctionEnd
241 230

  
242
-
243
Section "Copy files" SecFiles
-
244
	#we install txm in INSTDIR
-
245
	SetOutPath $INSTDIR
-
246
	file /r plugins
-	file /r features
-	file /r configuration
-	file /r jre
-	file /r p2
-
247
	file /r cwb
-
248
	file /r doc
-
249
	file /r schema
-
250
	file /r scripts
-
251
	file /r samples
-
252
	file /r xsl
-
253
	file /r css
-
254
	file TXM.ico
-
255
	file TXM.bat
-
256
	file TXM.vbs
+Section "Copy files" SecFiles
257 231
	
258
	file StartDialog.jar
+	#we install txm in INSTDIR
232
	
233
	SetOutPath $INSTDIR
234
	
235
	File /r ..\..\exportRCP\txm\*.*
236
	
237
	;File /r plugins
238
	;File /r features
239
	;File /r configuration
240
	;File /r jre
241
	;File /r p2
242
	;File /r doc
243
	;File /r schema
244
	;File /r scripts
245
	;File /r samples
246
	;File /r xsl
247
	;File /r css
248
	;File TXM.ico
249
	;File TXM.bat
250
	;File TXM.vbs
251
	;File StartDialog.jar
252
	;File OpenStartUpLogsDirectory.bat
253
	;File IEShims.dll
254
	;File libcharset-1.dll
255
	;File libglib-2.0-0.dll
256
	;File libgnurx-0.dll
257
	;File libiconv-2.dll
258
	;File libintl-8.dll
259
	;File libpcre-1.dll
260
	;File pcre3.dll
261
	
262
	# hide TXM.exe
263
	SetFileAttributes "$INSTDIR/TXM.exe" HIDDEN
264
	
265
	# the users right on install dir to enable updates
266
	
267
	AccessControl::GrantOnFile "$INSTDIR\TXM" "(S-1-5-32-545)" "FullAccess"
268
	
269
	#we create the uninstaller
270
	
271
	WriteUninstaller "$INSTDIR\uninstall.exe"
272
	
273
	#we set the shortcuts
274
	
275
	SetShellVarContext all
276
	
277
	CreateDirectory "$SMPROGRAMS\TXM"
278
	
279
	CreateShortCut "$SMPROGRAMS\TXM\TXM.lnk" "$INSTDIR\TXM.bat" "$INSTDIR\TXM.ico"
280
	
281
	CreateShortCut "$SMPROGRAMS\TXM\uninstall.lnk" "$INSTDIR\uninstall.exe"
282
	
283
	#CreateShortCut "$SMPROGRAMS\TXM\Manuel utilisateur FR.pdf.lnk" "$INSTDIR\doc\Manuel de TXM 0.7 FR.pdf"
284
	
285
	#CreateShortCut "$SMPROGRAMS\TXM\User Manual EN.pdf.lnk" "$INSTDIR\doc\TXM 0.7 Manual EN.pdf"
286
	
259 287

  
260
	file OpenStartUpLogsDirectory.bat
-
261
	file IEShims.dll
-
262
	file libcharset-1.dll
-
263
	file libglib-2.0-0.dll
-
264
	file libgnurx-0.dll
-
265
	file libiconv-2.dll
-
266
	file libintl-8.dll
-
267
	file libpcre-1.dll
-
268
	file pcre3.dll
-
269

  
270
	# hide TXM.exe
-
271
	SetFileAttributes "$INSTDIR/TXM.exe" HIDDEN
-
272
	
-
273
	# the users right on install dir to enable updates
-
274
	AccessControl::GrantOnFile "$INSTDIR\TXM" "(S-1-5-32-545)" "FullAccess"
-
275
	#we create the uninstaller
-
276
	WriteUninstaller "$INSTDIR\uninstall.exe"
-
-
277
	#we set the shortcuts
-
278
	SetShellVarContext all
-
279
	CreateDirectory "$SMPROGRAMS\TXM"
-
280
	CreateShortCut "$SMPROGRAMS\TXM\TXM.lnk" "$INSTDIR\TXM.bat" "$INSTDIR\TXM.ico"
-
281
	CreateShortCut "$SMPROGRAMS\TXM\uninstall.lnk" "$INSTDIR\uninstall.exe"
-
282
	#CreateShortCut "$SMPROGRAMS\TXM\Manuel utilisateur FR.pdf.lnk" "$INSTDIR\doc\Manuel de TXM 0.7 FR.pdf"
-
283
	#CreateShortCut "$SMPROGRAMS\TXM\User Manual EN.pdf.lnk" "$INSTDIR\doc\TXM 0.7 Manual EN.pdf"
-
284
-
285
	; Store installation folder
-
286
	WriteRegStr HKCU "Software\TXM" "" $INSTDIR
-
287
	
-
288
	#register the TXM uninstall to windows programs
-
289
	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TXM" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
-
288
	; Store installation folder
289
	
290
	WriteRegStr HKCU "Software\TXM" "" $INSTDIR
291
	
292
	#register the TXM uninstall to windows programs
293
	
294
	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TXM" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
295
	
290 296
	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TXM" "DisplayName" "TXM - 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. "
 
291
	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TXM" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
+	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TXM" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
297
	
298
SectionEnd
292 299

  
293
SectionEnd
+Function WriteToFile
294 300

  
295
+	Exch $0 ;file to write to
301
	
302
	Exch
303
	
304
	Exch $1 ;text to write
305
	
306
	FileOpen $0 $0 a #open file
307
	
308
	FileSeek $0 0 END #go to end
309
	
310
	FileWrite $0 $1 #write to file
311
	
312
	FileClose $0
313
	
314
	Pop $1
315
	
316
	Pop $0
317
	
318
FunctionEnd
296 319

  
297
Function WriteToFile
 
298
	Exch $0 ;file to write to
+### TimeStamp
299 320

  
300
	Exch
+!ifndef TimeStamp
301 321

  
302
	Exch $1 ;text to write
+    !define TimeStamp "!insertmacro _TimeStamp"
322
    
323
    !macro _TimeStamp FormatedString
324
    
325
        !ifdef __UNINSTALL__
326
	
327
            Call un.__TimeStamp
328
	    
329
        !else
330
	
331
            Call __TimeStamp
332
	    
333
        !endif
334
	
335
        Pop ${FormatedString}
336
	
337
    !macroend
338
    
339
 
340
!macro __TimeStamp UN
303 341

  
304
	FileOpen $0 $0 a #open file
 
305
	FileSeek $0 0 END #go to end
+Function ${UN}__TimeStamp
306 342

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

  
309
	FileClose $0
+!macroend
310 419

  
311
	Pop $1
+!insertmacro __TimeStamp ""
312 420

  
313
	Pop $0
+!insertmacro __TimeStamp "un."
314 421

  
315
FunctionEnd
+!endif
316 422

  
317
+###########
318 423

  
319
### TimeStamp
 
320
!ifndef TimeStamp
+Section "WriteInstallStamp" secStamp
321 424

  
322
    !define TimeStamp "!insertmacro _TimeStamp"
+	${TimeStamp} $0
425
	
426
	Push "$0"
427
	
428
	Push "$INSTDIR\STAMP" ;file to write to 
429
	
430
	Call WriteToFile
431
	
432
SectionEnd
323 433

  
324
    !macro _TimeStamp FormatedString
 
325
        !ifdef __UNINSTALL__
+Section "WriteInstallPrefs" secPrefs
326 434

  
327
            Call un.__TimeStamp
+	#we set the default preferences
435
	
436
	!define pathToCqp "$INSTDIR\cwb\bin\win32\cqpserver.exe"
437
	
438
	!define pathToCqpLib "$INSTDIR\cwb\bin\"
439
	
440
	!define pathToInit "$INSTDIR\cwb\cqpserver.init"
441
	
442
	!define pathToR "$INSTDIR\R\bin\x64\Rterm.exe"
443
	
444
	!define pathToTT "$PROGRAMFILES\treetagger"
445
	
446
	!define pathToTTMod "$PROGRAMFILES\treetagger\models"
447
	
328 448

  
329
        !else
+	FileOpen $4 "$INSTDIR\install.prefs" a
449
	
450
	FileSeek $4 0 END
451
	
452
	FileWrite $4 "$\r$\ncqi_server_path_to_cqplib=${pathToCqpLib}"
453
	
454
	FileWrite $4 "$\r$\ncqi_server_path_to_executable=${pathToCqp}"
455
	
456
	FileWrite $4 "$\r$\ncqi_server_path_to_init_file=${pathToInit}"
457
	
458
	FileWrite $4 "$\r$\nr_path_to_executable=${pathToR}"
459
	
460
	FileWrite $4 "$\r$\ntreetagger_install_path=${pathToTT}"
461
	
462
	FileWrite $4 "$\r$\ntreetagger_models_path=${pathToTTMod}"
463
	
464
	FileClose $4 ; and close the file
465
	
466
SectionEnd
330 467

  
331
            Call __TimeStamp
 
332
        !endif
-
333
        Pop ${FormatedString}
-
334
    !macroend
-
335
 
-
336
!macro __TimeStamp UN
-
337
-
338
Function ${UN}__TimeStamp
-
339
    ClearErrors
-
340
    ## Store the needed Registers on the stack
-
341
        Push $0 ; Stack $0
-
342
        Push $1 ; Stack $1 $0
-
343
        Push $2 ; Stack $2 $1 $0
-
344
        Push $3 ; Stack $3 $2 $1 $0
-
345
        Push $4 ; Stack $4 $3 $2 $1 $0
-
346
        Push $5 ; Stack $5 $4 $3 $2 $1 $0
-
347
        Push $6 ; Stack $6 $5 $4 $3 $2 $1 $0
-
348
        Push $7 ; Stack $7 $6 $5 $4 $3 $2 $1 $0
-
349
        ;Push $8 ; Stack $8 $7 $6 $5 $4 $3 $2 $1 $0
-
350
 
-
351
    ## Call System API to get the current system Time
-
352
        System::Alloc 16
-
353
        Pop $0
-
354
        System::Call 'kernel32::GetLocalTime(i) i(r0)'
-
355
        System::Call '*$0(&i2, &i2, &i2, &i2, &i2, &i2, &i2, &i2)i (.r1, .r2, n, .r3, .r4, .r5, .r6, .r7)'
-
356
        System::Free $0
-
357
 
-
358
        IntFmt $2 "%02i" $2
-
359
        IntFmt $3 "%02i" $3
-
360
        IntFmt $4 "%02i" $4
-
361
        IntFmt $5 "%02i" $5
-
362
        IntFmt $6 "%02i" $6
-
363
 
-
364
    ## Generate Timestamp
-
365
        ;StrCpy $0 "YEAR=$1$\nMONTH=$2$\nDAY=$3$\nHOUR=$4$\nMINUITES=$5$\nSECONDS=$6$\nMS$7"
-
366
        StrCpy $0 "$1$2$3$4$5$6.$7"
-
367
 
-
368
    ## Restore the Registers and add Timestamp to the Stack
-
369
        ;Pop $8  ; Stack $7 $6 $5 $4 $3 $2 $1 $0
-
370
        Pop $7  ; Stack $6 $5 $4 $3 $2 $1 $0
-
371
        Pop $6  ; Stack $5 $4 $3 $2 $1 $0
-
372
        Pop $5  ; Stack $4 $3 $2 $1 $0
-
373
        Pop $4  ; Stack $3 $2 $1 $0
-
374
        Pop $3  ; Stack $2 $1 $0
-
375
        Pop $2  ; Stack $1 $0
-
376
        Pop $1  ; Stack $0
-
377
        Exch $0 ; Stack ${TimeStamp}
-
378
 
-
379
FunctionEnd
-
380
!macroend
-
381
!insertmacro __TimeStamp ""
-
382
!insertmacro __TimeStamp "un."
-
383
!endif
-
384
###########
-
385
-
386
Section "WriteInstallStamp" secStamp
-
387
	${TimeStamp} $0
-
388
	Push "$0"
-
389
	Push "$INSTDIR\STAMP" ;file to write to 
-
390
	Call WriteToFile
-
391
SectionEnd
-
392
-
393
Section "WriteInstallPrefs" secPrefs
-
394
	#we set the default preferences
-
395
	!define pathToCqp "$INSTDIR\cwb\bin\win32\cqpserver.exe"
-
396
	!define pathToCqpLib "$INSTDIR\cwb\bin\"
-
397
	!define pathToInit "$INSTDIR\cwb\cqpserver.init"
-
398
	!define pathToR "$INSTDIR\R\bin\x64\Rterm.exe"
-
399
	!define pathToTT "$PROGRAMFILES\treetagger"
-
400
	!define pathToTTMod "$PROGRAMFILES\treetagger\models"
-
401
-
402
	FileOpen $4 "$INSTDIR\install.prefs" a
-
403
	FileSeek $4 0 END
-
404
	FileWrite $4 "$\r$\ncqi_server_path_to_cqplib=${pathToCqpLib}"
-
405
	FileWrite $4 "$\r$\ncqi_server_path_to_executable=${pathToCqp}"
-
406
	FileWrite $4 "$\r$\ncqi_server_path_to_init_file=${pathToInit}"
-
407
	FileWrite $4 "$\r$\nr_path_to_executable=${pathToR}"
-
408
	FileWrite $4 "$\r$\ntreetagger_install_path=${pathToTT}"
-
409
	FileWrite $4 "$\r$\ntreetagger_models_path=${pathToTTMod}"
-
410
	FileClose $4 ; and close the file
-
411
SectionEnd
-
412
-
413 468
;UninstallText "This will uninstall TXM"
 
414 469
 
415 470
;uninstaller section start
 
416
Section "Uninstall"
+Section "Uninstall"
417 471

  
418
	# Delete installation key
+	# Delete installation key
472
	
473
	DeleteRegKey /ifempty HKCU "Software\TXM"
474
	
475
	# Delete uninstaller key
476
	
477
	DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TXM"
478
	
479
	# we remove the software
480
	
481
	RMDir /r $INSTDIR
482
	
483
	# second, remove the link from the start menu
484
	
485
	RMDir /r "$SMPROGRAMS\TXM\"
486
	
487
SectionEnd
419 488

  
420
	DeleteRegKey /ifempty HKCU "Software\TXM"
-
421
	# Delete uninstaller key
-
422
	DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TXM"
-
423
	# we remove the software
-
424
	RMDir /r $INSTDIR
-
425
	# second, remove the link from the start menu
-
426
	RMDir /r "$SMPROGRAMS\TXM\"
-
427
SectionEnd

Formats disponibles : Unified diff