forked from olcxjas-softworks/LarpixClient
update electron to v43
This commit is contained in:
parent
68ac0beedf
commit
fb6c8b6ee9
5385 changed files with 513060 additions and 123058 deletions
4
electron/node_modules/app-builder-lib/templates/nsis/README.md
generated
vendored
4
electron/node_modules/app-builder-lib/templates/nsis/README.md
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
# NSIS
|
||||
|
||||
⚠️ **It is developer documentation.** If your are looking for usage guide, see [user documentation](https://electron.build/configuration/nsis).
|
||||
⚠️ **It is developer documentation.** If your are looking for usage guide, see [user documentation](https://electron.build/nsis).
|
||||
|
||||
NSIS stands for Nullsoft Scriptable Install System. electron-builder utilizes a [customized version](https://github.com/electron-userland/electron-builder-binaries) of it and uses `NsisMultiUser` plugin to handle installation for single user or all users on the computer.
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ For translators, the strings to be displayed are included in [`assistedMessages.
|
|||
As for other strings in NSIS, head to [electron-userland/electron-builder-binaries](https://github.com/electron-userland/electron-builder-binaries) or the upstream repository on [Sorceforge](https://sourceforge.net/p/nsis/code/HEAD/tree/).
|
||||
|
||||
## GUID
|
||||
See [docs](https://electron.build/configuration/nsis).
|
||||
See [docs](https://electron.build/nsis).
|
||||
|
||||
We use UUID v5 to generate sha-1 name-based UUID.
|
||||
|
||||
|
|
|
|||
21
electron/node_modules/app-builder-lib/templates/nsis/assistedInstaller.nsh
generated
vendored
21
electron/node_modules/app-builder-lib/templates/nsis/assistedInstaller.nsh
generated
vendored
|
|
@ -31,11 +31,9 @@
|
|||
|
||||
# sanitize the MUI_PAGE_DIRECTORY result to make sure it has a application name sub-folder
|
||||
Function instFilesPre
|
||||
${If} ${FileExists} "$INSTDIR\*"
|
||||
${StrContains} $0 "${APP_FILENAME}" $INSTDIR
|
||||
${If} $0 == ""
|
||||
StrCpy $INSTDIR "$INSTDIR\${APP_FILENAME}"
|
||||
${endIf}
|
||||
${StrContains} $0 "${APP_FILENAME}" $INSTDIR
|
||||
${If} $0 == ""
|
||||
StrCpy $INSTDIR "$INSTDIR\${APP_FILENAME}"
|
||||
${endIf}
|
||||
FunctionEnd
|
||||
!endif
|
||||
|
|
@ -66,7 +64,12 @@
|
|||
!endif
|
||||
!else
|
||||
!ifndef removeDefaultUninstallWelcomePage
|
||||
!insertmacro MUI_UNPAGE_WELCOME
|
||||
!ifmacrodef customUnWelcomePage
|
||||
!insertmacro customUnWelcomePage
|
||||
!else
|
||||
!insertmacro MUI_UNPAGE_WELCOME
|
||||
!endif
|
||||
|
||||
!endif
|
||||
!ifndef INSTALL_MODE_PER_ALL_USERS
|
||||
!insertmacro PAGE_INSTALL_MODE
|
||||
|
|
@ -140,7 +143,11 @@
|
|||
!ifdef INSTALL_MODE_PER_ALL_USERS
|
||||
!insertmacro setInstallModePerAllUsers
|
||||
!else
|
||||
!insertmacro setInstallModePerUser
|
||||
!ifdef INSTALL_MODE_PER_ALL_USERS_DEFAULT
|
||||
!insertmacro setInstallModePerAllUsers
|
||||
!else
|
||||
!insertmacro setInstallModePerUser
|
||||
!endif
|
||||
!endif
|
||||
${endif}
|
||||
!endif
|
||||
|
|
|
|||
8
electron/node_modules/app-builder-lib/templates/nsis/assistedMessages.yml
generated
vendored
8
electron/node_modules/app-builder-lib/templates/nsis/assistedMessages.yml
generated
vendored
|
|
@ -90,7 +90,7 @@ whoShouldThisApplicationBeInstalledFor:
|
|||
selectUserMode:
|
||||
en: Please select whether you wish to make this software available to all users or just yourself
|
||||
de: Bitte wählen Sie, ob Sie die Anwendung nur für sich oder für alle Benutzer installieren möchten.
|
||||
ru: Выбери, хочешь ли ты сделать эту программу доступной для всех пользователей или только для себя
|
||||
ru: Выберите, хотите ли Вы сделать эту программу доступной для всех пользователей, или только для себя
|
||||
sk: Prosím vyberte či sa ma tento softvér inštalovať len pre Vás alebo pre všetkých uživateľov
|
||||
cs: Prosím vyberte, zda se má tento software instalovat jen pro Vás, nebo pro všechny uživatele
|
||||
fr: "Choisis pour qui ce logiciel doit être accessible : pour tous les utilisateurs ou juste pour toi ?"
|
||||
|
|
@ -112,7 +112,7 @@ selectUserMode:
|
|||
whichInstallationRemove:
|
||||
en: This software is installed both per-machine (all users) and per-user.\nWhich installation you wish to remove?
|
||||
de: Die Anwendung wurde für alle Benutzer und pro Benutzer installiert.\nWelche Installation möchten Sie entfernen?
|
||||
ru: Эта программа установлена для всего компьютера (для всех пользователей) и для отдельного пользователя.\nКакую из установленных программ ты хочешь удалить?
|
||||
ru: Эта программа установлена для всего компьютера (для всех пользователей) и для отдельного пользователя.\nКакую из установленных программ Вы хотите удалить?
|
||||
sk: Tento softvér je nainštalovaný pre Vás a súčasne pre všetkých uživateľov.\nKtorú inštaláciu si želáte odstraniť?
|
||||
cs: Tento software je nainstalovaný pro Vás a současně pro všechny uživatele.\nKterou instalaci si přejete odstranit?
|
||||
fr: Ce logiciel est installé à la fois par machine (tous les utilisateurs) et par utilisateur.\nQuelle installation veux-tu supprimer ?
|
||||
|
|
@ -134,7 +134,7 @@ whichInstallationRemove:
|
|||
freshInstallForAll:
|
||||
en: Fresh install for all users. (will prompt for admin credentials)
|
||||
de: Neuinstallation für alle Benutzer durchführen. (Administratorrechte benötigt)
|
||||
ru: Новая установка для всех пользователей. (потребуются права администратора)
|
||||
ru: Новая установка для всех пользователей. (Потребуются права администратора)
|
||||
sk: Nová inštalácia pre všetkých uživateľov. (Bude potrebovať prihlásenie administrátora)
|
||||
cs: Nová instalace pro všechny uživatele. (Bude vyžadovat přihlášení administrátora)
|
||||
fr: Nouvelle installation pour tous les utilisateurs. (demandera les identifiants administrateur)
|
||||
|
|
@ -221,7 +221,7 @@ forAll:
|
|||
loginWithAdminAccount:
|
||||
en: You need to login with an account that is a member of the admin group to continue...
|
||||
de: Um die Installation fortzusetzen müssen Sie sich mit einem Administrator-Account anmelden...
|
||||
ru: Чтобы продолжить, тебе нужно войти в учетную запись, которая входит в группу администраторов...
|
||||
ru: Чтобы продолжить, Вам необходимо войти в учетную запись, которая входит в группу администраторов...
|
||||
sk: Pre pokračovanie sa musíte zalogovať s účtom ktorý patrí do skupiny adminstrátorov...
|
||||
cs: Pro pokračování se musíte přihlásit účtem, který patří do skupiny administrátorů...
|
||||
fr: Tu dois te connecter avec un compte ayant des droits d'administrateur pour continuer...
|
||||
|
|
|
|||
37
electron/node_modules/app-builder-lib/templates/nsis/common.nsh
generated
vendored
37
electron/node_modules/app-builder-lib/templates/nsis/common.nsh
generated
vendored
|
|
@ -3,16 +3,47 @@
|
|||
|
||||
BrandingText "${PRODUCT_NAME} ${VERSION}"
|
||||
ShowInstDetails nevershow
|
||||
SpaceTexts none
|
||||
!ifdef BUILD_UNINSTALLER
|
||||
ShowUninstDetails nevershow
|
||||
!endif
|
||||
FileBufSize 64
|
||||
Name "${PRODUCT_NAME}"
|
||||
|
||||
# Allows for a product name to display properly if it has an ampersand
|
||||
# Doesn't affect anything if there is no double ampersand
|
||||
!searchreplace DoubleAmpersand "${PRODUCT_NAME}" "&" "&&"
|
||||
Name "${PRODUCT_NAME}" "${DoubleAmpersand}"
|
||||
|
||||
!define APP_EXECUTABLE_FILENAME "${PRODUCT_FILENAME}.exe"
|
||||
!define UNINSTALL_FILENAME "Uninstall ${PRODUCT_FILENAME}.exe"
|
||||
|
||||
!macro setSpaceRequired SECTION_ID
|
||||
!ifdef APP_64_UNPACKED_SIZE
|
||||
!ifdef APP_32_UNPACKED_SIZE
|
||||
!ifdef APP_ARM64_UNPACKED_SIZE
|
||||
${if} ${IsNativeARM64}
|
||||
SectionSetSize ${SECTION_ID} ${APP_ARM64_UNPACKED_SIZE}
|
||||
${elseif} ${IsNativeAMD64}
|
||||
SectionSetSize ${SECTION_ID} ${APP_64_UNPACKED_SIZE}
|
||||
${else}
|
||||
SectionSetSize ${SECTION_ID} ${APP_32_UNPACKED_SIZE}
|
||||
${endif}
|
||||
!else
|
||||
${if} ${RunningX64}
|
||||
SectionSetSize ${SECTION_ID} ${APP_64_UNPACKED_SIZE}
|
||||
${else}
|
||||
SectionSetSize ${SECTION_ID} ${APP_32_UNPACKED_SIZE}
|
||||
${endif}
|
||||
!endif
|
||||
!else
|
||||
SectionSetSize ${SECTION_ID} ${APP_64_UNPACKED_SIZE}
|
||||
!endif
|
||||
!else
|
||||
!ifdef APP_32_UNPACKED_SIZE
|
||||
SectionSetSize ${SECTION_ID} ${APP_32_UNPACKED_SIZE}
|
||||
!endif
|
||||
!endif
|
||||
!macroend
|
||||
|
||||
!macro check64BitAndSetRegView
|
||||
# https://github.com/electron-userland/electron-builder/issues/2420
|
||||
${If} ${IsWin2000}
|
||||
|
|
@ -107,7 +138,7 @@ Name "${PRODUCT_NAME}"
|
|||
LogSet ${SETTING}
|
||||
!endif
|
||||
!macroend
|
||||
|
||||
|
||||
!define LogText "!insertmacro LogTextMacroEB"
|
||||
!macro LogTextMacroEB INPUT_TEXT
|
||||
!ifdef ENABLE_LOGGING_ELECTRON_BUILDER
|
||||
|
|
|
|||
17
electron/node_modules/app-builder-lib/templates/nsis/include/FileAssociation.nsh
generated
vendored
17
electron/node_modules/app-builder-lib/templates/nsis/include/FileAssociation.nsh
generated
vendored
|
|
@ -63,11 +63,8 @@
|
|||
;
|
||||
|
||||
!macro APP_ASSOCIATE EXT FILECLASS DESCRIPTION ICON COMMANDTEXT COMMAND
|
||||
; Backup the previously associated file class
|
||||
ReadRegStr $R0 SHELL_CONTEXT "Software\Classes\.${EXT}" ""
|
||||
WriteRegStr SHELL_CONTEXT "Software\Classes\.${EXT}" "${FILECLASS}_backup" "$R0"
|
||||
|
||||
WriteRegStr SHELL_CONTEXT "Software\Classes\.${EXT}" "" "${FILECLASS}"
|
||||
WriteRegNone SHELL_CONTEXT "Software\Classes\.${EXT}\OpenWithProgids" "${FILECLASS}"
|
||||
|
||||
WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}" "" `${DESCRIPTION}`
|
||||
WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\DefaultIcon" "" `${ICON}`
|
||||
|
|
@ -77,11 +74,8 @@
|
|||
!macroend
|
||||
|
||||
!macro APP_ASSOCIATE_EX EXT FILECLASS DESCRIPTION ICON VERB DEFAULTVERB SHELLNEW COMMANDTEXT COMMAND
|
||||
; Backup the previously associated file class
|
||||
ReadRegStr $R0 SHELL_CONTEXT "Software\Classes\.${EXT}" ""
|
||||
WriteRegStr SHELL_CONTEXT "Software\Classes\.${EXT}" "${FILECLASS}_backup" "$R0"
|
||||
|
||||
WriteRegStr SHELL_CONTEXT "Software\Classes\.${EXT}" "" "${FILECLASS}"
|
||||
WriteRegNone SHELL_CONTEXT "Software\Classes\.${EXT}\OpenWithProgids" "${FILECLASS}"
|
||||
StrCmp "${SHELLNEW}" "0" +2
|
||||
WriteRegStr SHELL_CONTEXT "Software\Classes\.${EXT}\ShellNew" "NullFile" ""
|
||||
|
||||
|
|
@ -103,10 +97,7 @@
|
|||
|
||||
|
||||
!macro APP_UNASSOCIATE EXT FILECLASS
|
||||
; Backup the previously associated file class
|
||||
ReadRegStr $R0 SHELL_CONTEXT "Software\Classes\.${EXT}" `${FILECLASS}_backup`
|
||||
WriteRegStr SHELL_CONTEXT "Software\Classes\.${EXT}" "" "$R0"
|
||||
|
||||
DeleteRegValue SHELL_CONTEXT "Software\Classes\.${EXT}\OpenWithProgids" "${FILECLASS}"
|
||||
DeleteRegKey SHELL_CONTEXT `Software\Classes\${FILECLASS}`
|
||||
!macroend
|
||||
|
||||
|
|
@ -129,4 +120,4 @@
|
|||
; Using the system.dll plugin to call the SHChangeNotify Win32 API function so we
|
||||
; can update the shell.
|
||||
System::Call "shell32::SHChangeNotify(i,i,i,i) (${SHCNE_ASSOCCHANGED}, ${SHCNF_FLUSH}, 0, 0)"
|
||||
!macroend
|
||||
!macroend
|
||||
|
|
|
|||
|
|
@ -30,23 +30,78 @@
|
|||
!macroend
|
||||
|
||||
!macro CHECK_APP_RUNNING
|
||||
!ifmacrodef customCheckAppRunning
|
||||
!insertmacro customCheckAppRunning
|
||||
!else
|
||||
!insertmacro _CHECK_APP_RUNNING
|
||||
!endif
|
||||
!macroend
|
||||
|
||||
!macro FIND_PROCESS _FILE _ERR
|
||||
!ifdef INSTALL_MODE_PER_ALL_USERS
|
||||
${nsProcess::FindProcess} "${_FILE}" ${_ERR}
|
||||
Var /GLOBAL CmdPath
|
||||
Var /GLOBAL PowerShellPath
|
||||
StrCpy $CmdPath "$SYSDIR\cmd.exe"
|
||||
StrCpy $PowerShellPath "$SYSDIR\WindowsPowerShell\v1.0\powershell.exe"
|
||||
!ifmacrodef customCheckAppRunning
|
||||
!insertmacro customCheckAppRunning
|
||||
!else
|
||||
# find process owned by current user
|
||||
nsExec::Exec `cmd /c tasklist /FI "USERNAME eq %USERNAME%" /FI "IMAGENAME eq ${_FILE}" | %SYSTEMROOT%\System32\find.exe "${_FILE}"`
|
||||
Pop ${_ERR}
|
||||
!insertmacro IS_POWERSHELL_AVAILABLE
|
||||
!insertmacro _CHECK_APP_RUNNING
|
||||
!endif
|
||||
!macroend
|
||||
|
||||
!macro IS_POWERSHELL_AVAILABLE
|
||||
Var /GLOBAL IsPowerShellAvailable ; 0 = available, 1 = not available
|
||||
# Try running PowerShell with a simple command to check if it's available
|
||||
nsExec::Exec `"$PowerShellPath" -C "if (Get-Command Get-CimInstance -ErrorAction SilentlyContinue) { exit 0 } else { exit 1 }"`
|
||||
Pop $0 # Return code (0 = success, other = error)
|
||||
|
||||
${if} $0 == 0
|
||||
# PowerShell is available, check if it's not blocked by policies
|
||||
nsExec::Exec `"$PowerShellPath" -C "if ((Get-ExecutionPolicy -Scope Process) -eq 'Restricted') { exit 1 } else { exit 0 }"`
|
||||
Pop $0
|
||||
${endIf}
|
||||
|
||||
${if} $0 != 0
|
||||
StrCpy $0 1
|
||||
${endIf}
|
||||
|
||||
StrCpy $IsPowerShellAvailable $0
|
||||
!macroend
|
||||
|
||||
!macro FIND_PROCESS _FILE _RETURN
|
||||
${if} $IsPowerShellAvailable == 0
|
||||
nsExec::Exec `"$PowerShellPath" -C "if ((Get-CimInstance -ClassName Win32_Process | ? {$$_.Path -and $$_.Path.StartsWith('$INSTDIR', 'CurrentCultureIgnoreCase')}).Count -gt 0) { exit 0 } else { exit 1 }"`
|
||||
Pop ${_RETURN}
|
||||
${else}
|
||||
!ifdef INSTALL_MODE_PER_ALL_USERS
|
||||
# exact match via findstr anchored to the start of each CSV line
|
||||
nsExec::Exec `"$CmdPath" /C tasklist /FI "IMAGENAME eq ${_FILE}" /FO CSV /NH | "$SYSDIR\findstr.exe" /B /I /C:"\"${_FILE}\""`
|
||||
Pop ${_RETURN}
|
||||
!else
|
||||
# find process owned by current user — anchored exact match
|
||||
nsExec::Exec `"$CmdPath" /C tasklist /FI "USERNAME eq %USERNAME%" /FI "IMAGENAME eq ${_FILE}" /FO CSV /NH | "$SYSDIR\findstr.exe" /B /I /C:"\"${_FILE}\""`
|
||||
Pop ${_RETURN}
|
||||
!endif
|
||||
${endIf}
|
||||
!macroend
|
||||
|
||||
!macro KILL_PROCESS _FILE _FORCE
|
||||
Push $0
|
||||
${if} ${_FORCE} == 1
|
||||
${if} $IsPowerShellAvailable == 0
|
||||
StrCpy $0 "-Force"
|
||||
${else}
|
||||
StrCpy $0 "/F"
|
||||
${endIf}
|
||||
${else}
|
||||
StrCpy $0 ""
|
||||
${endIf}
|
||||
|
||||
${if} $IsPowerShellAvailable == 0
|
||||
nsExec::Exec `"$PowerShellPath" -C "Get-CimInstance -ClassName Win32_Process | ? {$$_.Path -and $$_.Path.StartsWith('$INSTDIR', 'CurrentCultureIgnoreCase')} | % { Stop-Process -Id $$_.ProcessId $0 }"`
|
||||
${else}
|
||||
!ifdef INSTALL_MODE_PER_ALL_USERS
|
||||
nsExec::Exec `taskkill /IM "${_FILE}" /FI "PID ne $pid"`
|
||||
!else
|
||||
nsExec::Exec `"$CmdPath" /C taskkill $0 /IM "${_FILE}" /FI "PID ne $pid" /FI "USERNAME eq %USERNAME%"`
|
||||
!endif
|
||||
${endIf}
|
||||
Pop $0
|
||||
!macroend
|
||||
|
||||
!macro _CHECK_APP_RUNNING
|
||||
${GetProcessInfo} 0 $pid $1 $2 $3 $4
|
||||
${if} $3 != "${APP_EXECUTABLE_FILENAME}"
|
||||
|
|
@ -67,14 +122,9 @@
|
|||
|
||||
doStopProcess:
|
||||
|
||||
DetailPrint `Closing running "${PRODUCT_NAME}"...`
|
||||
DetailPrint "$(appClosing)"
|
||||
|
||||
# https://github.com/electron-userland/electron-builder/issues/2516#issuecomment-372009092
|
||||
!ifdef INSTALL_MODE_PER_ALL_USERS
|
||||
nsExec::Exec `taskkill /im "${APP_EXECUTABLE_FILENAME}" /fi "PID ne $pid"`
|
||||
!else
|
||||
nsExec::Exec `cmd /c taskkill /im "${APP_EXECUTABLE_FILENAME}" /fi "PID ne $pid" /fi "USERNAME eq %USERNAME%"`
|
||||
!endif
|
||||
!insertmacro KILL_PROCESS "${APP_EXECUTABLE_FILENAME}" 0
|
||||
# to ensure that files are not "in-use"
|
||||
Sleep 300
|
||||
|
||||
|
|
@ -88,13 +138,9 @@
|
|||
${if} $R0 == 0
|
||||
# wait to give a chance to exit gracefully
|
||||
Sleep 1000
|
||||
!ifdef INSTALL_MODE_PER_ALL_USERS
|
||||
nsExec::Exec `taskkill /f /im "${APP_EXECUTABLE_FILENAME}" /fi "PID ne $pid"`
|
||||
!else
|
||||
nsExec::Exec `cmd /c taskkill /f /im "${APP_EXECUTABLE_FILENAME}" /fi "PID ne $pid" /fi "USERNAME eq %USERNAME%"`
|
||||
!endif
|
||||
!insertmacro KILL_PROCESS "${APP_EXECUTABLE_FILENAME}" 1 # 1 = force kill
|
||||
!insertmacro FIND_PROCESS "${APP_EXECUTABLE_FILENAME}" $R0
|
||||
${If} $R0 == 0
|
||||
${if} $R0 == 0
|
||||
DetailPrint `Waiting for "${PRODUCT_NAME}" to close.`
|
||||
Sleep 2000
|
||||
${else}
|
||||
|
|
|
|||
20
electron/node_modules/app-builder-lib/templates/nsis/include/installer.nsh
generated
vendored
20
electron/node_modules/app-builder-lib/templates/nsis/include/installer.nsh
generated
vendored
|
|
@ -133,6 +133,26 @@
|
|||
WriteRegStr SHELL_CONTEXT "${UNINSTALL_REGISTRY_KEY}" "Publisher" "${COMPANY_NAME}"
|
||||
!endif
|
||||
|
||||
!ifdef APP_DESCRIPTION
|
||||
WriteRegStr SHELL_CONTEXT "${UNINSTALL_REGISTRY_KEY}" "Comments" "${APP_DESCRIPTION}"
|
||||
!endif
|
||||
|
||||
!ifdef UNINSTALL_URL_HELP
|
||||
WriteRegStr SHELL_CONTEXT "${UNINSTALL_REGISTRY_KEY}" "HelpLink" "${UNINSTALL_URL_HELP}"
|
||||
!endif
|
||||
|
||||
!ifdef UNINSTALL_URL_INFO_ABOUT
|
||||
WriteRegStr SHELL_CONTEXT "${UNINSTALL_REGISTRY_KEY}" "URLInfoAbout" "${UNINSTALL_URL_INFO_ABOUT}"
|
||||
!endif
|
||||
|
||||
!ifdef UNINSTALL_URL_UPDATE_INFO
|
||||
WriteRegStr SHELL_CONTEXT "${UNINSTALL_REGISTRY_KEY}" "URLUpdateInfo" "${UNINSTALL_URL_UPDATE_INFO}"
|
||||
!endif
|
||||
|
||||
!ifdef UNINSTALL_URL_README
|
||||
WriteRegStr SHELL_CONTEXT "${UNINSTALL_REGISTRY_KEY}" "Readme" "${UNINSTALL_URL_README}"
|
||||
!endif
|
||||
|
||||
WriteRegDWORD SHELL_CONTEXT "${UNINSTALL_REGISTRY_KEY}" NoModify 1
|
||||
WriteRegDWORD SHELL_CONTEXT "${UNINSTALL_REGISTRY_KEY}" NoRepair 1
|
||||
|
||||
|
|
|
|||
5
electron/node_modules/app-builder-lib/templates/nsis/installSection.nsh
generated
vendored
5
electron/node_modules/app-builder-lib/templates/nsis/installSection.nsh
generated
vendored
|
|
@ -26,6 +26,9 @@ StrCpy $appExe "$INSTDIR\${APP_EXECUTABLE_FILENAME}"
|
|||
FindWindow $0 "#32770" "" $hwndparent $0
|
||||
GetDlgItem $0 $0 1000
|
||||
SendMessage $0 ${WM_SETTEXT} 0 "STR:$(installing)"
|
||||
|
||||
StrCpy $1 $hwndparent
|
||||
System::Call 'user32::ShutdownBlockReasonCreate(${SYSTYPE_PTR}r1, w "$(installing)")'
|
||||
${endif}
|
||||
!insertmacro CHECK_APP_RUNNING
|
||||
!else
|
||||
|
|
@ -104,4 +107,4 @@ ${endIf}
|
|||
${andIf} ${Silent}
|
||||
!insertmacro doStartApp
|
||||
${endIf}
|
||||
!endif
|
||||
!endif
|
||||
|
|
|
|||
15
electron/node_modules/app-builder-lib/templates/nsis/installer.nsi
generated
vendored
15
electron/node_modules/app-builder-lib/templates/nsis/installer.nsi
generated
vendored
|
|
@ -10,6 +10,13 @@ Var oldMenuDirectory
|
|||
!include "multiUser.nsh"
|
||||
!include "allowOnlyOneInstallerInstance.nsh"
|
||||
|
||||
!ifdef BUILD_UNINSTALLER
|
||||
!ifmacrodef customUnInstallSection
|
||||
!define MUI_COMPONENTSPAGE_NODESC
|
||||
!insertmacro MUI_UNPAGE_COMPONENTS
|
||||
!endif
|
||||
!endif
|
||||
|
||||
!ifdef INSTALL_MODE_PER_ALL_USERS
|
||||
!ifdef BUILD_UNINSTALLER
|
||||
RequestExecutionLevel user
|
||||
|
|
@ -40,6 +47,8 @@ Var oldMenuDirectory
|
|||
!endif
|
||||
|
||||
Function .onInit
|
||||
Call setInstallSectionSpaceRequired
|
||||
|
||||
SetOutPath $INSTDIR
|
||||
${LogSet} on
|
||||
|
||||
|
|
@ -82,7 +91,7 @@ FunctionEnd
|
|||
!include "installUtil.nsh"
|
||||
!endif
|
||||
|
||||
Section "install"
|
||||
Section "install" INSTALL_SECTION_ID
|
||||
!ifndef BUILD_UNINSTALLER
|
||||
# If we're running a silent upgrade of a per-machine installation, elevate so extracting the new app will succeed.
|
||||
# For a non-silent install, the elevation will be triggered when the install mode is selected in the UI,
|
||||
|
|
@ -114,6 +123,10 @@ Section "install"
|
|||
!endif
|
||||
SectionEnd
|
||||
|
||||
Function setInstallSectionSpaceRequired
|
||||
!insertmacro setSpaceRequired ${INSTALL_SECTION_ID}
|
||||
FunctionEnd
|
||||
|
||||
!ifdef BUILD_UNINSTALLER
|
||||
!include "uninstaller.nsh"
|
||||
!endif
|
||||
3
electron/node_modules/app-builder-lib/templates/nsis/messages.yml
generated
vendored
3
electron/node_modules/app-builder-lib/templates/nsis/messages.yml
generated
vendored
|
|
@ -235,3 +235,6 @@ uninstallFailed:
|
|||
sv: Det gick inte att avinstallera gamla programfiler. Försök att köra installationsprogrammet igen.
|
||||
uk: Не вдалось видалити старі файли застосунку. Будь ласка, спробуйте запустити встановлювач знов.
|
||||
zh_TW: 無法俺安裝舊的應用程式檔案。 請嘗試再次執行安裝程式。
|
||||
appClosing:
|
||||
en: "Closing running ${PRODUCT_NAME}..."
|
||||
cs: "Ukončuji aplikaci ${PRODUCT_NAME}..."
|
||||
|
|
|
|||
62
electron/node_modules/app-builder-lib/templates/nsis/multiUser.nsh
generated
vendored
62
electron/node_modules/app-builder-lib/templates/nsis/multiUser.nsh
generated
vendored
|
|
@ -28,20 +28,27 @@ Var installMode
|
|||
StrCpy $INSTDIR $perUserInstallationFolder
|
||||
${else}
|
||||
StrCpy $0 "$LocalAppData\Programs"
|
||||
System::Store S
|
||||
# Win7 has a per-user programfiles known folder and this can be a non-default location
|
||||
|
||||
Push $1
|
||||
Push $2
|
||||
# UserProgramFiles is the per-user install root and can be a non-default location
|
||||
StrCpy $2 0
|
||||
System::Call 'SHELL32::SHGetKnownFolderPath(g "${FOLDERID_UserProgramFiles}", i ${KF_FLAG_CREATE}, p 0, *p .r2)i.r1'
|
||||
${If} $1 == 0
|
||||
System::Call '*$2(&w${NSIS_MAX_STRLEN} .s)'
|
||||
StrCpy $0 $1
|
||||
System::Call 'KERNEL32::lstrcpynW(w .r0, p r2, i ${NSIS_MAX_STRLEN})p'
|
||||
${endif}
|
||||
# SHGetKnownFolderPath may return allocated memory even on failure
|
||||
${If} $2 != 0
|
||||
System::Call 'OLE32::CoTaskMemFree(p r2)'
|
||||
${endif}
|
||||
System::Store L
|
||||
Pop $2
|
||||
Pop $1
|
||||
|
||||
StrCpy $INSTDIR "$0\${APP_FILENAME}"
|
||||
${endif}
|
||||
|
||||
# allow /D switch to override installation path https://github.com/electron-userland/electron-builder/issues/1551
|
||||
${StdUtils.GetParameter} $R0 "D" ""
|
||||
!insertmacro GetDParameter $R0
|
||||
${If} $R0 != ""
|
||||
StrCpy $INSTDIR $R0
|
||||
${endif}
|
||||
|
|
@ -84,10 +91,51 @@ Var installMode
|
|||
${endif}
|
||||
|
||||
# allow /D switch to override installation path https://github.com/electron-userland/electron-builder/issues/1551
|
||||
${StdUtils.GetParameter} $R0 "D" ""
|
||||
!insertmacro GetDParameter $R0
|
||||
${If} $R0 != ""
|
||||
StrCpy $INSTDIR $R0
|
||||
${endif}
|
||||
|
||||
!macroend
|
||||
!endif
|
||||
|
||||
# Custom function to handle /D parameter with spaces
|
||||
# The /D parameter is special in NSIS - it must be the last parameter and cannot have quotes
|
||||
# Use StdUtils.GetParameter to get the full command line, then parse /D= manually
|
||||
!macro GetDParameter outVar
|
||||
Push $R8
|
||||
Push $R9
|
||||
Push $R7
|
||||
Push $R6
|
||||
Push $R5
|
||||
|
||||
# Get the complete command line using StdUtils (including /D parameter)
|
||||
${StdUtils.GetAllParameters} $R8 "0"
|
||||
|
||||
# Initialize result
|
||||
StrCpy $R9 ""
|
||||
|
||||
# Search for /D= or /d= using a simple loop
|
||||
StrLen $R7 $R8
|
||||
IntOp $R7 $R7 - 2 # Don't check last 2 characters
|
||||
StrCpy $R6 0
|
||||
|
||||
${Do}
|
||||
StrCpy $R5 $R8 3 $R6 # Get 3 characters starting at position $R6
|
||||
${If} $R5 == "/D="
|
||||
${OrIf} $R5 == "/d="
|
||||
# Found /D= or /d=, extract everything after it
|
||||
IntOp $R6 $R6 + 3
|
||||
StrCpy $R9 $R8 "" $R6
|
||||
${Break}
|
||||
${EndIf}
|
||||
IntOp $R6 $R6 + 1
|
||||
${LoopUntil} $R6 > $R7
|
||||
|
||||
StrCpy ${outVar} $R9
|
||||
Pop $R5
|
||||
Pop $R6
|
||||
Pop $R7
|
||||
Pop $R9
|
||||
Pop $R8
|
||||
!macroend
|
||||
30
electron/node_modules/app-builder-lib/templates/nsis/uninstaller.nsh
generated
vendored
30
electron/node_modules/app-builder-lib/templates/nsis/uninstaller.nsh
generated
vendored
|
|
@ -8,6 +8,13 @@ Function un.onInit
|
|||
|
||||
!insertmacro check64BitAndSetRegView
|
||||
|
||||
# Parse command line for /S flag and set silent mode
|
||||
${GetParameters} $R0
|
||||
${GetOptions} $R0 "/S" $R1
|
||||
${IfNot} ${Errors}
|
||||
SetSilent silent
|
||||
${EndIf}
|
||||
|
||||
${If} ${Silent}
|
||||
call un.checkAppRunning
|
||||
${else}
|
||||
|
|
@ -115,7 +122,7 @@ Function un.restoreFiles
|
|||
Goto continue
|
||||
|
||||
isNotDir:
|
||||
Rename $PLUGINSDIR\old-install$R0\$R2" "$INSTDIR$R0\$R2"
|
||||
Rename "$PLUGINSDIR\old-install$R0\$R2" "$INSTDIR$R0\$R2"
|
||||
|
||||
continue:
|
||||
FindNext $R1 $R2
|
||||
|
|
@ -131,7 +138,12 @@ Function un.restoreFiles
|
|||
Exch $R0
|
||||
FunctionEnd
|
||||
|
||||
Section "un.install"
|
||||
!ifndef UNINSTALL_SECTION_NAME
|
||||
!define UNINSTALL_SECTION_NAME "Uninstall"
|
||||
!endif
|
||||
|
||||
Section "un.${UNINSTALL_SECTION_NAME}"
|
||||
SectionIn RO
|
||||
# for assisted installer we check it here to show progress
|
||||
!ifndef ONE_CLICK
|
||||
${IfNot} ${Silent}
|
||||
|
|
@ -141,6 +153,10 @@ Section "un.install"
|
|||
|
||||
!insertmacro setLinkVars
|
||||
|
||||
!ifmacrodef customUnInstall
|
||||
!insertmacro customUnInstall
|
||||
!endif
|
||||
|
||||
# delete the installed files
|
||||
!ifmacrodef customRemoveFiles
|
||||
!insertmacro customRemoveFiles
|
||||
|
|
@ -165,6 +181,8 @@ Section "un.install"
|
|||
|
||||
${endif}
|
||||
|
||||
# Move out of $INSTDIR so it can be removed
|
||||
SetOutPath $TEMP
|
||||
# Remove all files (or remaining shallow directories from the block above)
|
||||
RMDir /r $INSTDIR
|
||||
!endif
|
||||
|
|
@ -235,11 +253,11 @@ Section "un.install"
|
|||
!endif
|
||||
DeleteRegKey SHELL_CONTEXT "${INSTALL_REGISTRY_KEY}"
|
||||
|
||||
!ifmacrodef customUnInstall
|
||||
!insertmacro customUnInstall
|
||||
!endif
|
||||
|
||||
!ifdef ONE_CLICK
|
||||
!insertmacro quitSuccess
|
||||
!endif
|
||||
SectionEnd
|
||||
|
||||
!ifmacrodef customUnInstallSection
|
||||
!insertmacro customUnInstallSection
|
||||
!endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue