|
15 | 15 | nodeModuleFilePatterns: |
16 | 16 | - '**/*' |
17 | 17 | - build/**/* |
| 18 | +nsis: |
| 19 | + script: |- |
| 20 | + !include "T:\TxCRCP\TxDOT\node_modules\app-builder-lib\templates\nsis\include\StdUtils.nsh" |
| 21 | + !addincludedir "T:\TxCRCP\TxDOT\node_modules\app-builder-lib\templates\nsis\include" |
| 22 | + !macro _isUpdated _a _b _t _f |
| 23 | + ${StdUtils.TestParameter} $R9 "updated" |
| 24 | + StrCmp "$R9" "true" `${_t}` `${_f}` |
| 25 | + !macroend |
| 26 | + !define isUpdated `"" isUpdated ""` |
| 27 | +
|
| 28 | + !macro _isForceRun _a _b _t _f |
| 29 | + ${StdUtils.TestParameter} $R9 "force-run" |
| 30 | + StrCmp "$R9" "true" `${_t}` `${_f}` |
| 31 | + !macroend |
| 32 | + !define isForceRun `"" isForceRun ""` |
| 33 | +
|
| 34 | + !macro _isKeepShortcuts _a _b _t _f |
| 35 | + ${StdUtils.TestParameter} $R9 "keep-shortcuts" |
| 36 | + StrCmp "$R9" "true" `${_t}` `${_f}` |
| 37 | + !macroend |
| 38 | + !define isKeepShortcuts `"" isKeepShortcuts ""` |
| 39 | +
|
| 40 | + !macro _isNoDesktopShortcut _a _b _t _f |
| 41 | + ${StdUtils.TestParameter} $R9 "no-desktop-shortcut" |
| 42 | + StrCmp "$R9" "true" `${_t}` `${_f}` |
| 43 | + !macroend |
| 44 | + !define isNoDesktopShortcut `"" isNoDesktopShortcut ""` |
| 45 | +
|
| 46 | + !macro _isDeleteAppData _a _b _t _f |
| 47 | + ${StdUtils.TestParameter} $R9 "delete-app-data" |
| 48 | + StrCmp "$R9" "true" `${_t}` `${_f}` |
| 49 | + !macroend |
| 50 | + !define isDeleteAppData `"" isDeleteAppData ""` |
| 51 | +
|
| 52 | + !macro _isForAllUsers _a _b _t _f |
| 53 | + ${StdUtils.TestParameter} $R9 "allusers" |
| 54 | + StrCmp "$R9" "true" `${_t}` `${_f}` |
| 55 | + !macroend |
| 56 | + !define isForAllUsers `"" isForAllUsers ""` |
| 57 | +
|
| 58 | + !macro _isForCurrentUser _a _b _t _f |
| 59 | + ${StdUtils.TestParameter} $R9 "currentuser" |
| 60 | + StrCmp "$R9" "true" `${_t}` `${_f}` |
| 61 | + !macroend |
| 62 | + !define isForCurrentUser `"" isForCurrentUser ""` |
| 63 | +
|
| 64 | + !macro addLangs |
| 65 | + !insertmacro MUI_LANGUAGE "English" |
| 66 | + !insertmacro MUI_LANGUAGE "German" |
| 67 | + !insertmacro MUI_LANGUAGE "French" |
| 68 | + !insertmacro MUI_LANGUAGE "SpanishInternational" |
| 69 | + !insertmacro MUI_LANGUAGE "SimpChinese" |
| 70 | + !insertmacro MUI_LANGUAGE "TradChinese" |
| 71 | + !insertmacro MUI_LANGUAGE "Japanese" |
| 72 | + !insertmacro MUI_LANGUAGE "Korean" |
| 73 | + !insertmacro MUI_LANGUAGE "Italian" |
| 74 | + !insertmacro MUI_LANGUAGE "Dutch" |
| 75 | + !insertmacro MUI_LANGUAGE "Danish" |
| 76 | + !insertmacro MUI_LANGUAGE "Swedish" |
| 77 | + !insertmacro MUI_LANGUAGE "Norwegian" |
| 78 | + !insertmacro MUI_LANGUAGE "Finnish" |
| 79 | + !insertmacro MUI_LANGUAGE "Russian" |
| 80 | + !insertmacro MUI_LANGUAGE "Portuguese" |
| 81 | + !insertmacro MUI_LANGUAGE "PortugueseBR" |
| 82 | + !insertmacro MUI_LANGUAGE "Polish" |
| 83 | + !insertmacro MUI_LANGUAGE "Ukrainian" |
| 84 | + !insertmacro MUI_LANGUAGE "Czech" |
| 85 | + !insertmacro MUI_LANGUAGE "Slovak" |
| 86 | + !insertmacro MUI_LANGUAGE "Hungarian" |
| 87 | + !insertmacro MUI_LANGUAGE "Arabic" |
| 88 | + !insertmacro MUI_LANGUAGE "Turkish" |
| 89 | + !insertmacro MUI_LANGUAGE "Thai" |
| 90 | + !insertmacro MUI_LANGUAGE "Vietnamese" |
| 91 | + !macroend |
| 92 | +
|
| 93 | + !addplugindir /x86-unicode "C:\Users\pyppr\AppData\Local\electron-builder\Cache\nsis\nsis-resources-3.4.1\plugins\x86-unicode" |
| 94 | + !include "C:\Users\pyppr\AppData\Local\Temp\t-2NpzRD\0-messages.nsh" |
| 95 | +
|
| 96 | + Var newStartMenuLink |
| 97 | + Var oldStartMenuLink |
| 98 | + Var newDesktopLink |
| 99 | + Var oldDesktopLink |
| 100 | + Var oldShortcutName |
| 101 | + Var oldMenuDirectory |
| 102 | +
|
| 103 | + !include "common.nsh" |
| 104 | + !include "MUI2.nsh" |
| 105 | + !include "multiUser.nsh" |
| 106 | + !include "allowOnlyOneInstallerInstance.nsh" |
| 107 | +
|
| 108 | + !ifdef INSTALL_MODE_PER_ALL_USERS |
| 109 | + !ifdef BUILD_UNINSTALLER |
| 110 | + RequestExecutionLevel user |
| 111 | + !else |
| 112 | + RequestExecutionLevel admin |
| 113 | + !endif |
| 114 | + !else |
| 115 | + RequestExecutionLevel user |
| 116 | + !endif |
| 117 | +
|
| 118 | + !ifdef BUILD_UNINSTALLER |
| 119 | + SilentInstall silent |
| 120 | + !else |
| 121 | + Var appExe |
| 122 | + Var launchLink |
| 123 | + !endif |
| 124 | +
|
| 125 | + !ifdef ONE_CLICK |
| 126 | + !include "oneClick.nsh" |
| 127 | + !else |
| 128 | + !include "assistedInstaller.nsh" |
| 129 | + !endif |
| 130 | +
|
| 131 | + !insertmacro addLangs |
| 132 | +
|
| 133 | + !ifmacrodef customHeader |
| 134 | + !insertmacro customHeader |
| 135 | + !endif |
| 136 | +
|
| 137 | + Function .onInit |
| 138 | + SetOutPath $INSTDIR |
| 139 | + ${LogSet} on |
| 140 | +
|
| 141 | + !ifmacrodef preInit |
| 142 | + !insertmacro preInit |
| 143 | + !endif |
| 144 | +
|
| 145 | + !ifdef DISPLAY_LANG_SELECTOR |
| 146 | + !insertmacro MUI_LANGDLL_DISPLAY |
| 147 | + !endif |
| 148 | +
|
| 149 | + !ifdef BUILD_UNINSTALLER |
| 150 | + WriteUninstaller "${UNINSTALLER_OUT_FILE}" |
| 151 | + !insertmacro quitSuccess |
| 152 | + !else |
| 153 | + !insertmacro check64BitAndSetRegView |
| 154 | +
|
| 155 | + !ifdef ONE_CLICK |
| 156 | + !insertmacro ALLOW_ONLY_ONE_INSTALLER_INSTANCE |
| 157 | + !else |
| 158 | + ${IfNot} ${UAC_IsInnerInstance} |
| 159 | + !insertmacro ALLOW_ONLY_ONE_INSTALLER_INSTANCE |
| 160 | + ${EndIf} |
| 161 | + !endif |
| 162 | +
|
| 163 | + !insertmacro initMultiUser |
| 164 | +
|
| 165 | + !ifmacrodef customInit |
| 166 | + !insertmacro customInit |
| 167 | + !endif |
| 168 | +
|
| 169 | + !ifmacrodef addLicenseFiles |
| 170 | + InitPluginsDir |
| 171 | + !insertmacro addLicenseFiles |
| 172 | + !endif |
| 173 | + !endif |
| 174 | + FunctionEnd |
| 175 | +
|
| 176 | + !ifndef BUILD_UNINSTALLER |
| 177 | + !include "installUtil.nsh" |
| 178 | + !endif |
| 179 | +
|
| 180 | + Section "install" |
| 181 | + !ifndef BUILD_UNINSTALLER |
| 182 | + # If we're running a silent upgrade of a per-machine installation, elevate so extracting the new app will succeed. |
| 183 | + # For a non-silent install, the elevation will be triggered when the install mode is selected in the UI, |
| 184 | + # but that won't be executed when silent. |
| 185 | + !ifndef INSTALL_MODE_PER_ALL_USERS |
| 186 | + !ifndef ONE_CLICK |
| 187 | + ${if} $hasPerMachineInstallation == "1" # set in onInit by initMultiUser |
| 188 | + ${andIf} ${Silent} |
| 189 | + ${ifNot} ${UAC_IsAdmin} |
| 190 | + ShowWindow $HWNDPARENT ${SW_HIDE} |
| 191 | + !insertmacro UAC_RunElevated |
| 192 | + ${Switch} $0 |
| 193 | + ${Case} 0 |
| 194 | + ${Break} |
| 195 | + ${Case} 1223 ;user aborted |
| 196 | + ${Break} |
| 197 | + ${Default} |
| 198 | + MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "Unable to elevate, error $0" |
| 199 | + ${Break} |
| 200 | + ${EndSwitch} |
| 201 | + Quit |
| 202 | + ${else} |
| 203 | + !insertmacro setInstallModePerAllUsers |
| 204 | + ${endIf} |
| 205 | + ${endIf} |
| 206 | + !endif |
| 207 | + !endif |
| 208 | + !include "installSection.nsh" |
| 209 | + !endif |
| 210 | + SectionEnd |
| 211 | +
|
| 212 | + !ifdef BUILD_UNINSTALLER |
| 213 | + !include "uninstaller.nsh" |
| 214 | + !endif |
0 commit comments