|
| 1 | +!include "FileFunc.nsh" |
| 2 | +!include "MUI2.nsh" |
| 3 | + |
| 4 | +!define APPNAME "T5DE" |
| 5 | +!define IMVU_VERSION $%IMVU_VERSION% |
| 6 | +!define T5DE_VERSION $%T5DE_VERSION% |
| 7 | +!define APP_VERSION $%APP_VERSION% |
| 8 | +!define APP_EXE "IMVUClient.exe" |
| 9 | + |
| 10 | +!ifndef OUTDIR |
| 11 | +!define OUTDIR .. |
| 12 | +!endif |
| 13 | + |
| 14 | +!define APP_UNINSTALL "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" |
| 15 | + |
| 16 | +; General |
| 17 | + |
| 18 | + Name "${APPNAME}" |
| 19 | + BrandingText "T5DE ${APP_VERSION}" |
| 20 | + |
| 21 | + OutFile "${OUTDIR}\${APPNAME}-${APP_VERSION}.exe" |
| 22 | + Unicode true |
| 23 | + |
| 24 | + InstallDir "$LOCALAPPDATA\IMVUClient" |
| 25 | + InstallDirRegKey HKCU "Software\${APPNAME}" "" |
| 26 | + |
| 27 | + RequestExecutionLevel user |
| 28 | + |
| 29 | + ShowInstDetails show |
| 30 | + |
| 31 | +; Compiler Flags |
| 32 | + |
| 33 | + SetCompressor lzma |
| 34 | + SetDateSave off |
| 35 | + |
| 36 | +; Variables |
| 37 | + |
| 38 | + Var SMDIR |
| 39 | + |
| 40 | +; Interface Settings |
| 41 | + !define MUI_ICON "t5de.ico" |
| 42 | + !define MUI_UNICON "t5de.ico" |
| 43 | + |
| 44 | + !define MUI_ABORTWARNING |
| 45 | + !define MUI_FINISHPAGE_NOAUTOCLOSE |
| 46 | + !define MUI_UNFINISHPAGE_NOAUTOCLOSE |
| 47 | + |
| 48 | + !define MUI_FINISHPAGE_SHOWREADME "" |
| 49 | + !define MUI_FINISHPAGE_SHOWREADME_TEXT "Create Desktop Shortcut" |
| 50 | + !define MUI_FINISHPAGE_SHOWREADME_FUNCTION CreateDesktopShortcut |
| 51 | + |
| 52 | + !define MUI_FINISHPAGE_RUN "$INSTDIR\${APP_EXE}" |
| 53 | + |
| 54 | +; Pages |
| 55 | + |
| 56 | + !insertmacro MUI_PAGE_WELCOME |
| 57 | + !insertmacro MUI_PAGE_DIRECTORY |
| 58 | + |
| 59 | + ;Start Menu Folder Page Configuration |
| 60 | + !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" |
| 61 | + !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\${APPNAME}" |
| 62 | + !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" |
| 63 | + !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${APPNAME}" |
| 64 | + |
| 65 | + !insertmacro MUI_PAGE_STARTMENU Application $SMDIR |
| 66 | + |
| 67 | + !insertmacro MUI_PAGE_INSTFILES |
| 68 | + !insertmacro MUI_PAGE_FINISH |
| 69 | + |
| 70 | + !insertmacro MUI_UNPAGE_WELCOME |
| 71 | + !insertmacro MUI_UNPAGE_CONFIRM |
| 72 | + !insertmacro MUI_UNPAGE_INSTFILES |
| 73 | + !insertmacro MUI_UNPAGE_FINISH |
| 74 | + |
| 75 | +;Languages |
| 76 | + |
| 77 | + !insertmacro MUI_LANGUAGE "English" |
| 78 | + |
| 79 | +; Versioning |
| 80 | + |
| 81 | + VIProductVersion "${IMVU_VERSION}.0.0" |
| 82 | + VIFileVersion "${IMVU_VERSION}.0.0" |
| 83 | + VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${APP_VERSION}" |
| 84 | + VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "${APPNAME}" |
| 85 | + VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "${APPNAME}" |
| 86 | + VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductVersion" "${APP_VERSION}" |
| 87 | + VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Application Installer" |
| 88 | + |
| 89 | +; Sections |
| 90 | + |
| 91 | +Section "${APPNAME}" SecInstall |
| 92 | + SectionIn RO |
| 93 | + |
| 94 | + SetOutPath "$INSTDIR" |
| 95 | + |
| 96 | + File /nonfatal /r "${OUTDIR}\IMVUClient\*" |
| 97 | + |
| 98 | + WriteUninstaller "$INSTDIR\${APPNAME} Uninstall.exe" |
| 99 | + |
| 100 | + ${GetSize} "$INSTDIR" "" $0 $1 $2 |
| 101 | + |
| 102 | + WriteRegStr HKCU "Software\${APPNAME}" "" $INSTDIR |
| 103 | + |
| 104 | + WriteRegStr HKLM "${APP_UNINSTALL}" "DisplayName" "${APPNAME}" |
| 105 | + WriteRegStr HKLM "${APP_UNINSTALL}" "DisplayVersion" "${APP_VERSION}" |
| 106 | + WriteRegStr HKLM "${APP_UNINSTALL}" "DisplayIcon" "$INSTDIR\${APPNAME} Uninstall.exe" |
| 107 | + WriteRegStr HKLM "${APP_UNINSTALL}" "UninstallString" "$INSTDIR\${APPNAME} Uninstall.exe" |
| 108 | + WriteRegStr HKLM "${APP_UNINSTALL}" "InstallLocation" "$INSTDIR" |
| 109 | + WriteRegDWORD HKLM "${APP_UNINSTALL}" "EstimatedSize" "$0" |
| 110 | + |
| 111 | + !insertmacro MUI_STARTMENU_WRITE_BEGIN Application |
| 112 | + |
| 113 | + CreateDirectory "$SMPROGRAMS\$SMDIR" |
| 114 | + CreateShortCut "$SMPROGRAMS\$SMDIR\${APPNAME}.lnk" "$INSTDIR\${APP_EXE}" "" "$INSTDIR\${APPNAME} Uninstall.exe" |
| 115 | + CreateShortCut "$SMPROGRAMS\$SMDIR\Uninstall ${APPNAME}.lnk" "$INSTDIR\${APPNAME} Uninstall.exe" "" "$INSTDIR\${APPNAME} Uninstall.exe" |
| 116 | + |
| 117 | + !insertmacro MUI_STARTMENU_WRITE_END |
| 118 | +SectionEnd |
| 119 | + |
| 120 | +Section "Uninstall" |
| 121 | + RMDir /r /REBOOTOK $INSTDIR |
| 122 | + |
| 123 | + !insertmacro MUI_STARTMENU_GETFOLDER Application $SMDIR |
| 124 | + |
| 125 | + Delete "$SMPROGRAMS\$SMDIR\${APPNAME}.lnk" |
| 126 | + Delete "$SMPROGRAMS\$SMDIR\Uninstall ${APPNAME}.lnk" |
| 127 | + Delete "$DESKTOP\${APPNAME}.lnk" |
| 128 | + |
| 129 | + RMDIR "$SMPROGRAMS\$SMDIR" |
| 130 | + |
| 131 | + DeleteRegKey HKCU "Software\${APPNAME}" |
| 132 | + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" |
| 133 | +SectionEnd |
| 134 | + |
| 135 | +Function CreateDesktopShortcut |
| 136 | + CreateShortCut "$DESKTOP\${APPNAME}.lnk" "$INSTDIR\${APP_EXE}" "" "$INSTDIR\${APPNAME} Uninstall.exe" |
| 137 | +FunctionEnd |
0 commit comments