Statistics
| Revision:

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

History | View | Annotate | Download (15.1 kB)

1 748 sjacqu01
!include MUI2.nsh
2 728 mdecorde
3 748 sjacqu01
!include nsDialogs.nsh
4 728 mdecorde
5 748 sjacqu01
!include LogicLib.nsh
6 728 mdecorde
7 748 sjacqu01
;general
8 728 mdecorde
9 1566 mdecorde
Name "TXM TXMVERSION"
10 728 mdecorde
11 818 sjacqu01
;!define Version ""
12 2043 mdecorde
!define Version "-TXMVERSION"
13 811 sjacqu01
14 728 mdecorde
15 2747 mdecorde
OutFile "../TXM_TXMDATEVERSION_Win64_installer.exe"
16 728 mdecorde
17 818 sjacqu01
InstallDir "$PROGRAMFILES64\TXM${Version}"
18 818 sjacqu01
19 748 sjacqu01
RequestExecutionLevel admin
20 728 mdecorde
21 748 sjacqu01
;compression
22 728 mdecorde
23 1174 sjacqu01
;SetCompressor /FINAL /SOLID lzma
24 728 mdecorde
25 1174 sjacqu01
;SetCompressorDictSize 64
26 728 mdecorde
27 728 mdecorde
28 748 sjacqu01
;interface configuration
29 728 mdecorde
30 748 sjacqu01
!define MUI_HEADERIMAGE
31 728 mdecorde
32 748 sjacqu01
!define MUI_HEADERIMAGE_RIGHT
33 728 mdecorde
34 748 sjacqu01
!define MUI_HEADERIMAGE_BITMAP "header.bmp"
35 728 mdecorde
36 748 sjacqu01
!define MUI_HEADERIMAGE_UNBITMAP "header.bmp"
37 728 mdecorde
38 748 sjacqu01
!define MUI_ICON "install.ico"
39 728 mdecorde
40 748 sjacqu01
!define MUI_UNICON "uninstall.ico"
41 728 mdecorde
42 748 sjacqu01
!define MUI_WELCOMEFINISHPAGE_BITMAP "welcome.bmp" ; optional
43 728 mdecorde
44 728 mdecorde
45 748 sjacqu01
;Welcome conf
46 728 mdecorde
47 748 sjacqu01
;!define MUI_WELCOMEFINISHPAGE_BITMAP "welcome.bmp" ; optional
48 728 mdecorde
49 748 sjacqu01
!define MUI_WELCOMEPAGE_TITLE $(WelcomeTitleMessage)
50 728 mdecorde
51 748 sjacqu01
!define MUI_WELCOMEPAGE_TEXT $(WelcomeTextMessage)
52 728 mdecorde
53 728 mdecorde
54 748 sjacqu01
;Finish conf
55 728 mdecorde
56 748 sjacqu01
!define MUI_FINISHPAGE_TITLE $(FinishTitleMessage)
57 728 mdecorde
58 748 sjacqu01
!define MUI_FINISHPAGE_TEXT $(FinishTextMessage)
59 728 mdecorde
60 728 mdecorde
61 748 sjacqu01
;pages
62 728 mdecorde
63 728 mdecorde
64 748 sjacqu01
!insertmacro MUI_PAGE_WELCOME
65 728 mdecorde
66 728 mdecorde
;!insertmacro MUI_PAGE_LICENSE "license_agreement.txt"
67 728 mdecorde
!insertmacro MUI_PAGE_DIRECTORY
68 728 mdecorde
69 728 mdecorde
Page Custom MyCustomPage MyCustomLeave
70 728 mdecorde
Var Dialog
71 754 sjacqu01
Var Checkbox1
72 728 mdecorde
73 728 mdecorde
Var CheckState1 ; Stored globally so we remember the choice if the user presses the back button and goes back to our page
74 754 sjacqu01
Var Checkbox2
75 728 mdecorde
76 728 mdecorde
Var CheckState2 ; Stored globally so we remember the choice if the user presses the back button and goes back to our page
77 728 mdecorde
Function MyCustomPage
78 728 mdecorde
	!insertmacro MUI_HEADER_TEXT $(AdvancedOptionsTitle) $(AdvancedOptionsSubTitle)
79 728 mdecorde
80 728 mdecorde
	nsDialogs::Create 1018
81 728 mdecorde
	Pop $Dialog
82 728 mdecorde
83 728 mdecorde
	${If} $Dialog == error
84 728 mdecorde
		Abort
