Subversion Repositories DevTools

Rev

Rev 2561 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2551 dpurdie 1
;*****************************************************************
2
; Author : Hugues DOILLON
3
; Date : 03/2007
4
; Modifié : 
5
;*****************************************************************
6
; MUI GUI Version 2
7
; If problem during compilation -> You need to install the latest version of NSIS
8
!include MUI2.nsh
9
 
10
!include Library.nsh
11
 
12
; Utiliser les instructions conditionnel
13
!include LogicLib.nsh
14
 
15
!include Sections.nsh
16
 
17
!include WordFunc.nsh
18
 
19
!include TextReplace.nsh
20
 
21
;!include WinMessages.nsh
22
 
23
 
24
;-------------------------------------------------------------------------------------------------------------------------------
25
 
26
; Set the compression method
27
SetCompressor bzip2 ; zlib|bzip2|lzma
28
 
29
; Execution Setup section that generates the files and libraries to install
30
; Inclusion of sections containing the libraries to install (generated by the previous setup)
31
;
32
; Note: Paths within the installer are relative
33
;       Becareful of the CWD when running to program
34
;
35
!system  "${GBE_BINDIR}\SetupInstallationLibrairie.exe"
36
!include "${GBE_BINDIR}\InstallationLibrairie.nsh"
37
 
38
; Inclusion of information from the application (files change depending on application)
39
!include InformationApplication.nsh
40
 
41
!include IsUserAdmin.nsh
42
 
43
!include GestionRaccourci.nsh
44
 
45
; Adding macro to detect. NET framework
46
!ifdef FRAMEWORK_DOT_NET
47
	!include GetDotNETVersion.nsh
48
!endif
49
 
50
; Added macro for a custom section
51
!ifdef 	SECTION_INSTALLATION_PERSONNALISE_INITIAL | SECTION_INSTALLATION_PERSONNALISE_PREMIER | SECTION_INSTALLATION_PERSONNALISE_DERNIER | SECTION_DESINSTALLATION_PERSONNALISE_PREMIER | SECTION_DESINSTALLATION_PERSONNALISE_DERNIER | UI_PAGE_PARAMETRAGE
52
    !include "${A_INSTALLER}\SectionPersonnalise.nsh"
53
!endif
54
 
55
;-------------------------------------------------------------------------------------------------------------------------------
56
 
57
; Registry Key
58
 
59
!define REGISTRE_APPLICATION "Software\Microsoft\Windows\CurrentVersion\App Paths\${NOM_APPLICATION}.exe"
60
 
61
!define REGISTRE_DESINSTALLATION "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NOM_APPLICATION}"
62
 
63
;-------------------------------------------------------------------------------------------------------------------------------
64
 
65
; Display Settings MUI
66
 
67
; Warning message in case of cancellation
68
!define MUI_ABORTWARNING
69
 
70
; Added macro for a custom section
71
; Icon Installation
72
!define MUI_ICON                        "${GBE_NSISDATA}\inVix.ico"
73
; Icon Uninstall
74
!define MUI_UNICON                      "${GBE_NSISDATA}\unVix.ico"
75
 
76
; Image
77
!define MUI_HEADERIMAGE
78
!define MUI_HEADERIMAGE_RIGHT
79
; Image Host and closing
80
!define MUI_HEADERIMAGE_BITMAP          "${GBE_NSISDATA}\VixHeader.bmp"
81
!define MUI_HEADERIMAGE_UNBITMAP        "${GBE_NSISDATA}\VixHeader.bmp"
82
 
83
; Image top left
84
!define MUI_WELCOMEFINISHPAGE_BITMAP    "${GBE_NSISDATA}\VixPanel.bmp"
85
!define MUI_UNWELCOMEFINISHPAGE_BITMAP  "${GBE_NSISDATA}\VixPanel.bmp"
86
 
87
; Description of the page component selection
88
!define MUI_COMPONENTSPAGE_NODESC ; MUI_COMPONENTSPAGE_SMALLDESC
89
 
