; Second Life Installer Script ; Copyright (C) 2007 Dale Glass ; ; This program is free software: you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation, either version 3 of the License, or ; (at your option) any later version. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with this program. If not, see . ; HM NIS Edit Wizard helper defines !include "version.nsh" !include "settings.nsh" !define PRODUCT_NAME "Second Life" !define PRODUCT_VERSION "${SL_VERSION}/${SVN_REVISION}" !define PRODUCT_PUBLISHER "Dale Glass" !define PRODUCT_WEB_SITE "http://daleglass.net" !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\SecondLife.exe" !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" !define PRODUCT_UNINST_ROOT_KEY "HKLM" SetCompressor /solid lzma ; MUI 1.67 compatible ------ !include "MUI.nsh" !include "SL.nsh" !include "directories.nsh" ; MUI Settings !define MUI_ABORTWARNING !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico" !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico" ; Welcome page !insertmacro MUI_PAGE_WELCOME ; License page !insertmacro MUI_PAGE_LICENSE "C:\SL\trustnet\indra\newview\licenses-win32.txt" ; Directory page !insertmacro MUI_PAGE_DIRECTORY ; Instfiles page !insertmacro MUI_PAGE_INSTFILES ; Finish page ;!define MUI_FINISHPAGE_RUN "$INSTDIR\SecondLife.exe" ;!insertmacro MUI_PAGE_FINISH ; Uninstaller pages !insertmacro MUI_UNPAGE_INSTFILES ; Language files !insertmacro MUI_LANGUAGE "English" ; Reserve files !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ; MUI end ------ Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" !ifdef OUT_PATH OutFile "${OUT_PATH}\sl_${SL_VERSION}_rev_${SVN_REVISION}.exe" !else OutFile "sl_${SL_VERSION}_rev_${SVN_REVISION}.exe" !endif InstallDir "$PROGRAMFILES\Dale Glass\Second Life" InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "" ShowInstDetails hide ShowUnInstDetails hide Section "MainSection" SEC01 SectionEnd Function .onInit ; Call detect_sl FunctionEnd Section "Optimized Version" SEC02 SetOutPath "$INSTDIR" SetOverwrite ifnewer LogSet on !ifdef USE_REALPROGRESS RealProgress::SetProgress /NOUNLOAD 0 !endif File "Manifest" !ifndef USE_UNTGZ File "lzma.exe" !endif !insertmacro create_directories !insertmacro process_manifest install_file CreateDirectory "$SMPROGRAMS\Second Life (Dale Glass)" CreateShortCut "$SMPROGRAMS\Second Life (Dale Glass)\Second Life.lnk" "$INSTDIR\SecondLife.exe" CreateShortCut "$DESKTOP\Second Life (Dale Glass).lnk" "$INSTDIR\SecondLife.exe" SectionEnd Section "Debug Version" SEC03 SectionEnd Section -AdditionalIcons WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}" CreateShortCut "$SMPROGRAMS\Second Life\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url" CreateShortCut "$SMPROGRAMS\Second Life\Uninstall.lnk" "$INSTDIR\uninst.exe" SectionEnd Section -Post WriteUninstaller "$INSTDIR\uninst.exe" WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\SecondLife.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\SecondLife.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}" SectionEnd Function un.onUninstSuccess HideWindow MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer." FunctionEnd Function un.onInit MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2 Abort FunctionEnd Section Uninstall Delete "$INSTDIR\${PRODUCT_NAME}.url" Delete "$INSTDIR\uninst.exe" !insertmacro process_manifest un.remove_file Delete "$SMPROGRAMS\Second Life\Uninstall.lnk" Delete "$SMPROGRAMS\Second Life\Website.lnk" Delete "$DESKTOP\Second Life.lnk" Delete "$SMPROGRAMS\Second Life\Second Life.lnk" RMDir "$SMPROGRAMS\Second Life" RMDir "$INSTDIR" DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}" SetAutoClose true SectionEnd