85 728 mdecorde
	${EndIf}
86 728 mdecorde
87 728 mdecorde
	${NSD_CreateCheckBox} 0 0 100% 30% $(LocalInstallMessage)
88 728 mdecorde
	Pop $Checkbox1
89 728 mdecorde
90 728 mdecorde
;	${NSD_Check} $Checkbox1
91 728 mdecorde
92 728 mdecorde
	${NSD_CreateCheckBox} 0 30% 100% 30% $(AskUserDirMessage)
93 728 mdecorde
	Pop $Checkbox2
94 728 mdecorde
95 728 mdecorde
;	${NSD_Check} $Checkbox2
96 728 mdecorde
97 728 mdecorde
	nsDialogs::Show
98 728 mdecorde
FunctionEnd
99 728 mdecorde
100 728 mdecorde
Function MyCustomLeave
101 1214 mdecorde
  ${NSD_GetState} $Checkbox1 $CheckState1
102 728 mdecorde
103 754 sjacqu01
  ${If} $CheckState1 <> 0
104 754 sjacqu01
105 754 sjacqu01
    file ROAMINGINSTALL
106 754 sjacqu01
107 728 mdecorde
  ${EndIf}
108 728 mdecorde
109 1214 mdecorde
  ${NSD_GetState} $Checkbox2 $CheckState2
110 728 mdecorde
111 754 sjacqu01
  ${If} $CheckState2 <> 0
112 754 sjacqu01
113 754 sjacqu01
    file ASKUSERDIRECTORY
114 754 sjacqu01
115 728 mdecorde
  ${EndIf}
116 728 mdecorde
FunctionEnd
117 728 mdecorde
118 728 mdecorde
119 754 sjacqu01
!insertmacro MUI_PAGE_INSTFILES
120 728 mdecorde
121 754 sjacqu01
!insertmacro MUI_UNPAGE_CONFIRM
122 728 mdecorde
123 754 sjacqu01
!insertmacro MUI_UNPAGE_INSTFILES
124 728 mdecorde
125 754 sjacqu01
!insertmacro MUI_PAGE_FINISH
126 728 mdecorde
127 754 sjacqu01
128 754 sjacqu01
;Languages
129 754 sjacqu01
130 754 sjacqu01
!insertmacro MUI_LANGUAGE "English"
131 754 sjacqu01
!insertmacro MUI_LANGUAGE "French"
132 754 sjacqu01
!insertmacro MUI_LANGUAGE "Russian"
133 754 sjacqu01
134 728 mdecorde
;Lang Strings ENGLISH
135 728 mdecorde
LangString AdvancedOptionsTitle ${LANG_ENGLISH} "Advanced options"
136 728 mdecorde
LangString AdvancedOptionsSubTitle ${LANG_ENGLISH} "Check these options only for specific Windows configurations"
137 754 sjacqu01
LangString LocalInstallMessage ${LANG_ENGLISH} "Do not use local user directory (check this option to use a roaming Windows account home directory)."
138 728 mdecorde
139 754 sjacqu01
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 728 mdecorde
141 754 sjacqu01
LangString InfosTitleMessage ${LANG_ENGLISH} "For your information"
142 728 mdecorde
143 754 sjacqu01
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 728 mdecorde
145 754 sjacqu01
LangString WelcomeTitleMessage ${LANG_ENGLISH} "Welcome to TXM setup"
146 728 mdecorde
147 754 sjacqu01
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 728 mdecorde
149 754 sjacqu01
LangString FinishTitleMessage ${LANG_ENGLISH} "Installation done"
150 728 mdecorde
151 754 sjacqu01
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 728 mdecorde
153 754 sjacqu01
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 728 mdecorde
155 754 sjacqu01
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 728 mdecorde
157 754 sjacqu01
LangString UninstallWindowsMessage ${LANG_ENGLISH} "TXM is already installed on this machine.$\n$\nClick `OK` to uninstall the previous version first (TXM corpora will NOT be removed).$\nOr click `Cancel` to abort this installation.$\nPlease ensure that no TXM is running during the installation process."
158 728 mdecorde
159 728 mdecorde
160 728 mdecorde
;Lang Strings FRENCH
161 748 sjacqu01
LangString AdvancedOptionsTitle ${LANG_FRENCH} "Options avanc?es"
162 748 sjacqu01
LangString AdvancedOptionsSubTitle ${LANG_FRENCH} "Ne cocher ces options que pour des configurations Windows particuli?res"
163 754 sjacqu01
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 728 mdecorde
165 754 sjacqu01
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 728 mdecorde
167 754 sjacqu01
LangString InfosTitleMessage ${LANG_FRENCH} "Pour votre information"
168 728 mdecorde
169 754 sjacqu01
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 728 mdecorde
171 754 sjacqu01
LangString WelcomeTitleMessage ${LANG_FRENCH} "Bienvenue dans l'installeur de TXM"
172 728 mdecorde
173 754 sjacqu01
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 728 mdecorde
175 754 sjacqu01
LangString FinishTitleMessage ${LANG_FRENCH} "Installation termin?e."
176 728 mdecorde
177 754 sjacqu01
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 728 mdecorde
179 754 sjacqu01
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 728 mdecorde
181 754 sjacqu01
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 728 mdecorde
183 754 sjacqu01
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."
184 728 mdecorde
185 728 mdecorde
186 754 sjacqu01
;END OF LANG MESSAGES
187 728 mdecorde
188 728 mdecorde
189 754 sjacqu01
Function .onInit
190 728 mdecorde
191 754 sjacqu01
	;!insertmacro MUI_LANGDLL_DISPLAY