90
; Can choose to run the application
91
!ifndef SANS_LANCEMENT
92
	!define MUI_FINISHPAGE_RUN "$INSTDIR\${EXE_APPLICATION}"
93
!endif
94
 
95
; Defined functions launched initialization installation and uninstallation
96
!define MUI_CUSTOMFUNCTION_GUIINIT initialisationGUI
97
!define MUI_CUSTOMFUNCTION_UNGUIINIT un.initialisationGUI
98
;!define MUI_CUSTOMFUNCTION_ABORT function
99
;!define MUI_CUSTOMFUNCTION_UNABORT function
100
 
101
;!define MUI_FINISHPAGE_LINK_LOCATION ${WEB_SITE_APPLICATION}
102
 
103
;-------------------------------------------------------------------------------------------------------------------------------
104
 
105
; Definition of pages visible MUI Installation
106
 
107
;!define MULTIUSER_EXECUTIONLEVEL Admin
108
;!define MULTIUSER_MUI
109
;!include MultiUser.nsh
110
 
111
;!insertmacro MULTIUSER_PAGE_INSTALLMODE
112
 
113
 
114
; Home Installation
115
; Uses 3 lines instead of 2 for the title display
116
!define MUI_WELCOMEPAGE_TITLE_3LINES
117
!insertmacro MUI_PAGE_WELCOME
118
 
119
; Page License
120
;!insertmacro MUI_PAGE_LICENSE "..\..\dossier\vers\license\VotreLicenseLogicielle.txt"
121
 
122
; Page de choix des composants à installer
123
!insertmacro MUI_PAGE_COMPONENTS
124
 
125
 
126
; Page selection in the installation directory
127
!insertmacro MUI_PAGE_DIRECTORY
128
 
129
; Page progress of the installation
130
!insertmacro MUI_PAGE_INSTFILES
131
 
132
!ifdef UI_PAGE_PARAMETRAGE
133
	!insertmacro UI_Page_Parametrage
134
!endif
135
 
136
; Page Setup Complete
137
!define MUI_FINISHPAGE_TITLE_3LINES
138
!insertmacro MUI_PAGE_FINISH
139
 
140
;-------------------------------------------------------------------------------------------------------------------------------
141
 
142
; Definition of Uninstall pages visible MUI
143
 
144
; Home Installation
145
; Uses 3 lines instead of 2 for the title display
146
;!define MUI_WELCOMEPAGE_TITLE_3LINES
147
;!insertmacro MUI_UNPAGE_WELCOME
148
 
149
; Page uninstall confirmation
150
!insertmacro MUI_UNPAGE_CONFIRM
151
 
152
; Page unwinding uninstalling
153
!insertmacro MUI_UNPAGE_INSTFILES
154
 
155
; End Page Uninstall
156
!define MUI_FINISHPAGE_TITLE_3LINES
157
!insertmacro MUI_UNPAGE_FINISH
158
 
159
; End Pages MUI
160
 
161
;-------------------------------------------------------------------------------------------------------------------------------
162
 
163
; MUI language available
164
!insertmacro MUI_LANGUAGE "English"
165
!insertmacro MUI_LANGUAGE "French"
166
!insertmacro MUI_LANGUAGE "Spanish"
167
;-------------------------------------------------------------------------------------------------------------------------------
168
 
169
; Set the name of the installation.
170
;; Name "${NOM_APPLICATION} ${VERSION_APPLICATION}"
171
 
172
; Specifies the file to be used by makensis order to create the installation.
173
;ddp; OutFile "Setup\${NOM_SETUP}"
174
 
175
; Set the installation directory by default.
176
InstallDir "${CHEMIN_INSTALLATION}"
177
 
178
; Seeking the installation folder in the registry
179
;InstallDirRegKey HKLM "${REGISTRE_APPLICATION}" ""
180
 
181
; Defined if installation details are shown or not.
182
ShowInstDetails show
183
 
