Subversion Repositories DevTools

Rev

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