192 754 sjacqu01
193 728 mdecorde
194 754 sjacqu01
	setOutPath $INSTDIR
195 754 sjacqu01
196 728 mdecorde
197 818 sjacqu01
		ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TXM${Version}" "UninstallString"
198 754 sjacqu01
199 754 sjacqu01
		StrCmp $R0 "" done
200 754 sjacqu01
201 728 mdecorde
202 754 sjacqu01
		MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION $(UninstallWindowsMessage) IDOK uninst
203 728 mdecorde
204 754 sjacqu01
		Abort
205 728 mdecorde
206 728 mdecorde
207 728 mdecorde
208 754 sjacqu01
	;Run the uninstaller
209 754 sjacqu01
210 754 sjacqu01
	uninst:
211 754 sjacqu01
212 754 sjacqu01
		ClearErrors
213 754 sjacqu01
214 754 sjacqu01
		ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
215 754 sjacqu01
216 754 sjacqu01
		IfErrors no_remove_uninstaller done
217 754 sjacqu01
218 754 sjacqu01
		no_remove_uninstaller:
219 754 sjacqu01
220 754 sjacqu01
	done:
221 754 sjacqu01
222 748 sjacqu01
FunctionEnd
223 728 mdecorde
224 748 sjacqu01
Section "Copy files" SecFiles
225 728 mdecorde
226 748 sjacqu01
	#we install txm in INSTDIR
227 748 sjacqu01
228 748 sjacqu01
	SetOutPath $INSTDIR
229 748 sjacqu01
230 1566 mdecorde
	File /r ..\exportRCP\win32.win32.x86_64\TXM\*.*
231 748 sjacqu01
232 748 sjacqu01
	;File /r plugins
233 748 sjacqu01
	;File /r features
234 748 sjacqu01
	;File /r configuration
235 2747 mdecorde
	File /r jre
236 748 sjacqu01
	;File /r p2
237 748 sjacqu01
	;File /r doc
238 748 sjacqu01
	;File /r schema
239 748 sjacqu01
	;File /r scripts
240 748 sjacqu01
	;File /r samples
241 748 sjacqu01
	;File /r xsl
242 748 sjacqu01
	;File /r css
243 748 sjacqu01
	;File TXM.ico
244 748 sjacqu01
	;File TXM.bat
245 748 sjacqu01
	;File TXM.vbs
246 748 sjacqu01
	;File StartDialog.jar
247 748 sjacqu01
	;File OpenStartUpLogsDirectory.bat
248 748 sjacqu01
	;File IEShims.dll
249 748 sjacqu01
	;File libcharset-1.dll
250 748 sjacqu01
	;File libglib-2.0-0.dll
251 748 sjacqu01
	;File libgnurx-0.dll
252 748 sjacqu01
	;File libiconv-2.dll
253 748 sjacqu01
	;File libintl-8.dll
254 748 sjacqu01
	;File libpcre-1.dll
255 748 sjacqu01
	;File pcre3.dll
256 748 sjacqu01
257 748 sjacqu01
	# hide TXM.exe
258 748 sjacqu01
	SetFileAttributes "$INSTDIR/TXM.exe" HIDDEN
259 748 sjacqu01
260 748 sjacqu01
	# the users right on install dir to enable updates
