Phase 1 of plan 009. The app still builds and runs on v2 — nothing in main.go or backend/ has moved yet — but the v3 CLI, its pinned runtime and its build-asset tree are now present, which is what Phase 2 needs. - wails/v3 v3.0.0-beta.8 pinned per D5, and wails3 added to the `tool` block beside the v2 CLI per D3. Both are vendored; neither is a global install. - build/ now holds the v3 build assets, copied wholesale from a `wails3 init` scaffold rather than hand-written. That collides with this repo's existing use of build/ as ignored build *output*, so .gitignore narrows to build/bin/ and bin/ and the assets are tracked. The mobile platforms are not carried: this is a desktop player (MPRIS over D-Bus, beep, XDG paths) and cannot target them. - build/config.yml's info block is filled from wails.json, which stays for now because the v2 CLI still reads it. - Taskfile.yml defaults PACKAGE_MANAGER to pnpm, since the scaffold assumes npm and frontend/package.json.md5 is part of the dep-caching scheme. One deviation from the plan worth recording. webkitgtk-6.0 is not installed on this machine, so the default GTK4 path is unavailable and the gtk3 fallback is in use. That also means `go tool wails3` does not work — the CLI itself fails to compile without webkitgtk-6.0 — while `go run -tags gtk3 .../cmd/wails3` does. The Makefile rewrite in the next commit has to account for that, and it goes away once the GTK4 dependency is installed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UDCbcCZQepnpSQYJ6SxxZm
261 lines
8.4 KiB
NSIS
261 lines
8.4 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 "yjref"
|
|
!endif
|
|
!ifndef INFO_COMPANYNAME
|
|
!define INFO_COMPANYNAME "My Company"
|
|
!endif
|
|
!ifndef INFO_PRODUCTNAME
|
|
!define INFO_PRODUCTNAME "My Product"
|
|
!endif
|
|
!ifndef INFO_PRODUCTVERSION
|
|
!define INFO_PRODUCTVERSION "0.1.0"
|
|
!endif
|
|
!ifndef INFO_COPYRIGHT
|
|
!define INFO_COPYRIGHT "© 2026, My Company"
|
|
!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 WAILS_INSTALL_SCOPE
|
|
!define WAILS_INSTALL_SCOPE "machine"
|
|
!endif
|
|
|
|
!ifndef REQUEST_EXECUTION_LEVEL
|
|
!if "${WAILS_INSTALL_SCOPE}" == "user"
|
|
!define REQUEST_EXECUTION_LEVEL "user"
|
|
!else
|
|
!define REQUEST_EXECUTION_LEVEL "admin"
|
|
!endif
|
|
!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
|
|
!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"
|
|
|
|
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
|
|
IntFmt $0 "0x%08X" $0
|
|
WriteRegDWORD HKCU "${UNINST_KEY}" "EstimatedSize" "$0"
|
|
!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"
|
|
|
|
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
|
|
IntFmt $0 "0x%08X" $0
|
|
WriteRegDWORD HKLM "${UNINST_KEY}" "EstimatedSize" "$0"
|
|
!endif
|
|
!macroend
|
|
|
|
!macro wails.deleteUninstaller
|
|
Delete "$INSTDIR\uninstall.exe"
|
|
|
|
SetRegView 64
|
|
!if "${WAILS_INSTALL_SCOPE}" == "user"
|
|
DeleteRegKey HKCU "${UNINST_KEY}"
|
|
!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 "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 |