184
; Defined if the uninstallation details are shown or not.
185
ShowUnInstDetails show
186
 
187
;-------------------------------------------------------------------------------------------------------------------------------
188
 
189
; Variable
190
 
191
; Management of unique choice (All Users or Current user)
192
 
193
var menuTousUtilisateurs
194
var menuUtilisateurCourant
195
var raccourciTousUtilisateurs
196
var raccourciUtilisateurCourant
197
 
198
; Other Variables
199
 
200
var cheminAncienneDesinstallation
201
var cheminAncienneInstallation
202
 
203
;-------------------------------------------------------------------------------------------------------------------------------
204
 
205
; Definition of language strings used
206
 
207
LangString stringAncienneVersion ${LANG_FRENCH} "Une ancienne version de cette application est installée sur votre système. Avant de poursuivre le processus d'installation, la version existante de cette application sera supprimée. Souhaitez-vous supprimer cette application ainsi que tous les fichiers du dossier d'installation ?"
208
LangString stringAncienneVersion ${LANG_ENGLISH} "Another version of this software is already installed. Delete existing version ?"
209
LangString stringAncienneVersion ${LANG_SPANISH} "Otra versión del software ya está instalada .¿ Borrar la versión acual ?"
210
 
211
LangString stringFrameworkNET ${LANG_FRENCH} "Cette application requiert le Framework .NET ${FRAMEWORK_DOT_NET}. Pour installer cette application, installez d'abord le Framework .NET ${FRAMEWORK_DOT_NET}, ou contactez votre service de support pour obtenir de l'assistance."
212
LangString stringFrameworkNET ${LANG_ENGLISH} "Software needs Framework .NET ${FRAMEWORK_DOT_NET}."
213
LangString stringFrameworkNET ${LANG_SPANISH} "Este programa necesita el Framework .NET ${FRAMEWORK_DOT_NET}."
214
 
215
LangString stringInstallationApplication ${LANG_FRENCH} "L'installation de cette application requiert les droits d'administration. Pour installer cette application, ouvrez une session en tant qu'administrateur, ou contactez votre service de support pour obtenir de l'assistance."
216
LangString stringInstallationApplication ${LANG_ENGLISH} "Software Installer needs Administrator Rights."
217
LangString stringInstallationApplication ${LANG_SPANISH} "El programa de instalación necesita derechos de administrador."
218
 
219
LangString stringDesinstallationApplication ${LANG_FRENCH} "La désinstallation de cette application requiert les droits d'administration. Pour supprimer cette application, ouvrez une session en tant qu'administrateur, ou contactez votre service de support pour obtenir de l'assistance."
220
LangString stringDesinstallationApplication ${LANG_ENGLISH} "Software Uninstaller needs Administrator Rights."
221
LangString stringDesinstallationApplication ${LANG_SPANISH} "El programa de desinstalación necesita derechos de administrador."
222
 
223
LangString stringApplication ${LANG_FRENCH} "Application"
224
LangString stringApplication ${LANG_ENGLISH} "Application"
225
LangString stringApplication ${LANG_SPANISH} "Aplicación"
226
 
227
LangString stringSecAncienneVersion ${LANG_FRENCH} "Désinstaller ancienne version"
228
LangString stringSecAncienneVersion ${LANG_ENGLISH} "Uninstall old version"
229
LangString stringSecAncienneVersion ${LANG_SPANISH} "???"
230
 
231
LangString stringLibrairies ${LANG_FRENCH} "Librairies"
232
LangString stringLibrairies ${LANG_ENGLISH} "Library"
233
LangString stringLibrairies ${LANG_SPANISH} "Librería"
234
 
235
!ifdef SECTION_INSTALLATION_PERSONNALISE_EBRIO
236
	!insertmacro LangStringInstalleSectionPersonnalisePremier
237
!endif
238
 
239
!ifdef SECTION_INSTALLATION_PERSONNALISE_INITIAL
240
	!insertmacro LangStringInstalleSectionPersonnaliseInitial
241
!endif
242
 