261 748 sjacqu01
262 748 sjacqu01
	AccessControl::GrantOnFile "$INSTDIR\TXM" "(S-1-5-32-545)" "FullAccess"
263 748 sjacqu01
264 748 sjacqu01
	#we set the shortcuts
265 748 sjacqu01
266 748 sjacqu01
	SetShellVarContext all
267 748 sjacqu01
268 818 sjacqu01
	CreateDirectory "$SMPROGRAMS\TXM${Version}"
269 748 sjacqu01
270 2076 mdecorde
	CreateShortCut "$SMPROGRAMS\TXM${Version}\TXM${Version}.lnk" "$INSTDIR\TXM.bat" "" "$INSTDIR\TXM.ico" 0
271 2076 mdecorde
	CreateShortCut "$SMPROGRAMS\TXM${Version}\TXM${Version} debug.lnk" "$INSTDIR\TXM debug.bat" "" "$INSTDIR\TXM.ico" 0
272 2076 mdecorde
	CreateShortCut "$SMPROGRAMS\TXM${Version}\uninstall TXM${Version}.lnk" "$INSTDIR\uninstall.exe"
273 818 sjacqu01
	#CreateShortCut "$SMPROGRAMS\TXM${Version}\Manuel utilisateur FR.pdf.lnk" "$INSTDIR\doc\Manuel de TXM 0.7 FR.pdf"
274 818 sjacqu01
	#CreateShortCut "$SMPROGRAMS\TXM${Version}\User Manual EN.pdf.lnk" "$INSTDIR\doc\TXM 0.7 Manual EN.pdf"
275 748 sjacqu01
276 728 mdecorde
277 748 sjacqu01
	; Store installation folder
278 748 sjacqu01
279 818 sjacqu01
	WriteRegStr HKCU "Software\TXM${Version}" "" $INSTDIR
280 748 sjacqu01
281 748 sjacqu01
	#register the TXM uninstall to windows programs
282 748 sjacqu01
283 818 sjacqu01
	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TXM${Version}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
284 748 sjacqu01
285 868 sjacqu01
	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. "
286 754 sjacqu01
287 818 sjacqu01
	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TXM${Version}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
288 868 sjacqu01
289 868 sjacqu01
290 868 sjacqu01
	#we create the uninstaller
291 748 sjacqu01
292 868 sjacqu01
	WriteUninstaller "$INSTDIR\uninstall.exe"
293 868 sjacqu01
294 868 sjacqu01
295 868 sjacqu01
296 748 sjacqu01
SectionEnd
297 728 mdecorde
298 748 sjacqu01
Function WriteToFile
299 728 mdecorde
300 748 sjacqu01
	Exch $0 ;file to write to
301 748 sjacqu01
302 748 sjacqu01
	Exch
303 748 sjacqu01
304 748 sjacqu01
	Exch $1 ;text to write
305 748 sjacqu01
306 748 sjacqu01
	FileOpen $0 $0 a #open file
307 748 sjacqu01
308 748 sjacqu01
	FileSeek $0 0 END #go to end
309 748 sjacqu01
310 748 sjacqu01
	FileWrite $0 $1 #write to file
311 748 sjacqu01
312 748 sjacqu01
	FileClose $0
313 748 sjacqu01
314 748 sjacqu01
	Pop $1
315 748 sjacqu01
316 748 sjacqu01
	Pop $0
317 748 sjacqu01
318 748 sjacqu01
FunctionEnd
319 728 mdecorde
320 728 mdecorde
321 748 sjacqu01
### TimeStamp
322 728 mdecorde
323 748 sjacqu01
!ifndef TimeStamp
324 728 mdecorde
325 748 sjacqu01
    !define TimeStamp "!insertmacro _TimeStamp"
326 748 sjacqu01
327 748 sjacqu01
    !macro _TimeStamp FormatedString
328 748 sjacqu01
329 748 sjacqu01
        !ifdef __UNINSTALL__
330 748 sjacqu01
331 748 sjacqu01
            Call un.__TimeStamp
332 748 sjacqu01
333 748 sjacqu01
        !else
334 748 sjacqu01
335 748 sjacqu01
            Call __TimeStamp
336 748 sjacqu01
337 748 sjacqu01
        !endif
338 748 sjacqu01
339 748 sjacqu01
        Pop ${FormatedString}
340 748 sjacqu01
341 748 sjacqu01
    !macroend
