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