mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-09 17:19:59 +00:00
Add Windows installer script
This commit is contained in:
42
app/packaging/win/installer.nsi
Normal file
42
app/packaging/win/installer.nsi
Normal file
@@ -0,0 +1,42 @@
|
||||
!include LogicLib.nsh
|
||||
|
||||
!define MANIFEST_KEY "Software\Mozilla\NativeMessagingHosts\{{manifestName}}"
|
||||
!define UNINSTALL_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\{{winRegistryKey}}"
|
||||
|
||||
Name "{{applicationName}} v{{applicationVersion}}"
|
||||
OutFile "{{outFile}}"
|
||||
InstallDir "{{executablePath}}"
|
||||
RequestExecutionLevel user
|
||||
|
||||
Section
|
||||
SetRegView 64
|
||||
|
||||
SetOutPath $INSTDIR
|
||||
|
||||
# Main executable
|
||||
File "{{executableName}}"
|
||||
File "{{manifestName}}"
|
||||
|
||||
# Native manifest key
|
||||
WriteRegStr HKLM "${MANIFEST_KEY}" "" "$INSTDIR\{{manifestName}}"
|
||||
|
||||
# Create and register uninstaller
|
||||
WriteUninstaller "$INSTDIR\uninstall.exe"
|
||||
WriteRegStr HKLM "${UNINSTALL_KEY}" "DisplayName" "{{applicationName}}"
|
||||
WriteRegStr HKLM "${UNINSTALL_KEY}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
|
||||
WriteRegStr HKLM "${UNINSTALL_KEY}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
|
||||
SectionEnd
|
||||
|
||||
Section "uninstall"
|
||||
SetRegView 64
|
||||
|
||||
# Remove uninstaller
|
||||
Delete "$INSTDIR\uninstall.exe"
|
||||
DeleteRegKey HKLM "${UNINSTALL_KEY}"
|
||||
|
||||
# Remove manifest and executable dir
|
||||
DeleteRegKey HKLM "${MANIFEST_KEY}"
|
||||
Delete "$INSTDIR\{{executableName}}"
|
||||
Delete "$INSTDIR\{{manifestName}}"
|
||||
RMDir $INSTDIR
|
||||
SectionEnd
|
||||
Reference in New Issue
Block a user