342 748 sjacqu01
343 748 sjacqu01
344 748 sjacqu01
!macro __TimeStamp UN
345 728 mdecorde
346 728 mdecorde
347 748 sjacqu01
Function ${UN}__TimeStamp
348 728 mdecorde
349 748 sjacqu01
    ClearErrors
350 748 sjacqu01
351 748 sjacqu01
    ## Store the needed Registers on the stack
352 748 sjacqu01
353 748 sjacqu01
        Push $0 ; Stack $0
354 748 sjacqu01
355 748 sjacqu01
        Push $1 ; Stack $1 $0
356 748 sjacqu01
357 748 sjacqu01
        Push $2 ; Stack $2 $1 $0
358 748 sjacqu01
359 748 sjacqu01
        Push $3 ; Stack $3 $2 $1 $0
360 748 sjacqu01
361 748 sjacqu01
        Push $4 ; Stack $4 $3 $2 $1 $0
362 748 sjacqu01
363 748 sjacqu01
        Push $5 ; Stack $5 $4 $3 $2 $1 $0
364 748 sjacqu01
365 748 sjacqu01
        Push $6 ; Stack $6 $5 $4 $3 $2 $1 $0
366 748 sjacqu01
367 748 sjacqu01
        Push $7 ; Stack $7 $6 $5 $4 $3 $2 $1 $0
368 748 sjacqu01
369 748 sjacqu01
        ;Push $8 ; Stack $8 $7 $6 $5 $4 $3 $2 $1 $0
370 748 sjacqu01
371 748 sjacqu01
372 748 sjacqu01
    ## Call System API to get the current system Time
373 748 sjacqu01
374 748 sjacqu01
        System::Alloc 16
375 748 sjacqu01
376 748 sjacqu01
        Pop $0
377 748 sjacqu01
378 748 sjacqu01
        System::Call 'kernel32::GetLocalTime(i) i(r0)'
379 748 sjacqu01
380 748 sjacqu01
        System::Call '*$0(&i2, &i2, &i2, &i2, &i2, &i2, &i2, &i2)i (.r1, .r2, n, .r3, .r4, .r5, .r6, .r7)'
381 748 sjacqu01
382 748 sjacqu01
        System::Free $0
383 748 sjacqu01
384 748 sjacqu01
385 748 sjacqu01
        IntFmt $2 "%02i" $2
386 748 sjacqu01
387 748 sjacqu01
        IntFmt $3 "%02i" $3
388 748 sjacqu01
389 748 sjacqu01
        IntFmt $4 "%02i" $4
390 748 sjacqu01
391 748 sjacqu01
        IntFmt $5 "%02i" $5
392 748 sjacqu01
393 748 sjacqu01
        IntFmt $6 "%02i" $6
394 748 sjacqu01
395 748 sjacqu01
396 748 sjacqu01
    ## Generate Timestamp
397 748 sjacqu01
398 748 sjacqu01
        ;StrCpy $0 "YEAR=$1$\nMONTH=$2$\nDAY=$3$\nHOUR=$4$\nMINUITES=$5$\nSECONDS=$6$\nMS$7"
399 748 sjacqu01
400 748 sjacqu01
        StrCpy $0 "$1$2$3$4$5$6.$7"
401 748 sjacqu01
402 748 sjacqu01
403 748 sjacqu01
    ## Restore the Registers and add Timestamp to the Stack
404 748 sjacqu01
405 748 sjacqu01
        ;Pop $8  ; Stack $7 $6 $5 $4 $3 $2 $1 $0
406 748 sjacqu01
407 748 sjacqu01
        Pop $7  ; Stack $6 $5 $4 $3 $2 $1 $0
408 748 sjacqu01
409 748 sjacqu01
        Pop $6  ; Stack $5 $4 $3 $2 $1 $0
410 748 sjacqu01
411 748 sjacqu01
        Pop $5  ; Stack $4 $3 $2 $1 $0
412 748 sjacqu01
413 748 sjacqu01
        Pop $4  ; Stack $3 $2 $1 $0
414 748 sjacqu01
415 748 sjacqu01
        Pop $3  ; Stack $2 $1 $0
416 748 sjacqu01
417 748 sjacqu01
        Pop $2  ; Stack $1 $0
418 748 sjacqu01
419 748 sjacqu01
        Pop $1  ; Stack $0
420 748 sjacqu01
421 748 sjacqu01
        Exch $0 ; Stack ${TimeStamp}
