Statistiques
| Révision :

root / tmp / org.txm.setups / nsis / Examples / gfx.nsi @ 3144

Historique | Voir | Annoter | Télécharger (3,22 ko)

1 728 mdecorde
; gfx.nsi
2 728 mdecorde
;
3 728 mdecorde
; This script shows some examples of using all of the new
4 728 mdecorde
; graphic related additions introduced in NSIS 2
5 728 mdecorde
;
6 728 mdecorde
; Written by Amir Szkeley 22nd July 2002
7 728 mdecorde
8 728 mdecorde
;--------------------------------
9 728 mdecorde
10 728 mdecorde
!macro BIMAGE IMAGE PARMS
11 728 mdecorde
	Push $0
12 728 mdecorde
	GetTempFileName $0
13 728 mdecorde
	File /oname=$0 "${IMAGE}"
14 728 mdecorde
	SetBrandingImage ${PARMS} $0
15 728 mdecorde
	Delete $0
16 728 mdecorde
	Pop $0
17 728 mdecorde
!macroend
18 728 mdecorde
19 728 mdecorde
;--------------------------------
20 728 mdecorde
21 728 mdecorde
Name "Graphical effects"
22 728 mdecorde
23 728 mdecorde
OutFile "gfx.exe"
24 728 mdecorde
25 728 mdecorde
; Adds an XP manifest to the installer
26 728 mdecorde
XPStyle on
27 728 mdecorde
28 728 mdecorde
; Add branding image to the installer (an image placeholder on the side).
29 728 mdecorde
; It is not enough to just add the placeholder, we must set the image too...
30 728 mdecorde
; We will later set the image in every pre-page function.
31 728 mdecorde
; We can also set just one persistent image in .onGUIInit
32 2956 mdecorde
AddBrandingImage left 100u
33 728 mdecorde
34 728 mdecorde
; Sets the font of the installer
35 728 mdecorde
SetFont "Comic Sans MS" 8
36 728 mdecorde
37 728 mdecorde
; Just to make it three pages...
38 728 mdecorde
SubCaption 0 ": Yet another page..."
39 728 mdecorde
SubCaption 2 ": Yet another page..."
40 728 mdecorde
LicenseText "License page"
41 728 mdecorde
LicenseData "gfx.nsi"
42 728 mdecorde
DirText "Lets make a third page!"
43 728 mdecorde
44 728 mdecorde
; Install dir
45 728 mdecorde
InstallDir "${NSISDIR}\Examples"
46 728 mdecorde
47 728 mdecorde
; Request application privileges for Windows Vista
48 728 mdecorde
RequestExecutionLevel user
49 728 mdecorde
50 728 mdecorde
;--------------------------------
51 728 mdecorde
52 728 mdecorde
; Pages
53 728 mdecorde
Page license licenseImage
54 728 mdecorde
Page custom customPage
55 728 mdecorde
Page directory dirImage
56 728 mdecorde
Page instfiles instImage
57 728 mdecorde
58 728 mdecorde
;--------------------------------
59 728 mdecorde
60 728 mdecorde
Section ""
61 728 mdecorde
	; You can also use the BI_NEXT macro here...
62 728 mdecorde
	MessageBox MB_YESNO "We can change the branding image from within a section too!$\nDo you want me to change it?" IDNO done
63 728 mdecorde
		!insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Wizard\nsis.bmp" ""
64 728 mdecorde
	done:
65 2956 mdecorde
	WriteUninstaller $INSTDIR\uninst.exe
66 728 mdecorde
SectionEnd
67 728 mdecorde
68 728 mdecorde
;--------------------------------
69 728 mdecorde
70 728 mdecorde
Function licenseImage
71 728 mdecorde
	!insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp" /RESIZETOFIT
72 728 mdecorde
	MessageBox MB_YESNO 'Would you like to skip the license page?' IDNO no
73 728 mdecorde
		Abort
74 728 mdecorde
	no:
75 728 mdecorde
FunctionEnd
76 728 mdecorde
77 728 mdecorde
Function customPage
78 728 mdecorde
	!insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Checks\modern.bmp" /RESIZETOFIT
79 728 mdecorde
	MessageBox MB_OK 'This is a nice custom "page" with yet another image :P'
80 728 mdecorde
	#insert install options/start menu/<insert plugin name here> here
81 728 mdecorde
FunctionEnd
82 728 mdecorde
83 728 mdecorde
Function dirImage
84 728 mdecorde
	!insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Header\win.bmp" /RESIZETOFIT
85 728 mdecorde
FunctionEnd
86 728 mdecorde
87 728 mdecorde
Function instImage
88 728 mdecorde
	!insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Wizard\llama.bmp" /RESIZETOFIT
89 728 mdecorde
FunctionEnd
90 728 mdecorde
91 728 mdecorde
;--------------------------------
92 728 mdecorde
93 728 mdecorde
; Uninstall pages
94 728 mdecorde
95 728 mdecorde
UninstPage uninstConfirm un.uninstImage
96 728 mdecorde
UninstPage custom un.customPage
97 728 mdecorde
UninstPage instfiles un.instImage
98 728 mdecorde
99 728 mdecorde
Function un.uninstImage
100 728 mdecorde
	!insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Checks\modern.bmp" /RESIZETOFIT
101 728 mdecorde
FunctionEnd
102 728 mdecorde
103 728 mdecorde
Function un.customPage
104 728 mdecorde
	!insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Header\win.bmp" /RESIZETOFIT
105 728 mdecorde
	MessageBox MB_OK 'This is a nice uninstaller custom "page" with yet another image :P'
106 728 mdecorde
	#insert install options/start menu/<insert plugin name here> here
107 728 mdecorde
FunctionEnd
108 728 mdecorde
109 728 mdecorde
Function un.instImage
110 728 mdecorde
	!insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Wizard\llama.bmp" /RESIZETOFIT
111 728 mdecorde
FunctionEnd
112 728 mdecorde
113 728 mdecorde
;--------------------------------
114 728 mdecorde
115 728 mdecorde
; Uninstaller
116 728 mdecorde
117 728 mdecorde
; Another page for uninstaller
118 728 mdecorde
UninstallText "Another page..."
119 728 mdecorde
120 728 mdecorde
Section uninstall
121 728 mdecorde
	MessageBox MB_OK "Bla"
122 728 mdecorde
SectionEnd