Index: TXM/trunk/org.txm.setups/shared/win/messages.nsi
===================================================================
--- TXM/trunk/org.txm.setups/shared/win/messages.nsi	(revision 0)
+++ TXM/trunk/org.txm.setups/shared/win/messages.nsi	(revision 3503)
@@ -0,0 +1,53 @@
+
+;Lang Strings ENGLISH
+LangString AdvancedOptionsTitle ${LANG_ENGLISH} "Advanced options"
+LangString AdvancedOptionsSubTitle ${LANG_ENGLISH} "Check these options only for specific Windows configurations"
+LangString LocalInstallMessage ${LANG_ENGLISH} "Do not use local user directory (check this option to use a roaming Windows account home directory)."
+
+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)."
+
+LangString InfosTitleMessage ${LANG_ENGLISH} "For your information"
+
+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"
+
+LangString WelcomeTitleMessage ${LANG_ENGLISH} "Welcome to TXM setup"
+
+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'."
+
+LangString FinishTitleMessage ${LANG_ENGLISH} "Installation done"
+
+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."
+
+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?"
+
+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?"
+
+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."
+
+
+;Lang Strings FRENCH
+LangString AdvancedOptionsTitle ${LANG_FRENCH} "Options avancÃ©es"
+LangString AdvancedOptionsSubTitle ${LANG_FRENCH} "Ne cocher ces options que pour des configurations Windows particuliÃ¨res"
+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 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 InfosTitleMessage ${LANG_FRENCH} "Pour votre information"
+
+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 WelcomeTitleMessage ${LANG_FRENCH} "Bienvenue dans l'installeur de TXM"
+
+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 FinishTitleMessage ${LANG_FRENCH} "Installation terminÃ©e."
+
+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 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 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 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."
+
+;END OF LANG MESSAGES
\ No newline at end of file
Index: TXM/trunk/org.txm.setups/shared/win/txm.nsi
===================================================================
--- TXM/trunk/org.txm.setups/shared/win/txm.nsi	(revision 3502)
+++ TXM/trunk/org.txm.setups/shared/win/txm.nsi	(revision 3503)
@@ -1,16 +1,15 @@
 Unicode True
 
 !include MUI2.nsh
-
 !include nsDialogs.nsh
-
 !include LogicLib.nsh
 
+!include txmfunctions.nsi
+
 ;general
 
 Name "TXM TXMVERSION"
 
-;!define Version ""
 !define Version "-TXMVERSION"
 
 OutFile "../TXM_TXMDATEVERSION_Win64_installer.exe"
@@ -19,27 +18,16 @@
 
 ;RequestExecutionLevel admin
 
-;compression
+;compression options set in the build command line
 
-;SetCompressor /FINAL /SOLID lzma
-
-;SetCompressorDictSize 64
-
-
 ;interface configuration
 
 !define MUI_HEADERIMAGE
-
 !define MUI_HEADERIMAGE_RIGHT
-
 !define MUI_HEADERIMAGE_BITMAP "header.bmp"
-
 !define MUI_HEADERIMAGE_UNBITMAP "header.bmp"
-
 !define MUI_ICON "install.ico"
-
 !define MUI_UNICON "uninstall.ico"
-
 !define MUI_WELCOMEFINISHPAGE_BITMAP "welcome.bmp" ; optional
 
 
@@ -58,16 +46,14 @@
 
 !define MUI_FINISHPAGE_TEXT $(FinishTextMessage)
 
-
 ;pages
 
-
 !insertmacro MUI_PAGE_WELCOME
 
 ;!insertmacro MUI_PAGE_LICENSE "license_agreement.txt"  
 !insertmacro MUI_PAGE_DIRECTORY
 
-Page Custom MyCustomPage MyCustomLeave
+Page Custom SpecialOptionsPage SpecialOptionsLeavePage
 Var Dialog
 Var Checkbox1
 
@@ -75,7 +61,7 @@
 Var Checkbox2
 
 Var CheckState2 ; Stored globally so we remember the choice if the user presses the back button and goes back to our page
-Function MyCustomPage
+Function SpecialOptionsPage
 	!insertmacro MUI_HEADER_TEXT $(AdvancedOptionsTitle) $(AdvancedOptionsSubTitle)
 
 	nsDialogs::Create 1018
@@ -98,7 +84,7 @@
 	nsDialogs::Show
 FunctionEnd
 
-Function MyCustomLeave
+Function SpecialOptionsLeavePage
   ${NSD_GetState} $Checkbox1 $CheckState1
 
   ${If} $CheckState1 <> 0
@@ -125,73 +111,20 @@
 
 !insertmacro MUI_PAGE_FINISH
 
+;Languages (must be set after calling the MUI_(UN)PAGE)
 
-;Languages
-
 !insertmacro MUI_LANGUAGE "English"
 !insertmacro MUI_LANGUAGE "French"
 !insertmacro MUI_LANGUAGE "Russian"
 