422 748 sjacqu01
423 748 sjacqu01
424 748 sjacqu01
FunctionEnd
425 728 mdecorde
426 748 sjacqu01
!macroend
427 728 mdecorde
428 748 sjacqu01
!insertmacro __TimeStamp ""
429 728 mdecorde
430 748 sjacqu01
!insertmacro __TimeStamp "un."
431 728 mdecorde
432 748 sjacqu01
!endif
433 728 mdecorde
434 748 sjacqu01
###########
435 728 mdecorde
436 728 mdecorde
437 748 sjacqu01
Section "WriteInstallStamp" secStamp
438 728 mdecorde
439 748 sjacqu01
	${TimeStamp} $0
440 748 sjacqu01
441 748 sjacqu01
	Push "$0"
442 748 sjacqu01
443 748 sjacqu01
	Push "$INSTDIR\STAMP" ;file to write to
444 748 sjacqu01
445 748 sjacqu01
	Call WriteToFile
446 748 sjacqu01
447 748 sjacqu01
SectionEnd
448 728 mdecorde
449 728 mdecorde
450 748 sjacqu01
Section "WriteInstallPrefs" secPrefs
451 728 mdecorde
452 748 sjacqu01
	#we set the default preferences
453 748 sjacqu01
454 754 sjacqu01
	;!define pathToCqp "$INSTDIR\cwb\bin\win32\cqpserver.exe"
455 748 sjacqu01
456 754 sjacqu01
	;!define pathToCqpLib "$INSTDIR\cwb\bin\"
457 748 sjacqu01
458 754 sjacqu01
	;!define pathToInit "$INSTDIR\cwb\cqpserver.init"
459 748 sjacqu01
460 754 sjacqu01
	;!define pathToR "$INSTDIR\R\bin\x64\Rterm.exe"
461 748 sjacqu01
462 754 sjacqu01
	;!define pathToTT "$PROGRAMFILES\treetagger"
463 748 sjacqu01
464 754 sjacqu01
	;!define pathToTTMod "$PROGRAMFILES\treetagger\models"
465 748 sjacqu01
466 728 mdecorde
467 754 sjacqu01
	;FileOpen $4 "$INSTDIR\install.prefs" a
468 748 sjacqu01
469 754 sjacqu01
	;FileSeek $4 0 END
470 748 sjacqu01
471 754 sjacqu01
	;FileWrite $4 "$\r$\ncqi_server_path_to_cqplib=${pathToCqpLib}"
472 748 sjacqu01
473 754 sjacqu01
	;FileWrite $4 "$\r$\ncqi_server_path_to_executable=${pathToCqp}"
474 748 sjacqu01
475 754 sjacqu01
	;FileWrite $4 "$\r$\ncqi_server_path_to_init_file=${pathToInit}"
476 748 sjacqu01
477 754 sjacqu01
	;FileWrite $4 "$\r$\nr_path_to_executable=${pathToR}"
478 748 sjacqu01
479 754 sjacqu01
	;FileWrite $4 "$\r$\ntreetagger_install_path=${pathToTT}"
480 748 sjacqu01
481 754 sjacqu01
	;FileWrite $4 "$\r$\ntreetagger_models_path=${pathToTTMod}"
482 748 sjacqu01
483 754 sjacqu01
	;FileClose $4 ; and close the file
484 748 sjacqu01
485 748 sjacqu01
SectionEnd
486 728 mdecorde
487 728 mdecorde
488 1214 mdecorde
;UninstallText "This will uninstall TXM"
489 728 mdecorde
490 728 mdecorde
491 728 mdecorde
492 1214 mdecorde
;uninstaller section start
493 1214 mdecorde
494 748 sjacqu01
Section "Uninstall"
495 728 mdecorde
496 868 sjacqu01
	SetShellVarContext all
497 868 sjacqu01
498 748 sjacqu01
	# Delete installation key
499 748 sjacqu01
500 818 sjacqu01
	DeleteRegKey /ifempty HKCU "Software\TXM${Version}"
501 748 sjacqu01
502 748 sjacqu01
	# Delete uninstaller key
503 748 sjacqu01
504 818 sjacqu01
	DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TXM${Version}"
505 748 sjacqu01
506 748 sjacqu01
	# we remove the software
507 748 sjacqu01
508 748 sjacqu01
	RMDir /r $INSTDIR
509 748 sjacqu01
510 818 sjacqu01
	RMDir /r "$SMPROGRAMS\TXM${Version}"
511 748 sjacqu01
512 748 sjacqu01
SectionEnd