| 2551 |
dpurdie |
1 |
;*****************************************************************
|
|
|
2 |
; Author : Hugues DOILLON
|
|
|
3 |
; Date : 03/2007
|
|
|
4 |
; Modifié :
|
|
|
5 |
;*****************************************************************
|
|
|
6 |
|
|
|
7 |
!include "FileFunc.nsh"
|
|
|
8 |
|
|
|
9 |
!include "LogicLib.nsh"
|
|
|
10 |
|
|
|
11 |
!include "InformationApplication.nsh"
|
|
|
12 |
|
|
|
13 |
!insertmacro GetFileExt
|
|
|
14 |
|
|
|
15 |
; Spécifie si oui ou non l'installation sera silencieuse
|
|
|
16 |
SilentInstall silent
|
|
|
17 |
|
|
|
18 |
;ddp; OutFile "Installation_librairie_temp\SetupInstallationLibrairie.exe"
|
|
|
19 |
|
|
|
20 |
Function .onInit
|
|
|
21 |
|
|
|
22 |
; Fichier écrit contenant la liste des librairies à installer
|
|
|
23 |
FileOpen $R0 "${GBE_BINDIR}\InstallationLibrairie.nsh" w
|
|
|
24 |
|
|
|
25 |
;-------------------------------------------------------------------------------------------------------------------------------
|
|
|
26 |
;-------------------------------------------------------------------------------------------------------------------------------
|
|
|
27 |
|
|
|
28 |
FileWrite $R0 "!macro SectionLibrairies"
|
|
|
29 |
; Retour à la ligne
|
|
|
30 |
FileWriteByte $R0 "13"
|
|
|
31 |
FileWriteByte $R0 "10"
|
|
|
32 |
|
|
|
33 |
; Parcourt des librairies du répertoire SysDir_DLL
|
|
|
34 |
FindFirst $R1 $R2 "${LIBRAIRIE_SYSDIR}\*.*"
|
|
|
35 |
|
|
|
36 |
loop2:
|
|
|
37 |
StrCmp $R2 "" done2
|
|
|
38 |
StrCmp $R2 '.' nothing2
|
|
|
39 |
StrCmp $R2 '..' nothing2
|
|
|
40 |
StrCmp $R2 '.svn' nothing2
|
|
|
41 |
|
|
|
42 |
; Commande d'enregistrement des librairies enrgistré dans le fichier
|
|
|
43 |
FileWrite $R0 "!insertmacro InstallLib DLL 0 REBOOT_PROTECTED $\"${LIBRAIRIE_SYSDIR}\$R2$\" $\"$SYSDIR\$R2$\" $\"$SYSDIR$\""
|
|
|
44 |
|
|
|
45 |
; Retour à la ligne
|
|
|
46 |
FileWriteByte $R0 "13"
|
|
|
47 |
FileWriteByte $R0 "10"
|
|
|
48 |
|
|
|
49 |
nothing2:
|
|
|
50 |
FindNext $R1 $R2
|
|
|
51 |
|
|
|
52 |
Goto loop2
|
|
|
53 |
|
|
|
54 |
done2:
|
|
|
55 |
|
|
|
56 |
;-------------------------------------------------------------------------------------------------------------------------------
|
|
|
57 |
|
|
|
58 |
; Parcourt des librairies du répertoire SysDir_DLL
|
|
|
59 |
FindFirst $R1 $R2 "${LIBRAIRIE_REGISTRED_SYSDIR}\*.*"
|
|
|
60 |
|
|
|
61 |
loop3:
|
|
|
62 |
StrCmp $R2 "" done3
|
|
|
63 |
StrCmp $R2 '.' nothing3
|
|
|
64 |
StrCmp $R2 '..' nothing3
|
|
|
65 |
StrCmp $R2 '.svn' nothing3
|
|
|
66 |
|
|
|
67 |
; Recupere l extension
|
|
|
68 |
${GetFileExt} "$R2" $R3
|
|
|
69 |
|
|
|
70 |
StrCmp $R3 "tlb" 0 else31
|
|
|
71 |
FileWrite $R0 "!insertmacro InstallLib TLB 0 REBOOT_PROTECTED $\"${LIBRAIRIE_REGISTRED_SYSDIR}\$R2$\" $\"$SYSDIR\$R2$\" $\"$SYSDIR$\""
|
|
|
72 |
Goto done31
|
|
|
73 |
else31:
|
|
|
74 |
FileWrite $R0 "!insertmacro InstallLib REGDLL 0 REBOOT_PROTECTED $\"${LIBRAIRIE_REGISTRED_SYSDIR}\$R2$\" $\"$SYSDIR\$R2$\" $\"$SYSDIR$\""
|
|
|
75 |
done31:
|
|
|
76 |
|
|
|
77 |
; Retour à la ligne
|
|
|
78 |
FileWriteByte $R0 "13"
|
|
|
79 |
FileWriteByte $R0 "10"
|
|
|
80 |
|
|
|
81 |
nothing3:
|
|
|
82 |
FindNext $R1 $R2
|
|
|
83 |
|
|
|
84 |
Goto loop3
|
|
|
85 |
|
|
|
86 |
done3:
|
|
|
87 |
|
|
|
88 |
;-------------------------------------------------------------------------------------------------------------------------------
|
|
|
89 |
|
|
|
90 |
; Parcourt des librairies du répertoire Librairie_ProgramFiles
|
|
|
91 |
FindFirst $R1 $R2 "${LIBRAIRIE_PROGRAMFILES}\*.*"
|
|
|
92 |
|
|
|
93 |
loop4:
|
|
|
94 |
StrCmp $R2 "" done4
|
|
|
95 |
StrCmp $R2 '.' nothing4
|
|
|
96 |
StrCmp $R2 '..' nothing4
|
|
|
97 |
StrCmp $R2 '.svn' nothing4
|
|
|
98 |
|
|
|
99 |
; Commande d'enregistrement des librairies enrgistré dans le fichier
|
|
|
100 |
FileWrite $R0 "!insertmacro InstallLib DLL 0 NOREBOOT_PROTECTED $\"${LIBRAIRIE_PROGRAMFILES}\$R2$\" $\"$$INSTDIR\$R2$\" $\"$$INSTDIR$\""
|
|
|
101 |
|
|
|
102 |
; Retour à la ligne
|
|
|
103 |
FileWriteByte $R0 "13"
|
|
|
104 |
FileWriteByte $R0 "10"
|
|
|
105 |
|
|
|
106 |
nothing4:
|
|
|
107 |
FindNext $R1 $R2
|
|
|
108 |
|
|
|
109 |
Goto loop4
|
|
|
110 |
|
|
|
111 |
done4:
|
|
|
112 |
|
|
|
113 |
;-------------------------------------------------------------------------------------------------------------------------------
|
|
|
114 |
|
|
|
115 |
; Parcourt des librairies du répertoire Librairie_ProgramFiles_Register
|
|
|
116 |
FindFirst $R1 $R2 "${LIBRAIRIE_REGISTRED_PROGRAMFILES}\*.*"
|
|
|
117 |
|
|
|
118 |
loop5:
|
|
|
119 |
StrCmp $R2 "" done5
|
|
|
120 |
StrCmp $R2 '.' nothing5
|
|
|
121 |
StrCmp $R2 '..' nothing5
|
|
|
122 |
StrCmp $R2 '.svn' nothing5
|
|
|
123 |
|
|
|
124 |
; Recupere l extension
|
|
|
125 |
${GetFileExt} "$R2" $R3
|
|
|
126 |
|
|
|
127 |
StrCmp $R3 "tlb" 0 else51
|
|
|
128 |
FileWrite $R0 "!insertmacro InstallLib TLB 0 NOREBOOT_PROTECTED $\"${LIBRAIRIE_REGISTRED_PROGRAMFILES}\$R2$\" $\"$$INSTDIR\$R2$\" $\"$$INSTDIR$\""
|
|
|
129 |
Goto done51
|
|
|
130 |
else51:
|
|
|
131 |
FileWrite $R0 "!insertmacro InstallLib REGDLL 0 NOREBOOT_PROTECTED $\"${LIBRAIRIE_REGISTRED_PROGRAMFILES}\$R2$\" $\"$$INSTDIR\$R2$\" $\"$$INSTDIR$\""
|
|
|
132 |
done51:
|
|
|
133 |
|
|
|
134 |
; Retour à la ligne
|
|
|
135 |
FileWriteByte $R0 "13"
|
|
|
136 |
FileWriteByte $R0 "10"
|
|
|
137 |
|
|
|
138 |
nothing5:
|
|
|
139 |
FindNext $R1 $R2
|
|
|
140 |
|
|
|
141 |
Goto loop5
|
|
|
142 |
|
|
|
143 |
done5:
|
|
|
144 |
|
|
|
145 |
FileWrite $R0 "!macroend"
|
|
|
146 |
|
|
|
147 |
FileWriteByte $R0 "13"
|
|
|
148 |
FileWriteByte $R0 "10"
|
|
|
149 |
|
|
|
150 |
|
|
|
151 |
;-------------------------------------------------------------------------------------------------------------------------------
|
|
|
152 |
;-------------------------------------------------------------------------------------------------------------------------------
|
|
|
153 |
|
|
|
154 |
; Fonction qui désinstalle l'application
|
|
|
155 |
|
|
|
156 |
FileWrite $R0 "!macro DesinstalleApplication"
|
|
|
157 |
FileWriteByte $R0 "13"
|
|
|
158 |
FileWriteByte $R0 "10"
|
|
|
159 |
|
|
|
160 |
; Parcourt des librairies du répertoire Librairie_ProgramFiles
|
|
|
161 |
; NOTSHARED - La librairie n'est pas partagée
|
|
|
162 |
; NOREBOOT_NOTPROTECTED Averti l'utilisateur quand la librairie est utilisée. L'utilisateur devra fermer les applications l'utilisant.
|
|
|
163 |
; Met à jour la librairie sans vérifier la protection de fichier Windows.
|
|
|
164 |
|
|
|
165 |
FindFirst $R1 $R2 "${LIBRAIRIE_PROGRAMFILES}\*.*"
|
|
|
166 |
|
|
|
167 |
loopU1:
|
|
|
168 |
StrCmp $R2 "" doneU1
|
|
|
169 |
StrCmp $R2 '.' nothingU1
|
|
|
170 |
StrCmp $R2 '..' nothingU1
|
|
|
171 |
StrCmp $R2 '.svn' nothingU1
|
|
|
172 |
|
|
|
173 |
; Commande d'enregistrement des librairies enrgistré dans le fichier
|
|
|
174 |
FileWrite $R0 "!insertmacro UnInstallLib DLL NOTSHARED NOREBOOT_PROTECTED $\"$$INSTDIR\$R2$\""
|
|
|
175 |
|
|
|
176 |
; Retour à la ligne
|
|
|
177 |
FileWriteByte $R0 "13"
|
|
|
178 |
FileWriteByte $R0 "10"
|
|
|
179 |
|
|
|
180 |
nothingU1:
|
|
|
181 |
FindNext $R1 $R2
|
|
|
182 |
|
|
|
183 |
Goto loopU1
|
|
|
184 |
|
|
|
185 |
doneU1:
|
|
|
186 |
|
|
|
187 |
|
|
|
188 |
; Parcourt des librairies du répertoire Librairie_ProgramFiles_Register
|
|
|
189 |
FindFirst $R1 $R2 "${LIBRAIRIE_REGISTRED_PROGRAMFILES}\*.*"
|
|
|
190 |
|
|
|
191 |
loopU2:
|
|
|
192 |
StrCmp $R2 "" doneU2
|
|
|
193 |
StrCmp $R2 '.' nothingU2
|
|
|
194 |
StrCmp $R2 '..' nothingU2
|
|
|
195 |
StrCmp $R2 '.svn' nothingU2
|
|
|
196 |
|
|
|
197 |
; Recupere l extension
|
|
|
198 |
${GetFileExt} "$R2" $R3
|
|
|
199 |
|
|
|
200 |
StrCmp $R3 "tlb" 0 elseU21
|
|
|
201 |
FileWrite $R0 "!insertmacro UnInstallLib TLB NOTSHARED NOREBOOT_PROTECTED $\"$$INSTDIR\$R2$\""
|
|
|
202 |
Goto doneU21
|
|
|
203 |
elseU21:
|
|
|
204 |
FileWrite $R0 "!insertmacro UnInstallLib REGDLL NOTSHARED NOREBOOT_PROTECTED $\"$$INSTDIR\$R2$\""
|
|
|
205 |
doneU21:
|
|
|
206 |
|
|
|
207 |
; Retour à la ligne
|
|
|
208 |
FileWriteByte $R0 "13"
|
|
|
209 |
FileWriteByte $R0 "10"
|
|
|
210 |
|
|
|
211 |
nothingU2:
|
|
|
212 |
FindNext $R1 $R2
|
|
|
213 |
|
|
|
214 |
Goto loopU2
|
|
|
215 |
|
|
|
216 |
doneU2:
|
|
|
217 |
|
|
|
218 |
|
|
|
219 |
; Parcourt des fichiers du répertoire Application_ProgramFiles
|
|
|
220 |
FindFirst $R1 $R2 "${APPLICATION_PROGRAMFILES}\*.*"
|
|
|
221 |
|
|
|
222 |
loopU3:
|
|
|
223 |
StrCmp $R2 "" doneU3
|
|
|
224 |
StrCmp $R2 '.' nothingU3
|
|
|
225 |
StrCmp $R2 '..' nothingU3
|
|
|
226 |
StrCmp $R2 '.svn' nothingU3
|
|
|
227 |
|
|
|
228 |
${If} ${FileExists} "${APPLICATION_PROGRAMFILES}\$R2\*.*"
|
|
|
229 |
; On supprime le dossier
|
|
|
230 |
FileWrite $R0 "RMDir /r $\"$$INSTDIR\$R2$\""
|
|
|
231 |
${Else}
|
|
|
232 |
; On supprime le fichier
|
|
|
233 |
FileWrite $R0 "Delete $\"$$INSTDIR\$R2$\""
|
|
|
234 |
${EndIf}
|
|
|
235 |
|
|
|
236 |
; Retour à la ligne
|
|
|
237 |
FileWriteByte $R0 "13"
|
|
|
238 |
FileWriteByte $R0 "10"
|
|
|
239 |
|
|
|
240 |
nothingU3:
|
|
|
241 |
FindNext $R1 $R2
|
|
|
242 |
|
|
|
243 |
Goto loopU3
|
|
|
244 |
|
|
|
245 |
doneU3:
|
|
|
246 |
|
|
|
247 |
FileWrite $R0 "RMDir $\"$$INSTDIR$\""
|
|
|
248 |
FileWriteByte $R0 "13"
|
|
|
249 |
FileWriteByte $R0 "10"
|
|
|
250 |
|
|
|
251 |
FileWrite $R0 "!macroend"
|
|
|
252 |
FileWriteByte $R0 "13"
|
|
|
253 |
FileWriteByte $R0 "10"
|
|
|
254 |
|
|
|
255 |
;-------------------------------------------------------------------------------------------------------------------------------
|
|
|
256 |
|
|
|
257 |
FindCLose $R0
|
|
|
258 |
|
|
|
259 |
FunctionEnd
|
|
|
260 |
|
|
|
261 |
Section
|
|
|
262 |
SectionEnd
|