diff --git a/out/node-module-collector/pnpmNodeModulesCollector.js b/out/node-module-collector/pnpmNodeModulesCollector.js index e52d98fbc0d9d7fdd72a156823fca2bbc9b393fd..34c02fcfd6f81f84f49c90219425814ee3026bcd 100644 --- a/out/node-module-collector/pnpmNodeModulesCollector.js +++ b/out/node-module-collector/pnpmNodeModulesCollector.js @@ -25,17 +25,32 @@ class PnpmNodeModulesCollector extends nodeModulesCollector_1.NodeModulesCollect extractProductionDependencyTree(tree) { const p = path.normalize(this.resolvePath(tree.path)); const packageJson = require(path.join(p, "package.json")); - const prodDependencies = { ...(packageJson.dependencies || {}), ...(packageJson.optionalDependencies || {}) }; const deps = { ...(tree.dependencies || {}), ...(tree.optionalDependencies || {}) }; const dependencies = Object.entries(deps).reduce((acc, curr) => { + var _b, _c; const [packageName, dependency] = curr; - if (!prodDependencies[packageName]) { + let isOptional; + if ((_b = packageJson.dependencies) === null || _b === void 0 ? void 0 : _b[packageName]) { + isOptional = false; + } + else if ((_c = packageJson.optionalDependencies) === null || _c === void 0 ? void 0 : _c[packageName]) { + isOptional = true; + } + else { return acc; } - return { - ...acc, - [packageName]: this.extractProductionDependencyTree(dependency), - }; + try { + return { + ...acc, + [packageName]: this.extractProductionDependencyTree(dependency), + }; + } + catch (error) { + if (isOptional) { + return acc; + } + throw error; + } }, {}); const { name, version, path: packagePath, workspaces } = tree; const depTree = { diff --git a/templates/nsis/include/installer.nsh b/templates/nsis/include/installer.nsh index 34e91dfe82fdbb2e929820f2e8deb771b7f7893c..73bfffc6c227a018cbbeb690d6d7b882ed142fc8 100644 --- a/templates/nsis/include/installer.nsh +++ b/templates/nsis/include/installer.nsh @@ -90,7 +90,13 @@ ${if} $installMode == "all" SetShellVarContext current ${endif} - !insertmacro copyFile "$EXEPATH" "$LOCALAPPDATA\${APP_INSTALLER_STORE_FILE}" + # SIGNAL CHANGE START + # This file is needed for electron-builder's native incremental updates, + # but we have our own system so no need to place it. Clean it up instead. + # + # !insertmacro copyFile "$EXEPATH" "$LOCALAPPDATA\${APP_INSTALLER_STORE_FILE}" + RMDir /r /REBOOTOK "$LOCALAPPDATA\signal-desktop-updater" + # SIGNAL CHANGE END ${if} $installMode == "all" SetShellVarContext all ${endif} diff --git a/templates/nsis/installSection.nsh b/templates/nsis/installSection.nsh index 053772f55ca6ece52f0a34c4fa0f05c9a5f07bd2..a58ea8c19116f8ec3fb7515ec4104282f635ecc8 100644 --- a/templates/nsis/installSection.nsh +++ b/templates/nsis/installSection.nsh @@ -22,11 +22,37 @@ StrCpy $appExe "$INSTDIR\${APP_EXECUTABLE_FILENAME}" SpiderBanner::Show /MODERN !endif + # Set text (1000 is the id of text element of SpiderBanner) FindWindow $0 "#32770" "" $hwndparent FindWindow $0 "#32770" "" $hwndparent $0 - GetDlgItem $0 $0 1000 - SendMessage $0 ${WM_SETTEXT} 0 "STR:$(installing)" + GetDlgItem $1 $0 1000 + SendMessage $1 ${WM_SETTEXT} 0 "STR:$(installing)" + + # Set header image compatible with "ManifestDPIAware" mode. + !ifdef HEADER_ICO + # Convert 24 Dialog Units to pixels: + # See https://github.com/mozilla/gecko-dev/blob/8de0e699002872d969aebf1bc8407e5c839a4472/toolkit/mozapps/installer/windows/nsis/common.nsh#L8801 + + # rect = LPRect { .left = 0, .top = 0, .right = 24, .bottom = 0 } + # See https://nsis.sourceforge.io/Docs/System/System.html#faq + System::Call "*(i 0, i 0, i 24, i 0) p.r1" + + # Call `MapDialogRect(window, &rect)` + System::Call `user32::MapDialogRect(p $0, p r1)` + + # rect.right now contains the converted value (24du => ?px). + # Place `rect.right` into `r2` + System::Call "*$1(i, i, i.r2, i)" + System::Free $1 + + # Load image and pass `r2` as both width and height, get the image handle + # back to `r2` register. + System::Call `user32::LoadImage(i 0, t "$PLUGINSDIR\installerHeaderico.ico", i ${IMAGE_ICON}, i r2, i r2, i ${LR_LOADFROMFILE}) i.r2` + # 1025 is the id of the icon of SpiderBanner. + GetDlgItem $1 $0 1025 + SendMessage $1 ${STM_SETIMAGE} ${IMAGE_ICON} $2 + !endif StrCpy $1 $hwndparent System::Call 'user32::ShutdownBlockReasonCreate(${SYSTYPE_PTR}r1, w "$(installing)")' ${endif}