243
!ifdef SECTION_INSTALLATION_PERSONNALISE_PREMIER
244
	!insertmacro LangStringInstalleSectionPersonnalisePremier
245
!endif
246
 
247
!ifdef SECTION_INSTALLATION_PERSONNALISE_DERNIER
248
	!insertmacro LangStringInstalleSectionPersonnaliseDernier
249
!endif
250
 
251
LangString stringRaccourciMenuDemarrer ${LANG_FRENCH} "Raccourci menu Démarrer"
252
LangString stringRaccourciMenuDemarrer ${LANG_ENGLISH} "Create Shortcut in Windows Start Menu"
253
LangString stringRaccourciMenuDemarrer ${LANG_SPANISH} "Creación acceso directo en el menú Windows Inicio"
254
 
255
LangString stringRaccourciBureau ${LANG_FRENCH} "Raccourci sur le bureau"
256
LangString stringRaccourciBureau ${LANG_ENGLISH} "Create Shortcut on Desktop"
257
LangString stringRaccourciBureau ${LANG_SPANISH} "Creación acceso directo en el escritorio"
258
 
259
LangString stringTousUtilisateurs ${LANG_FRENCH} "Tous les utilisateurs"
260
LangString stringTousUtilisateurs ${LANG_ENGLISH} "All user"
261
LangString stringTousUtilisateurs ${LANG_SPANISH} "Todos los utilizadores"
262
 
263
LangString stringUtilisateurCourant ${LANG_FRENCH} "Utilisateur courant"
264
LangString stringUtilisateurCourant ${LANG_ENGLISH} "Current user"
265
LangString stringUtilisateurCourant ${LANG_SPANISH} "Utilizador actual"
266
 
267
LangString stringRaccourciDesinstalle ${LANG_FRENCH} "Désinstallation"
268
LangString stringRaccourciDesinstalle ${LANG_ENGLISH} "Uninstall"
269
LangString stringRaccourciDesinstalle ${LANG_SPANISH} "Desinstalación"
270
 
271
LangString stringMessageAvertissement ${LANG_FRENCH} "${MESSAGE_AVERTISSEMENT_FRANCAIS}"
272
LangString stringMessageAvertissement ${LANG_ENGLISH} "${MESSAGE_AVERTISSEMENT_ANGLAIS}"
273
LangString stringMessageAvertissement ${LANG_SPANISH} "${MESSAGE_AVERTISSEMENT_SPANISH}"
274
 
275
 
276
;-------------------------------------------------------------------------------------------------------------------------------
277
 
278
; Macro
279
 
280
!ifdef FRAMEWORK_DOT_NET
281
	!insertmacro VersionCompare
282
 
283
	;!insertmacro IsDotNETInstalled
284
	!insertmacro GetDotNETVersion
285
!endif
286
 
287
!insertmacro IsUserAdmin ""
288
 
289
!insertmacro IsUserAdmin "un."
290
 
291
 
292
/*============================================================================================================================*/
293
/*============================================================================================================================*/
294
 
295
; Section obligatory custom installation
296
!ifdef SECTION_INSTALLATION_PERSONNALISE_INITIAL
297
 
298
	Section "$(stringInstalleSectionPersonnaliseInitial)" ID_SEC_PERSONNALISE_INITIAL
299
 
300
		!if ${SECTION_INSTALLATION_PERSONNALISE_INITIAL} == "Obligatoire"
301
			SectionIn RO ; indicates that the section is mandatory
302
		!endif
303
 
304
		!insertmacro InstalleSectionPersonnaliseInitial
305
 
306
	SectionEnd
307
 
308
!endif
309
 
310
;-------------------------------------------------------------------------------------------------------------------------------
311
 
312
; Section invisible Uninstall
313
Section "-$(stringSecAncienneVersion)" ID_SEC_OLDVERSION
314
	SectionIn RO
315
	StrCmp $cheminAncienneDesinstallation "" pas_installe deja_installe
316
	deja_installe:
317
		ClearErrors
318
; Launch of Silent uninstallation process
319
		ExecWait '"$cheminAncienneDesinstallation" /S  _?=$cheminAncienneInstallation'
320
	pas_installe:
321
SectionEnd
322
 
323
;-------------------------------------------------------------------------------------------------------------------------------
324
 
325
; Section obligatory custom installation
326
!ifdef SECTION_INSTALLATION_PERSONNALISE_PREMIER
327
 
328
	Section "$(stringInstalleSectionPersonnalisePremier)" ID_SEC_PERSONNALISE_PREMIER
329
 
330
		!if ${SECTION_INSTALLATION_PERSONNALISE_PREMIER} == "Obligatoire"
331
			SectionIn RO ; indicates that the section is mandatory
332
		!endif
333
 
334
		!insertmacro InstalleSectionPersonnalisePremier
335
 
336
	SectionEnd
337
 
338
!endif
339
 
340
;-------------------------------------------------------------------------------------------------------------------------------
341
 
342
; Section mandatory application installation
343
Section "$(stringApplication)" ID_SEC_APPLICATION
344
    SectionIn RO ; indicates that the section is mandatory
345
    SetOutPath "$INSTDIR"
346
    SetOverwrite on
347
 
348
    File /nonfatal /r /x .svn "${APPLICATION_PROGRAMFILES}\*"
349
 
350
SectionEnd
351
 
352
;-------------------------------------------------------------------------------------------------------------------------------
353
 
354
; Section mandatory installation libraries
355
Section "$(stringLibrairies)" ID_SEC_LIBRAIRIES
356
    SectionIn RO ; indicates that the section is mandatory
357
 
358
    !insertmacro SectionLibrairies
359
 
360
SectionEnd
361
 
362
;-------------------------------------------------------------------------------------------------------------------------------
363
 
364
; Section obligatory custom installation
365
!ifdef SECTION_INSTALLATION_PERSONNALISE_DERNIER
366
 
367
	Section "$(stringInstalleSectionPersonnaliseDernier)" ID_SEC_PERSONNALISE_DERNIER
368
 
369
			!if ${SECTION_INSTALLATION_PERSONNALISE_DERNIER} == "Obligatoire"
370
				SectionIn RO ; indicates that the section is mandatory
371
			!endif
372
 
373
			!insertmacro InstalleSectionPersonnaliseDernier
374
 
375
	SectionEnd
376
 
377
!endif
378
 
379
;-------------------------------------------------------------------------------------------------------------------------------
380
 
381
; Section facultative d'installation du menu
382
!ifndef SANS_RACCOURCI
383
 
384
; Group section unfolded / e
385
	SectionGroup /e "$(stringRaccourciMenuDemarrer)" ID_SEC_RACCOURCI_MENU
386
 
387
		Section "$(stringTousUtilisateurs)" ID_SEC_RACCOURCI_MENU_TS_UTILISATEURS
388
 
389
; Systems files common to all users ('all users') are used.
390
			SetShellVarContext all
391
 
392
; Creating the Start menu shortcut
393
			!insertmacro InstalleMenuDemarrer
394
		SectionEnd
395
 
396
		Section /o "$(stringUtilisateurCourant)" ID_SEC_RACCOURCI_MENU_UTILISATEUR_COURANT
397
; Systems files common to all users ('all users') are used.
398
			SetShellVarContext current
399
 
400
; Creating the Start menu shortcut
401
			!insertmacro InstalleMenuDemarrer
402
		SectionEnd
403
 
404
	SectionGroupEnd
405
 
406
!endif
407
 
408
;-------------------------------------------------------------------------------------------------------------------------------
409
 
410
; Section optional installation of shortcuts on the desktop
411
!ifndef SANS_RACCOURCI
412
 
413
	SectionGroup /e "$(stringRaccourciBureau)" ID_SEC_RACCOURCI_BUREAU
414
 
