home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 October / Chip_2001-10_cd1.bin / zkuste / delphi / nastroje / d23456 / NSIS.EXE / uglytest.nsi < prev    next >
Text File  |  2001-05-19  |  2KB  |  64 lines

  1. Function .onInit
  2.   MessageBox MB_YESNO "Would you like to install the Ugly Test?" IDYES NoAbort
  3.     MessageBox MB_OK "Install aborted."
  4.     Abort
  5.   NoAbort: 
  6. FunctionEnd
  7.  
  8. Function .onVerifyInstDir 
  9. ; if you want to use this, check $INSTDIR to make sure it is valid, and Abort
  10. ; if it is not. (i.e. for a winamp plug-in, you could do: 
  11. ; IfFileExists $INSTDIR\Winamp.exe Exists
  12. ;   Abort
  13. ; Exists:
  14. FunctionEnd
  15.  
  16. Function .onUserAbort
  17.   MessageBox MB_YESNO "Abort install?" IDYES NoAbort
  18.     Abort ; this causes the installer to not cancel itself 
  19.           ; (the user aborted the "quit" process)
  20.   NoAbort:
  21. FunctionEnd
  22.  
  23. Function .onInstSuccess
  24.   MessageBox MB_OK "Yay for you, the installer worked. Don't break your computer now, bitch."
  25. FunctionEnd
  26.  
  27. Function .onInstFailed
  28. MessageBox MB_OK "Your computer sucks, so try again later."
  29. FunctionEnd
  30.  
  31. Name "Ugly Test"
  32. Caption "Ugly Test Setup Installer"
  33. OutFile "uglytest.exe"
  34. BGGradient 0000FF FFFF00 FFFFFF
  35.  
  36. DirText "This will install the ugly test on your computer. Choose a directory."
  37. InstallDir $PROGRAMFILES\UglyTest
  38. InstallDirRegKey HKLM Software\UglyTest ""
  39.  
  40. Function SetupRegKeys
  41.   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\UglyTest" "DisplayName" "UglyTest (remove only)"
  42.   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\UglyTest" "UninstallString" '"$INSTDIR\uninst.exe"'
  43.   WriteRegStr HKLM Software\UglyTest "" $INSTDIR
  44. FunctionEnd
  45.  
  46. Section ; default section
  47.   SetOutPath $INSTDIR
  48.   Call SetupRegKeys
  49.   MessageBox MB_YESNO "Would you like to abort the install?" IDNO NoAbort
  50.     Abort "Install aborted by user"
  51.   NoAbort:
  52. SectionEnd ; end the section
  53.  
  54. UninstallEXEName "uninst.exe"
  55. UninstallText "This will uninstall the Ugly Test from your system."
  56.  
  57. Section Uninstall
  58.   DeleteRegKey HKLM Software\UglyTest
  59.   Delete $INSTDIR\uninst.exe
  60.   RMDir $INSTDIR
  61. SectionEnd
  62.  
  63. ; eof
  64.