6698f9fbda
leo 08-06 Windows 回報:「一直在『看守中』和『沒有在跑』中間閃,要我重啟但重啟無效, 我覺得它在跑個迴圈不停重複」+「加一個資料夾明顯沒產生看守資料夾」。 朋友的一般 PC(非 ARM)也一樣,停在等待中 ⇒ **不是 ARM 模擬的問題,是 Windows 通用**。 ## 已定位的機制(不是根因,是「為什麼查不出根因」) 閃爍=子行程一啟動就死 → supervisor 退避重拉 → 狀態在 Starting(alive=true)與 Error(false)之間彈跳 ⇒ 畫面跟著閃。而**死因一直被記在 Status().LastError 裡, 從來沒有上過畫面、也沒寫進 app.log** ⇒ 使用者只看到閃爍與「請重新開啟」, 重開當然無效(死因沒變)。這是「安靜地略過」的同一種病換地方發作。 ## 這版做的 - 死因上畫面:重試 >= 3 次改顯示「同步引擎一直啟動失敗,已自動重試 N 次|原因:…」, 且**黏住不閃**(不受重起過程中的 Starting 影響) - 每次異常結束寫進 app.log(同錯誤 10 次內只記一次,避免洗爆) ## 排除掉的嫌疑(查過,不是) - PDF 引擎(pdfium/wasm):**延遲初始化**,第一次讀 PDF 才啟動 ⇒ 不會在啟動時炸 - ARM 模擬:leo 朋友的一般 x64 PC 同樣症狀 - 待查嫌疑:Wails 的 Windows 版是 `-H windowsgui`(GUI subsystem,無主控台), 而 v0.18.8 的 collector.exe 是 `go build` 的 console subsystem—— v0.18.9 合併成單一 binary 後,子行程換成 GUI subsystem 的自己。**尚未證實。** ## 順帶修好自己的閘(它擋對了我) 指紋閘擋下「v0.18.10 已對應另一份原始碼」——因為第一次打包失敗、版號卻已被戳。 ⇒ 加判準:**磁碟上沒有該版號產物=從未出貨,允許重戳**(不用去手改 JSON, 那種爛示範遲早被改成「都放行」)。 ## 安裝程式(leo ③)尚未兌現,誠實記錄 `wails build -nsis` 需要 makensis;Homebrew 的 3.12 在這台 macOS **連兩行的最小腳本 都在寫檔階段丟 std::bad_alloc**,zlib/bzip2/lzma 三壓縮器全崩,brew extract 舊版 被 homebrew/core 擋。且帶 -nsis 會讓 wails 整個中止、連 exe 都不產 ⇒ build-win.sh 改成**先煙霧測試 makensis**,壞的就只出裸 exe 並大聲警告。
272 lines
9.0 KiB
NSIS
272 lines
9.0 KiB
NSIS
# DO NOT EDIT - Generated automatically by `wails build`
|
|
|
|
!include "x64.nsh"
|
|
!include "WinVer.nsh"
|
|
!include "FileFunc.nsh"
|
|
|
|
!ifndef INFO_PROJECTNAME
|
|
!define INFO_PROJECTNAME "arcrun-app"
|
|
!endif
|
|
!ifndef INFO_COMPANYNAME
|
|
!define INFO_COMPANYNAME "arcrun-app"
|
|
!endif
|
|
!ifndef INFO_PRODUCTNAME
|
|
!define INFO_PRODUCTNAME "Arcrun"
|
|
!endif
|
|
!ifndef INFO_PRODUCTVERSION
|
|
!define INFO_PRODUCTVERSION "0.18.10"
|
|
!endif
|
|
!ifndef INFO_COPYRIGHT
|
|
!define INFO_COPYRIGHT "Copyright........."
|
|
!endif
|
|
!ifndef PRODUCT_EXECUTABLE
|
|
!define PRODUCT_EXECUTABLE "${INFO_PROJECTNAME}.exe"
|
|
!endif
|
|
!ifndef UNINST_KEY_NAME
|
|
!define UNINST_KEY_NAME "${INFO_COMPANYNAME}${INFO_PRODUCTNAME}"
|
|
!endif
|
|
!define UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${UNINST_KEY_NAME}"
|
|
|
|
!ifndef REQUEST_EXECUTION_LEVEL
|
|
!define REQUEST_EXECUTION_LEVEL "admin"
|
|
!endif
|
|
|
|
RequestExecutionLevel "${REQUEST_EXECUTION_LEVEL}"
|
|
|
|
!ifdef ARG_WAILS_AMD64_BINARY
|
|
!define SUPPORTS_AMD64
|
|
!endif
|
|
|
|
!ifdef ARG_WAILS_ARM64_BINARY
|
|
!define SUPPORTS_ARM64
|
|
!endif
|
|
|
|
!ifdef SUPPORTS_AMD64
|
|
!ifdef SUPPORTS_ARM64
|
|
!define ARCH "amd64_arm64"
|
|
!else
|
|
!define ARCH "amd64"
|
|
!endif
|
|
!else
|
|
!ifdef SUPPORTS_ARM64
|
|
!define ARCH "arm64"
|
|
!else
|
|
!error "Wails: Undefined ARCH, please provide at least one of ARG_WAILS_AMD64_BINARY or ARG_WAILS_ARM64_BINARY"
|
|
!endif
|
|
!endif
|
|
|
|
!macro wails.checkArchitecture
|
|
!ifndef WAILS_WIN10_REQUIRED
|
|
!define WAILS_WIN10_REQUIRED "This product is only supported on Windows 10 (Server 2016) and later."
|
|
!endif
|
|
|
|
!ifndef WAILS_ARCHITECTURE_NOT_SUPPORTED
|
|
!define WAILS_ARCHITECTURE_NOT_SUPPORTED "This product can't be installed on the current Windows architecture. Supports: ${ARCH}"
|
|
!endif
|
|
|
|
${If} ${AtLeastWin10}
|
|
!ifdef SUPPORTS_AMD64
|
|
${if} ${IsNativeAMD64}
|
|
Goto ok
|
|
${EndIf}
|
|
!endif
|
|
|
|
!ifdef SUPPORTS_ARM64
|
|
${if} ${IsNativeARM64}
|
|
Goto ok
|
|
${EndIf}
|
|
!endif
|
|
|
|
IfSilent silentArch notSilentArch
|
|
silentArch:
|
|
SetErrorLevel 65
|
|
Abort
|
|
notSilentArch:
|
|
MessageBox MB_OK "${WAILS_ARCHITECTURE_NOT_SUPPORTED}"
|
|
Quit
|
|
${else}
|
|
IfSilent silentWin notSilentWin
|
|
silentWin:
|
|
SetErrorLevel 64
|
|
Abort
|
|
notSilentWin:
|
|
MessageBox MB_OK "${WAILS_WIN10_REQUIRED}"
|
|
Quit
|
|
${EndIf}
|
|
|
|
ok:
|
|
!macroend
|
|
|
|
!macro wails.files
|
|
!ifdef SUPPORTS_AMD64
|
|
${if} ${IsNativeAMD64}
|
|
File "/oname=${PRODUCT_EXECUTABLE}" "${ARG_WAILS_AMD64_BINARY}"
|
|
${EndIf}
|
|
!endif
|
|
|
|
!ifdef SUPPORTS_ARM64
|
|
${if} ${IsNativeARM64}
|
|
File "/oname=${PRODUCT_EXECUTABLE}" "${ARG_WAILS_ARM64_BINARY}"
|
|
${EndIf}
|
|
!endif
|
|
!macroend
|
|
|
|
!macro wails.writeUninstaller
|
|
WriteUninstaller "$INSTDIR\uninstall.exe"
|
|
|
|
SetRegView 64
|
|
!ifdef WAILS_INSTALL_SCOPE
|
|
!if "${WAILS_INSTALL_SCOPE}" == "user"
|
|
WriteRegStr HKCU "${UNINST_KEY}" "Publisher" "${INFO_COMPANYNAME}"
|
|
WriteRegStr HKCU "${UNINST_KEY}" "DisplayName" "${INFO_PRODUCTNAME}"
|
|
WriteRegStr HKCU "${UNINST_KEY}" "DisplayVersion" "${INFO_PRODUCTVERSION}"
|
|
WriteRegStr HKCU "${UNINST_KEY}" "DisplayIcon" "$INSTDIR\${PRODUCT_EXECUTABLE}"
|
|
WriteRegStr HKCU "${UNINST_KEY}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
|
|
WriteRegStr HKCU "${UNINST_KEY}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
|
|
!else
|
|
WriteRegStr HKLM "${UNINST_KEY}" "Publisher" "${INFO_COMPANYNAME}"
|
|
WriteRegStr HKLM "${UNINST_KEY}" "DisplayName" "${INFO_PRODUCTNAME}"
|
|
WriteRegStr HKLM "${UNINST_KEY}" "DisplayVersion" "${INFO_PRODUCTVERSION}"
|
|
WriteRegStr HKLM "${UNINST_KEY}" "DisplayIcon" "$INSTDIR\${PRODUCT_EXECUTABLE}"
|
|
WriteRegStr HKLM "${UNINST_KEY}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
|
|
WriteRegStr HKLM "${UNINST_KEY}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
|
|
!endif
|
|
!else
|
|
WriteRegStr HKLM "${UNINST_KEY}" "Publisher" "${INFO_COMPANYNAME}"
|
|
WriteRegStr HKLM "${UNINST_KEY}" "DisplayName" "${INFO_PRODUCTNAME}"
|
|
WriteRegStr HKLM "${UNINST_KEY}" "DisplayVersion" "${INFO_PRODUCTVERSION}"
|
|
WriteRegStr HKLM "${UNINST_KEY}" "DisplayIcon" "$INSTDIR\${PRODUCT_EXECUTABLE}"
|
|
WriteRegStr HKLM "${UNINST_KEY}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
|
|
WriteRegStr HKLM "${UNINST_KEY}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
|
|
!endif
|
|
|
|
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
|
|
IntFmt $0 "0x%08X" $0
|
|
|
|
!ifdef WAILS_INSTALL_SCOPE
|
|
!if "${WAILS_INSTALL_SCOPE}" == "user"
|
|
WriteRegDWORD HKCU "${UNINST_KEY}" "EstimatedSize" "$0"
|
|
!else
|
|
WriteRegDWORD HKLM "${UNINST_KEY}" "EstimatedSize" "$0"
|
|
!endif
|
|
!else
|
|
WriteRegDWORD HKLM "${UNINST_KEY}" "EstimatedSize" "$0"
|
|
!endif
|
|
!macroend
|
|
|
|
!macro wails.deleteUninstaller
|
|
Delete "$INSTDIR\uninstall.exe"
|
|
|
|
SetRegView 64
|
|
|
|
!ifdef WAILS_INSTALL_SCOPE
|
|
!if "${WAILS_INSTALL_SCOPE}" == "user"
|
|
DeleteRegKey HKCU "${UNINST_KEY}"
|
|
!else
|
|
DeleteRegKey HKLM "${UNINST_KEY}"
|
|
!endif
|
|
!else
|
|
DeleteRegKey HKLM "${UNINST_KEY}"
|
|
!endif
|
|
!macroend
|
|
|
|
!macro wails.setShellContext
|
|
${If} ${REQUEST_EXECUTION_LEVEL} == "admin"
|
|
SetShellVarContext all
|
|
${else}
|
|
SetShellVarContext current
|
|
${EndIf}
|
|
!macroend
|
|
|
|
# Install webview2 by launching the bootstrapper
|
|
# See https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#online-only-deployment
|
|
!macro wails.webview2runtime
|
|
!ifndef WAILS_INSTALL_WEBVIEW_DETAILPRINT
|
|
!define WAILS_INSTALL_WEBVIEW_DETAILPRINT "Installing: WebView2 Runtime"
|
|
!endif
|
|
|
|
SetRegView 64
|
|
# If the admin key exists and is not empty then webview2 is already installed
|
|
ReadRegStr $0 HKLM "SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" "pv"
|
|
${If} $0 != ""
|
|
Goto ok
|
|
${EndIf}
|
|
|
|
${If} ${REQUEST_EXECUTION_LEVEL} == "user"
|
|
# If the installer is run in user level, check the user specific key exists and is not empty then webview2 is already installed
|
|
ReadRegStr $0 HKCU "Software\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" "pv"
|
|
${If} $0 != ""
|
|
Goto ok
|
|
${EndIf}
|
|
${EndIf}
|
|
|
|
SetDetailsPrint both
|
|
DetailPrint "${WAILS_INSTALL_WEBVIEW_DETAILPRINT}"
|
|
SetDetailsPrint listonly
|
|
|
|
InitPluginsDir
|
|
CreateDirectory "$pluginsdir\webview2bootstrapper"
|
|
SetOutPath "$pluginsdir\webview2bootstrapper"
|
|
File "tmp\MicrosoftEdgeWebview2Setup.exe"
|
|
ExecWait '"$pluginsdir\webview2bootstrapper\MicrosoftEdgeWebview2Setup.exe" /silent /install'
|
|
|
|
SetDetailsPrint both
|
|
ok:
|
|
!macroend
|
|
|
|
# Copy of APP_ASSOCIATE and APP_UNASSOCIATE macros from here https://gist.github.com/nikku/281d0ef126dbc215dd58bfd5b3a5cd5b
|
|
!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}"
|
|
|
|
WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}" "" `${DESCRIPTION}`
|
|
WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\DefaultIcon" "" `${ICON}`
|
|
WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\shell" "" "open"
|
|
WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\shell\open" "" `${COMMANDTEXT}`
|
|
WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\shell\open\command" "" `${COMMAND}`
|
|
!macroend
|
|
|
|
!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"
|
|
|
|
DeleteRegKey SHELL_CONTEXT `Software\Classes\${FILECLASS}`
|
|
!macroend
|
|
|
|
!macro wails.associateFiles
|
|
; Create file associations
|
|
|
|
!macroend
|
|
|
|
!macro wails.unassociateFiles
|
|
; Delete app associations
|
|
|
|
!macroend
|
|
|
|
!macro CUSTOM_PROTOCOL_ASSOCIATE PROTOCOL DESCRIPTION ICON COMMAND
|
|
DeleteRegKey SHELL_CONTEXT "Software\Classes\${PROTOCOL}"
|
|
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}" "" "${DESCRIPTION}"
|
|
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}" "URL Protocol" ""
|
|
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\DefaultIcon" "" "${ICON}"
|
|
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\shell" "" ""
|
|
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\shell\open" "" ""
|
|
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\shell\open\command" "" "${COMMAND}"
|
|
!macroend
|
|
|
|
!macro CUSTOM_PROTOCOL_UNASSOCIATE PROTOCOL
|
|
DeleteRegKey SHELL_CONTEXT "Software\Classes\${PROTOCOL}"
|
|
!macroend
|
|
|
|
!macro wails.associateCustomProtocols
|
|
; Create custom protocols associations
|
|
|
|
!macroend
|
|
|
|
!macro wails.unassociateCustomProtocols
|
|
; Delete app custom protocol associations
|
|
|
|
!macroend
|