-;Lang Strings ENGLISH
-LangString AdvancedOptionsTitle ${LANG_ENGLISH} "Advanced options"
-LangString AdvancedOptionsSubTitle ${LANG_ENGLISH} "Check these options only for specific Windows configurations"
-LangString LocalInstallMessage ${LANG_ENGLISH} "Do not use local user directory (check this option to use a roaming Windows account home directory)."
+!include messages.nsi
 
-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)."
-
-LangString InfosTitleMessage ${LANG_ENGLISH} "For your information"
-
-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"
-
-LangString WelcomeTitleMessage ${LANG_ENGLISH} "Welcome to TXM setup"
-
-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'."
-
-LangString FinishTitleMessage ${LANG_ENGLISH} "Installation done"
-
-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."
-
-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?"
-
-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?"
-
-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."
-
-
-;Lang Strings FRENCH
-LangString AdvancedOptionsTitle ${LANG_FRENCH} "Options avancées"
-LangString AdvancedOptionsSubTitle ${LANG_FRENCH} "Ne cocher ces options que pour des configurations Windows particulières"
-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 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 InfosTitleMessage ${LANG_FRENCH} "Pour votre information"
-
-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 WelcomeTitleMessage ${LANG_FRENCH} "Bienvenue dans l'installeur de TXM"
-
-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 FinishTitleMessage ${LANG_FRENCH} "Installation terminée."
-
-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 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 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 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."
-
-;END OF LANG MESSAGES
-
-
 Function .onInit
 
 	;!insertmacro MUI_LANGDLL_DISPLAY
 	
 
-	setOutPath $INSTDIR
+		setOutPath $INSTDIR
 	
 
 		ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TXM${Version}" "UninstallString"
@@ -298,149 +231,9 @@
 	
 	WriteUninstaller "$INSTDIR\uninstall.exe"
 	
-
-
 SectionEnd
 
-Function WriteToFile
 
-	Exch $0 ;file to write to
-	
-	Exch
-	
-	Exch $1 ;text to write
-	
-	FileOpen $0 $0 a #open file
-	
-	FileSeek $0 0 END #go to end
-	
-	FileWrite $0 $1 #write to file
-	
-	FileClose $0
-	
-	Pop $1
-	
-	Pop $0
-	
-FunctionEnd
-
-
-### TimeStamp
-
-!ifndef TimeStamp
-
-    !define TimeStamp "!insertmacro _TimeStamp"
-    
-    !macro _TimeStamp FormatedString
-    
-        !ifdef __UNINSTALL__
-	
-            Call un.__TimeStamp
-	    
-        !else
-	
-            Call __TimeStamp
-	    
-        !endif
-	
-        Pop ${FormatedString}
-	
-    !macroend
-    
- 
-!macro __TimeStamp UN
-
-
-Function ${UN}__TimeStamp
-
-    ClearErrors
-    
-    ## Store the needed Registers on the stack
-    
-        Push $0 ; Stack $0
-	
-        Push $1 ; Stack $1 $0
-	
-        Push $2 ; Stack $2 $1 $0
-	
-        Push $3 ; Stack $3 $2 $1 $0
-	
-        Push $4 ; Stack $4 $3 $2 $1 $0
-	
-        Push $5 ; Stack $5 $4 $3 $2 $1 $0
-	
-        Push $6 ; Stack $6 $5 $4 $3 $2 $1 $0
-	
-        Push $7 ; Stack $7 $6 $5 $4 $3 $2 $1 $0
-	
-        ;Push $8 ; Stack $8 $7 $6 $5 $4 $3 $2 $1 $0
-	
- 
-    ## Call System API to get the current system Time
-    
-        System::Alloc 16
-	
-        Pop $0
-	
-        System::Call 'kernel32::GetLocalTime(i) i(r0)'
-	
-        System::Call '*$0(&i2, &i2, &i2, &i2, &i2, &i2, &i2, &i2)i (.r1, .r2, n, .r3, .r4, .r5, .r6, .r7)'
-	
-        System::Free $0
-	
- 
-        IntFmt $2 "%02i" $2
-	
-        IntFmt $3 "%02i" $3
-	
-        IntFmt $4 "%02i" $4
-	
-        IntFmt $5 "%02i" $5
-	
-        IntFmt $6 "%02i" $6
-	
- 
-    ## Generate Timestamp
-    
-        ;StrCpy $0 "YEAR=$1$\nMONTH=$2$\nDAY=$3$\nHOUR=$4$\nMINUITES=$5$\nSECONDS=$6$\nMS$7"
-	
-        StrCpy $0 "$1$2$3$4$5$6.$7"
-	
- 
-    ## Restore the Registers and add Timestamp to the Stack
-    
-        ;Pop $8  ; Stack $7 $6 $5 $4 $3 $2 $1 $0
-	
-        Pop $7  ; Stack $6 $5 $4 $3 $2 $1 $0
-	
-        Pop $6  ; Stack $5 $4 $3 $2 $1 $0
-	
-        Pop $5  ; Stack $4 $3 $2 $1 $0
-	
-        Pop $4  ; Stack $3 $2 $1 $0
-	
-        Pop $3  ; Stack $2 $1 $0
-	
-        Pop $2  ; Stack $1 $0
-	
-        Pop $1  ; Stack $0
-	
-        Exch $0 ; Stack ${TimeStamp}
-	
- 
-FunctionEnd
-
-!macroend
-
-!insertmacro __TimeStamp ""
-
-!insertmacro __TimeStamp "un."
-
-!endif
-
-###########
-
-
 Section "WriteInstallStamp" secStamp
 
 	${TimeStamp} $0
