| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- ;--------------------------------
- ;Atomic Editor NSIS Installation Script
- ;--------------------------------
- !ifndef ATOMIC_ROOT
- !error "ATOMIC_ROOT NOT DEFINED"
- !endif
- !ifndef EDITOR_VERSION
- !error "EDITOR_VERSION NOT DEFINED"
- !endif
- !ifndef INSTALLER_NAME
- !error "INSTALLER_NAME NOT DEFINED"
- !endif
- !define prodname "Atomic Editor"
- !define coname "THUNDERBEAST GAMES LLC"
- !define outfile "${ATOMIC_ROOT}\Artifacts\Dist\${INSTALLER_NAME}"
- !define appexe "AtomicEditor.exe"
- !define produrl "http://www.atomicgameengine.com/"
- ;--------------------------------
- ;Include Modern UI
- ;--------------------------------
- !include "MUI.nsh"
- !define MUI_HEADERIMAGE
- !define MUI_HEADERIMAGE_RIGHT
- !define MUI_HEADERIMAGE_BITMAP "Windows_Installer_Header.bmp"
- !define MUI_WELCOMEFINISHPAGE_BITMAP "Windows_Installer_LeftImage.bmp"
- !define MUI_HEADERIMAGE_UNBITMAP "Windows_Installer_Header.bmp"
- !define MUI_HEADER_TRANSPARENT_TEXT
- ;--------------------------------
- ;General
- ;--------------------------------
- ;Name and file
- Name "${prodname}"
- OutFile "${outfile}"
- RequestExecutionLevel admin
- ;Default installation folder
- InstallDir "$PROGRAMFILES64\${prodname}"
- ;Get installation folder from registry if available
- InstallDirRegKey HKLM "Software\${coname}\InstallDir" "${prodname}"
- ;--------------------------------
- ;Interface Settings
- ;--------------------------------
- !define MUI_ABORTWARNING
- ;--------------------------------
- ;Pages
- ;--------------------------------
- !insertmacro MUI_PAGE_WELCOME
- !insertmacro MUI_PAGE_DIRECTORY
- !insertmacro MUI_PAGE_INSTFILES
- ; These indented statements modify settings for MUI_PAGE_FINISH
- ; The installer runs in elevated mode, NSIS doesn't have a way
- ; without plugins to run the installed application in normal user mode
- ; so disabling launch checkbox, look into a MSI replacement
- ;!define MUI_FINISHPAGE_NOAUTOCLOSE
- ;!define MUI_FINISHPAGE_RUN "$INSTDIR\${appexe}"
- ;!define MUI_FINISHPAGE_RUN_CHECKED
- ;!define MUI_FINISHPAGE_RUN_TEXT "Launch the Atomic Editor"
- !insertmacro MUI_PAGE_FINISH
- !insertmacro MUI_UNPAGE_CONFIRM
- !insertmacro MUI_UNPAGE_INSTFILES
- ;--------------------------------
- ;Languages
- ;--------------------------------
- !insertmacro MUI_LANGUAGE "English"
- ;--------------------------------
- ;Installer Sections
- ;--------------------------------
- Section "${prodname}" SecMain
- SetShellVarContext all
- SetOutPath "$INSTDIR"
- File /r "${ATOMIC_ROOT}\Artifacts\AtomicEditor\*.*"
- ;Store installation folder
- WriteRegStr HKLM "Software\${coname}\InstallDir" "${prodname}" $INSTDIR
- ; Create shortcut
- CreateShortCut "$DESKTOP\${prodname}.lnk" "$INSTDIR\${appexe}"
- CreateShortCut "$SMPROGRAMS\${prodname}.lnk" "$INSTDIR\${appexe}"
- ; Update Add/Remove Programs
- DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${prodname}"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${prodname}" "DisplayName" "${prodname}"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${prodname}" "UninstallString" "$INSTDIR\Uninstall.exe"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${prodname}" "InstallLocation" "$INSTDIR"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${prodname}" "DisplayIcon" "$INSTDIR\${appexe},0"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${prodname}" "Publisher" "${coname}"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${prodname}" "URLInfoAbout" "${produrl}"
- WriteRegDWord HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${prodname}" "NoRepair" 1
- WriteRegDWord HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${prodname}" "NoModify" 1
- ;Create uninstaller
- WriteUninstaller "$INSTDIR\Uninstall.exe"
- SectionEnd
- ;--------------------------------
- ;Uninstaller Section
- ;--------------------------------
- Section "Uninstall"
- SetShellVarContext all
- ; Remove short cut
- Delete "$SMPROGRAMS\${prodname}.lnk"
- Delete "$DESKTOP\${prodname}.lnk"
- ; Remove installation folder
- RMDir /r $INSTDIR
- ; Remove from Add/Remove Programs
- DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${prodname}"
- ; Remove installation folder
- DeleteRegValue HKLM "Software\${coname}\InstallDir" "${prodname}"
- DeleteRegKey /ifempty HKLM "Software\${coname}\InstallDir"
- DeleteRegKey /ifempty HKLM "Software\${coname}"
- SectionEnd
|