home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2004 September / maximum-cd-2004-09.iso / Software / Extras / nbeep03.exe / Source / beep.nsi < prev    next >
Encoding:
Text File  |  2002-03-21  |  2.4 KB  |  95 lines

  1. Name "Beep"
  2.  
  3. ; The file to write
  4. OutFile "nbeep03.exe"
  5.  
  6. InstallDir "$PROGRAMFILES\Nullsoft Beep"
  7.  
  8. InstallDirRegKey HKLM "SOFTWARE\Nullsoft Beep" ""
  9.  
  10. DirText "Choose a directory for Nullsoft Beep:"
  11.  
  12. ShowInstDetails show
  13. ShowUnInstDetails show
  14.  
  15. !macro killBeeps
  16.   FindWindow $0 "#32770" "Nullsoft Beep v0.2 (Status Window)"
  17.   StrCmp $0 0 nov02
  18.     SendMessage $0 273 1001 0
  19.     StrCpy $9 1
  20.     DetailPrint "Closing running instance of Beep..."
  21.     Sleep 1000
  22.   nov02:
  23.   FindWindow $0 "#32770" "Nullsoft Beep v0.3 (Status Window)"
  24.   StrCmp $0 0 nov03
  25.     SendMessage $0 273 1001 0
  26.     StrCpy $9 1
  27.     DetailPrint "Closing running instance of Beep..."
  28.     Sleep 1000
  29.   nov03:
  30. !macroend
  31.  
  32. Section ""
  33.   StrCpy $9 0
  34.   !InsertMacro killBeeps
  35.   SetOutPath $INSTDIR\Source
  36.   File audio.cpp
  37.   File beep.dsp
  38.   File beep.dsw
  39.   File beep.nsi
  40.   File beepdll.dsp
  41.   File beepdll.dsw
  42.   File hookdll.c
  43.   File icon1.ico
  44.   File ipdh.h
  45.   File main.cpp
  46.   File resource.h
  47.   File script1.rc
  48.   
  49.  
  50.   SetOutPath $INSTDIR
  51.   File Release\beep.exe
  52.   File Release\beep.dll
  53.  
  54.   WriteRegStr HKLM "SOFTWARE\Nullsoft Beep" "" "$INSTDIR"
  55.  
  56.   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Beep" "DisplayName" "Nullsoft Beep (remove only)"
  57.   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Beep" "UninstallString" '"$INSTDIR\uninst-beep.exe"'
  58.   WriteUninstaller "$INSTDIR\uninst-beep.exe"
  59.   IfFileExists "$SMPROGRAMS\Nullsoft Beep.lnk" nosc
  60.     MessageBox MB_YESNO|MB_ICONQUESTION "Add Start Menu shortcut for Beep?" \
  61.       IDNO nosc
  62.       CreateShortCut "$SMPROGRAMS\Nullsoft Beep.lnk" "$INSTDIR\Beep.exe"
  63.   nosc:
  64.  
  65.   StrCmp $9 1 noprompttorun
  66.     MessageBox MB_YESNO|MB_ICONQUESTION "Run Nullsoft Beep now?" IDNO norun
  67. noprompttorun:
  68.   Exec '"$INSTDIR\beep.exe"'
  69. norun:
  70.  
  71.   
  72.  
  73. SectionEnd
  74.  
  75. UninstallText "This will uninstall Nullsoft Beep. Hit next to continue."
  76.  
  77. ; special uninstall section.
  78. Section "Uninstall"
  79.   !InsertMacro killBeeps
  80.   ; remove registry keys
  81.   DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Beep"
  82.   DeleteRegKey HKLM SOFTWARE\Beep
  83.   DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" NullsoftBeep
  84.   Delete $INSTDIR\beep.exe
  85.   Delete $INSTDIR\beep.dll
  86.   Delete $INSTDIR\uninst-beep.exe
  87.   ; remove shortcuts, if any.
  88.   Delete "$SMPROGRAMS\Nullsoft Beep.lnk"
  89.   Delete $INSTDIR\Source\*.*
  90.   RMDir "$INSTDIR\Source"
  91.   RMDir "$INSTDIR"
  92. SectionEnd
  93.  
  94. ; eof
  95.