Statistiques
| Révision :

root / tmp / org.txm.setups / nsis / Examples / viewhtml.nsi @ 2247

Historique | Voir | Annoter | Télécharger (1,45 ko)

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