415
		Section "$(stringTousUtilisateurs)" ID_SEC_RACCOURCI_BUREAU_TS_UTILISATEURS
416
; Systems files common to all users will be used.
417
			SetShellVarContext all
418
 
419
; Creating shortcut on the desktop
420
				!insertmacro InstalleRaccourciBureau
421
		SectionEnd
422
 
423
		Section /o "$(stringUtilisateurCourant)" ID_SEC_RACCOURCI_BUREAU_UTILISATEUR_COURANT
424
; The system folders of the current user will be used.
425
			SetShellVarContext current
426
 
427
; Creating shortcut on the desktop
428
				!insertmacro InstalleRaccourciBureau
429
		SectionEnd
430
 
431
	SectionGroupEnd
432
 
433
!endif
434
 
435
;-------------------------------------------------------------------------------------------------------------------------------
436
 
437
Function .onInit
438
 
439
    ; Displays the choice of language
440
	${if} ${CHOIX_LANGUE} == "Fenetre_choix"
441
		!insertmacro MUI_LANGDLL_DISPLAY
442
	${EndIf}
443
 
444
	;!insertmacro MULTIUSER_INIT
445
 
446
    ; Variable mode to manage radio buttons
447
	StrCpy $menuTousUtilisateurs 1
448
	StrCpy $menuUtilisateurCourant 0
449
	StrCpy $raccourciTousUtilisateurs 1
450
	StrCpy $raccourciUtilisateurCourant 0
451
 
452
FunctionEnd
453
 
454
;-------------------------------------------------------------------------------------------------------------------------------
455
 
456
Function initialisationGUI
457
 
458
    ; Management of user rights
459
	Call IsUserAdmin
460
	Pop $R0
461
 
462
	${if} $R0 == "false"
463
		MessageBox MB_OK|MB_ICONEXCLAMATION "$(stringInstallationApplication)"
464
		Abort
465
	${EndIf}
466
 
467
    ; Management of pre-requisites. NET Framework
468
	!ifdef FRAMEWORK_DOT_NET
469
 
470
    ; Old method
471
		/*
472
		Call IsDotNETInstalled
473
		Pop $R1
474
		StrCmp $R1 1 DotNET_installe DotNET_pas_installe
475
		DotNET_pas_installe:
476
			MessageBox MB_OK|MB_ICONEXCLAMATION "$(stringFrameworkNET)"
477
			Abort
478
		DotNET_installe:
479
		*/
480
 
481
		Call GetDotNETVersion
482
		Pop $R1
483
 
484
		${If} $R1 == "not found"
485
			MessageBox MB_OK|MB_ICONEXCLAMATION "$(stringFrameworkNET)"
486
			Abort
487
		${EndIf}
488
 
489
		StrCpy $R1 $R1 "" 1 ; supprime "v"
490
 
491
		${VersionCompare} $R1 ${FRAMEWORK_DOT_NET} $1
492
		; FRAMEWORK_DOT_NET requis est plus récent
493
		${If} $1 == 2
494
			MessageBox MB_OK|MB_ICONEXCLAMATION "$(stringFrameworkNET)"
495
			Abort
496
		${EndIf}
497
 
498
	!endif
499
 
500
    ; Management of versions already installed
501
	!ifndef SANS_DESINSTALLATION
502
        ; Retrieves the values ??of the old installation in the registry
503
		ReadRegStr $cheminAncienneDesinstallation HKLM "${REGISTRE_DESINSTALLATION}" "UninstallString"
504
		ReadRegStr $cheminAncienneInstallation HKLM "${REGISTRE_APPLICATION}" "Path"
505
 
506
		StrCmp $cheminAncienneDesinstallation "" pas_installe deja_installe
507
		deja_installe:
508
			MessageBox MB_YESNO|MB_ICONQUESTION "$(stringAncienneVersion)" IDYES oui IDNO non
509
			oui:
510
				goto pas_installe
511
			non:
512
				Abort
513
		pas_installe:
514
	!endif
515
 
516
        ; Management Post parameterizable application
