root / tmp / org.txm.setups / nsis-2.5 / Examples / viewhtml.nsi @ 3030
Historique | Voir | Annoter | Télécharger (1,45 ko)
1 | 2961 | mdecorde | ; viewhtml.nsi |
---|---|---|---|
2 | 2961 | mdecorde | ; |
3 | 2961 | mdecorde | ; This script creates a silent installer which extracts one (or more) HTML |
4 | 2961 | mdecorde | ; files to a temporary directory, opens Internet Explorer to view the file(s), |
5 | 2961 | mdecorde | ; and when Internet Explorer has quit, deletes the file(s). |
6 | 2961 | mdecorde | |
7 | 2961 | mdecorde | ;-------------------------------- |
8 | 2961 | mdecorde | |
9 | 2961 | mdecorde | ; The name of the installer (not really used in a silent install) |
10 | 2961 | mdecorde | Name "ViewHTML" |
11 | 2961 | mdecorde | |
12 | 2961 | mdecorde | ; Set to silent mode |
13 | 2961 | mdecorde | SilentInstall silent |
14 | 2961 | mdecorde | |
15 | 2961 | mdecorde | ; The file to write |
16 | 2961 | mdecorde | OutFile "viewhtml.exe" |
17 | 2961 | mdecorde | |
18 | 2961 | mdecorde | ; Request application privileges for Windows Vista |
19 | 2961 | mdecorde | RequestExecutionLevel user |
20 | 2961 | mdecorde | |
21 | 2961 | mdecorde | ;-------------------------------- |
22 | 2961 | mdecorde | |
23 | 2961 | mdecorde | ; The stuff to install |
24 | 2961 | mdecorde | Section "" |
25 | 2961 | mdecorde | |
26 | 2961 | mdecorde | ; Get a temporary filename (in the Windows Temp directory) |
27 | 2961 | mdecorde | GetTempFileName $R0 |
28 | 2961 | mdecorde | |
29 | 2961 | mdecorde | ; Extract file |
30 | 2961 | mdecorde | ; Lets skip this one, it's not built to be showin in IE |
31 | 2961 | mdecorde | ; File /oname=$R0 "..\Menu\compiler.html" |
32 | 2961 | mdecorde | ; and write our own! :) |
33 | 2961 | mdecorde | FileOpen $0 $R0 "w" |
34 | 2961 | mdecorde | FileWrite $0 "<HTML><BODY><H1>HTML page for viewhtml.nsi</H1></BODY></HTML>" |
35 | 2961 | mdecorde | FileClose $0 |
36 | 2961 | mdecorde | |
37 | 2961 | mdecorde | ; View file |
38 | 2961 | mdecorde | ExecWait '"$PROGRAMFILES\Internet Explorer\iexplore.exe" "$R0"' |
39 | 2961 | mdecorde | |
40 | 2961 | mdecorde | ; Note: another way of doing this would be to use ExecShell, but then you |
41 | 2961 | mdecorde | ; really couldn't get away with deleting the files. Here is the ExecShell |
42 | 2961 | mdecorde | ; line that you would want to use: |
43 | 2961 | mdecorde | ; |
44 | 2961 | mdecorde | ; ExecShell "open" '"$R0"' |
45 | 2961 | mdecorde | ; |
46 | 2961 | mdecorde | ; The advantage of this way is that it would use the default browser to |
47 | 2961 | mdecorde | ; open the HTML. |
48 | 2961 | mdecorde | ; |
49 | 2961 | mdecorde | |
50 | 2961 | mdecorde | ; Delete the files (on reboot if file is in use) |
51 | 2961 | mdecorde | Delete /REBOOTOK $R0 |
52 | 2961 | mdecorde | |
53 | 2961 | mdecorde | SectionEnd |