Index: TXM/trunk/org.txm.setups/shared/win/txmfunctions.nsi
===================================================================
--- TXM/trunk/org.txm.setups/shared/win/txmfunctions.nsi	(revision 0)
+++ TXM/trunk/org.txm.setups/shared/win/txmfunctions.nsi	(revision 3503)
@@ -0,0 +1,138 @@
+
+Function WriteToFile
+
+	Exch $0 ;file to write to
+	
+	Exch
+	
+	Exch $1 ;text to write
+	
+	FileOpen $0 $0 a #open file
+	
+	FileSeek $0 0 END #go to end
+	
+	FileWrite $0 $1 #write to file
+	
+	FileClose $0
+	
+	Pop $1
+	
+	Pop $0
+	
+FunctionEnd
+
+
+### TimeStamp
+
+!ifndef TimeStamp
+
+    !define TimeStamp "!insertmacro _TimeStamp"
+    
+    !macro _TimeStamp FormatedString
+    
+        !ifdef __UNINSTALL__
+	
+            Call un.__TimeStamp
+	    
+        !else
+	
+            Call __TimeStamp
+	    
+        !endif
+	
+        Pop ${FormatedString}
+	
+    !macroend
+    
+ 
+!macro __TimeStamp UN
+
+
+Function ${UN}__TimeStamp
+
+    ClearErrors
+    
+    ## Store the needed Registers on the stack
+    
+        Push $0 ; Stack $0
+	
+        Push $1 ; Stack $1 $0
+	
+        Push $2 ; Stack $2 $1 $0
+	
+        Push $3 ; Stack $3 $2 $1 $0
+	
+        Push $4 ; Stack $4 $3 $2 $1 $0
+	
+        Push $5 ; Stack $5 $4 $3 $2 $1 $0
+	
+        Push $6 ; Stack $6 $5 $4 $3 $2 $1 $0
+	
+        Push $7 ; Stack $7 $6 $5 $4 $3 $2 $1 $0
+	
+        ;Push $8 ; Stack $8 $7 $6 $5 $4 $3 $2 $1 $0
+	
+ 
+    ## Call System API to get the current system Time
+    
+        System::Alloc 16
+	
+        Pop $0
+	
+        System::Call 'kernel32::GetLocalTime(i) i(r0)'
+	
+        System::Call '*$0(&i2, &i2, &i2, &i2, &i2, &i2, &i2, &i2)i (.r1, .r2, n, .r3, .r4, .r5, .r6, .r7)'
+	
+        System::Free $0
+	
+ 
+        IntFmt $2 "%02i" $2
+	
+        IntFmt $3 "%02i" $3
+	
+        IntFmt $4 "%02i" $4
+	
+        IntFmt $5 "%02i" $5
+	
+        IntFmt $6 "%02i" $6
+	
+ 
+    ## Generate Timestamp
+    
+        ;StrCpy $0 "YEAR=$1$\nMONTH=$2$\nDAY=$3$\nHOUR=$4$\nMINUITES=$5$\nSECONDS=$6$\nMS$7"
+	
+        StrCpy $0 "$1$2$3$4$5$6.$7"
+	
+ 
+    ## Restore the Registers and add Timestamp to the Stack
+    
+        ;Pop $8  ; Stack $7 $6 $5 $4 $3 $2 $1 $0
+	
+        Pop $7  ; Stack $6 $5 $4 $3 $2 $1 $0
+	
+        Pop $6  ; Stack $5 $4 $3 $2 $1 $0
+	
+        Pop $5  ; Stack $4 $3 $2 $1 $0
+	
+        Pop $4  ; Stack $3 $2 $1 $0
+	
+        Pop $3  ; Stack $2 $1 $0
+	
+        Pop $2  ; Stack $1 $0
+	
+        Pop $1  ; Stack $0
+	
+        Exch $0 ; Stack ${TimeStamp}
+	
+ 
+FunctionEnd
+
+!macroend
+
+!insertmacro __TimeStamp ""
+
+!insertmacro __TimeStamp "un."
+
+!endif
+
+###########