517
	!ifdef MESSAGE_AVERTISSEMENT_FRANCAIS
518
		MessageBox MB_YESNO|MB_ICONQUESTION "$(stringMessageAvertissement)" IDYES oui2 IDNO non2
519
		non2:
520
			Abort
521
		oui2:
522
	!endif
523
 
524
FunctionEnd
525
 
526
;-------------------------------------------------------------------------------------------------------------------------------
527
 
528
Function .onSelChange
529
 
530
    !ifndef SANS_RACCOURCI
531
 
532
        ; Management Mode radio buttons
533
 
534
  	    SectionGetFlags ${ID_SEC_RACCOURCI_MENU_TS_UTILISATEURS} $1
535
	    ${if} $1 == 1
536
	    ${AndIf} $menuTousUtilisateurs != 1
537
	    	!insertmacro UnselectSection ${ID_SEC_RACCOURCI_MENU_UTILISATEUR_COURANT}
538
	        StrCpy $menuTousUtilisateurs 1
539
  	    	StrCpy $menuUtilisateurCourant 0
540
        ${endif}
541
 
542
        SectionGetFlags ${ID_SEC_RACCOURCI_MENU_UTILISATEUR_COURANT} $2
543
       	${if} $2 == 1
544
    	${AndIf} $menuUtilisateurCourant != 1
545
			!insertmacro UnselectSection ${ID_SEC_RACCOURCI_MENU_TS_UTILISATEURS}
546
			StrCpy $menuTousUtilisateurs 0
547
			StrCpy $menuUtilisateurCourant 1
548
        ${endif}
549
 
550
 
551
  	    SectionGetFlags ${ID_SEC_RACCOURCI_BUREAU_TS_UTILISATEURS} $3
552
	    ${if} $3 == 1
553
	    ${AndIf} $raccourciTousUtilisateurs != 1
554
		    !insertmacro UnselectSection ${ID_SEC_RACCOURCI_BUREAU_UTILISATEUR_COURANT}
555
	        StrCpy $raccourciTousUtilisateurs 1
556
      		StrCpy $raccourciUtilisateurCourant 0
557
        ${endif}
558
 
559
        SectionGetFlags ${ID_SEC_RACCOURCI_BUREAU_UTILISATEUR_COURANT} $4
560
       	${if} $4 == 1
561
    	${AndIf} $raccourciUtilisateurCourant != 1
562
			!insertmacro UnselectSection ${ID_SEC_RACCOURCI_BUREAU_TS_UTILISATEURS}
563
			StrCpy $raccourciTousUtilisateurs 0
564
			StrCpy $raccourciUtilisateurCourant 1
565
        ${endif}
566
 
567
    !endif
568
 
569
FunctionEnd
570
 
571
;-------------------------------------------------------------------------------------------------------------------------------
572
 
573
Section -Post
574
    ; Generation of executable uninstall
575
	!ifndef SANS_DESINSTALLATION
576
		WriteUninstaller "$INSTDIR\${EXE_DESINSTALLATION}"
577
	!endif
578
 
579
	; Ecriture des informations dans le registre
580
 
581
    ; Path to executable
582
	WriteRegStr HKLM "${REGISTRE_APPLICATION}" "" "$INSTDIR\${EXE_APPLICATION}"
583
 
584
    ; The installation path
585
	WriteRegStr HKLM "${REGISTRE_APPLICATION}" "Path" "$INSTDIR"
586
 
587
    ; Application version installed
588
	WriteRegStr HKLM "${REGISTRE_APPLICATION}" "Version" "${VERSION_APPLICATION}"
589
 
590
    ; Project installed application
591
	WriteRegStr HKLM "${REGISTRE_APPLICATION}" "Project" "${PROJET_APPLICATION}"
592
 
593
    ; Add uninstall information to Add / Remove Programs
594
	!ifndef SANS_DESINSTALLATION
595
    ; Application Name
