; XmP.nsi ; ; The name of the installer Name "XmP Stable Code Name Gamera" ; The file to write OutFile "XmP_Installer.exe" ; The default installation directory InstallDir $PROGRAMFILES\XmP ; Registry key to check for directory (so if you install again, it will ; overwrite the old one automatically) InstallDirRegKey HKLM SOFTWARE\XmP "Install_Dir" ; The text to prompt the user to enter a directory ComponentText "This will install XmP The Saiyan Jin Player on your computer. Select which optional things you want installed." ; The text to prompt the user to enter a directory DirText "Choose a directory to install in to:" !macro UpgradeDLLNoReg Exch $0 Push $1 Push $2 Push $3 Push $4 ClearErrors GetDLLVersionLocal ${DLL_NAME} $1 $2 GetDLLVersion $0 $3 $4 IfErrors upgrade_${DLL_NAME} IntCmpU $1 $3 noupgrade_${DLL_NAME} noupgrade_${DLL_NAME} upgrade_${DLL_NAME} IntCmpU $2 $4 noupgrade_${DLL_NAME} noupgrade_${DLL_NAME} upgrade_${DLL_NAME}: File /oname=$0 ${DLL_NAME} noupgrade_${DLL_NAME}: Pop $4 Pop $3 Pop $2 Pop $1 Pop $0 !undef DLL_NAME !macroend ; The stuff to install Section "XmP Gamera (required)" ; Set output path to the installation directory. SetOutPath $INSTDIR ; Put file there File /r ".\Inst_Source\*.*" ; Write the installation path into the registry WriteRegStr HKLM SOFTWARE\XmP "Install_Dir" "$INSTDIR" ; Write the uninstall keys for Windows WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\XmP" "DisplayName" "XmP Gamera (remove only)" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\XmP" "UninstallString" '"$INSTDIR\uninstall.exe"' WriteUninstaller "uninstall.exe" Push "$SYSDIR\MSWinSCK.ocx" !define DLL_NAME ".\Inst_Source\DAT\MSWinSCK.ocx" !insertmacro UpgradeDLLNoReg CreateShortCut "$INSTDIR\GPL_E.lnk" "$INSTDIR\xmSCROLLER.exe" "GPL_E" "$INSTDIR\xmSCROLLER.exe" 0 CreateShortCut "$INSTDIR\Whats a New!.lnk" "$INSTDIR\xmSCROLLER.exe" "Whats a New!" "$INSTDIR\xmSCROLLER.exe" 0 SectionEnd ; optional section Section "Start Menu Shortcuts" SetShellVarContext Current CreateDirectory "$SMPROGRAMS\XmP" CreateShortCut "$SMPROGRAMS\XmP\Kill Me.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 CreateShortCut "$SMPROGRAMS\XmP\XmP.lnk" "$INSTDIR\XmP.exe" "" "$INSTDIR\XmP.exe" 0 CreateShortCut "$SMPROGRAMS\XmP\GPL_E.lnk" "$INSTDIR\xmSCROLLER.exe" "GPL_E" "$INSTDIR\xmSCROLLER.exe" 0 CreateShortCut "$SMPROGRAMS\XmP\Whats a New!.lnk" "$INSTDIR\xmSCROLLER.exe" "Whats a New!" "$INSTDIR\xmSCROLLER.exe" 0 SectionEnd ; optional section Section "Quick Lunch Shortcuts" SetShellVarContext Current CreateShortCut "$QUICKLAUNCH\XmP.lnk" "$INSTDIR\XmP.exe" "" "$INSTDIR\XmP.exe" 0 SectionEnd ; uninstall stuff UninstallText "This will uninstall XmP the Saiyan Jin Mp3 Player. Hit next to continue." ; special uninstall section. Section "Uninstall" ; remove registry keys DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\XmP" DeleteRegKey HKLM SOFTWARE\XmP ; remove files Delete $INSTDIR\*.* Delete $INSTDIR\Logs\*.* Delete $INSTDIR\Font\*.* ; MUST REMOVE UNINSTALLER, too ;Delete $INSTDIR\uninstall.exe ; remove shortcuts. Delete "$SMPROGRAMS\XmP\*.*" Delete "$QUICKLAUNCH\XmP.lnk" ; remove directories used. RMDir "$SMPROGRAMS\XmP" RMDir /r "$INSTDIR" SectionEnd ; eof