viewhtml.nsi 1.4 KB

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