Statistiques
| Révision :

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

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

1
; viewhtml.nsi
2
;
3
; This script creates a silent installer which extracts one (or more) HTML
4
; files to a temporary directory, opens Internet Explorer to view the file(s),
5
; and when Internet Explorer has quit, deletes the file(s).
6

    
7
;--------------------------------
8

    
9
; The name of the installer (not really used in a silent install)
10
Name "ViewHTML"
11

    
12
; Set to silent mode
13
SilentInstall silent
14

    
15
; The file to write
16
OutFile "viewhtml.exe"
17

    
18
; Request application privileges for Windows Vista
19
RequestExecutionLevel user
20

    
21
;--------------------------------
22

    
23
; The stuff to install
24
Section ""
25

    
26
  ; Get a temporary filename (in the Windows Temp directory)
27
  GetTempFileName $R0
28
  
29
  ; Extract file
30
  ; Lets skip this one, it's not built to be showin in IE
31
  ; File /oname=$R0 "..\Menu\compiler.html"
32
  ; and write our own! :)
33
  FileOpen $0 $R0 "w"
34
  FileWrite $0 "<HTML><BODY><H1>HTML page for viewhtml.nsi</H1></BODY></HTML>"
35
  FileClose $0
36
  
37
  ; View file
38
  ExecWait '"$PROGRAMFILES\Internet Explorer\iexplore.exe" "$R0"'
39

    
40
  ; Note: another way of doing this would be to use ExecShell, but then you
41
  ; really couldn't get away with deleting the files. Here is the ExecShell
42
  ; line that you would want to use:
43
  ;
44
  ; ExecShell "open" '"$R0"'
45
  ;
46
  ; The advantage of this way is that it would use the default browser to
47
  ; open the HTML.
48
  ;
49
  
50
  ; Delete the files (on reboot if file is in use)
51
  Delete /REBOOTOK $R0
52

    
53
SectionEnd