596
		WriteRegStr HKLM "${REGISTRE_DESINSTALLATION}" "DisplayName" "${NOM_APPLICATION} ${VERSION_APPLICATION}"
597
 
598
    ; Path and filename of the uninstallation.
599
		WriteRegStr HKLM "${REGISTRE_DESINSTALLATION}" "UninstallString" "$INSTDIR\${EXE_DESINSTALLATION}"
600
 
601
    ; Path, file and index of the icon to display next to the name of your application
602
		WriteRegStr HKLM "${REGISTRE_DESINSTALLATION}" "DisplayIcon" "$INSTDIR\${EXE_APPLICATION}"
603
 
604
    ; The application displayed Version
605
		WriteRegStr HKLM "${REGISTRE_DESINSTALLATION}" "DisplayVersion" "${VERSION_APPLICATION}"
606
 
607
		;WriteRegStr HKLM "${REGISTRE_DESINSTALLATION}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
608
 
609
    ; Name of distributor
610
		WriteRegStr HKLM "${REGISTRE_DESINSTALLATION}" "Publisher" "${EDITEUR_APPLICATION}"
611
	!endif
612
 
613
SectionEnd
614
 
615
/*============================================================================================================================*/
616
/*============================================================================================================================*/
617
 
618
Function un.onInit
619
 
620
    ; Displays the choice of language
621
	${if} ${CHOIX_LANGUE} == "Affiche_fenetre_choix"
622
		!insertmacro MUI_UNGETLANGUAGE
623
	${EndIf}
624
 
625
	;!insertmacro MULTIUSER_UNINIT
626
 
627
FunctionEnd
628
 
629
;-------------------------------------------------------------------------------------------------------------------------------
630
 
631
Function un.initialisationGUI
632
 
633
    ; Management of user rights
634
	Call un.IsUserAdmin
635
	Pop $R0
636
 
637
	${if} $R0 == "false"
638
		MessageBox MB_OK|MB_ICONEXCLAMATION "$(stringDesinstallationApplication)"
639
		Abort
640
	${EndIf}
641
 
642
FunctionEnd
643
 
644
 
645
;-------------------------------------------------------------------------------------------------------------------------------
646
 
647
 
648
; Section A 'Uninstall' is created to generate an uninstaller either.
649
; This section deletes all files, key registry, not shared libraries that were installed by the installation of the system.
650
Section Uninstall
651
	Delete "$INSTDIR\${EXE_DESINSTALLATION}"
652
 
653
    ; Section desinstalation personalized mandatory
654
	!ifdef SECTION_DESINSTALLATION_PERSONNALISE_PREMIER
655
		!insertmacro DesinstalleSectionPersonnalisePremier
656
	!endif
657
 
658
    ; It uninstalls the application of the Program Files folder (if the user does not specify otherwise)
659
 	!insertmacro DesinstalleApplication
660
 
661
    ; Section desinstalation personalized mandatory
662
	!ifdef SECTION_DESINSTALLATION_PERSONNALISE_DERNIER
663
		!insertmacro DesinstalleSectionPersonnaliseDernier
664
	!endif
665
 
666
    ; It uninstalls the start menu shortcut and office
667
	!ifndef SANS_RACCOURCI
668
    ; Systems files common to all users will be used.
669
		SetShellVarContext all
670
    ; Deleting Shortcuts
671
		!insertmacro DesinstalleMenuDemarrerRaccourciBureau
672
 
673
    ; The system folders of the current user will be used.
674
		SetShellVarContext current
675
    ; Deleting Shortcuts
676
		!insertmacro DesinstalleMenuDemarrerRaccourciBureau
677
	!endif
678
 
679
    ; Deleting records
680
	DeleteRegKey HKLM "${REGISTRE_DESINSTALLATION}"
681
	DeleteRegKey HKLM "${REGISTRE_APPLICATION}"
682
	SetAutoClose true
683
 
684
SectionEnd
685
 
686
 
687
/*============================================================================================================================*/
688
/*============================================================================================================================*/
689
 
690
 
691
 
692