Some checks failed
farmcontrol/farmcontrol-ui/pipeline/head There was a failure building this commit
- Added a new macro in `grant-users-access.nsh` to grant standard users read and execute access to the installation directory, enhancing accessibility for non-admin users. - Updated `installer.nsh` to include the new macro during installation, ensuring proper permissions are set. - Changed the output file from `deeplink.js` to `deeplink.exe` in the build process, improving the executable handling for the application. - Refactored the installer script to ensure the correct command is used for the farmcontrol URI handler, enhancing functionality. - Introduced a new script, `patch-windows-binaries.mjs`, to set the requested execution level for Windows binaries, improving security and compliance.
89 lines
2.4 KiB
NSIS
89 lines
2.4 KiB
NSIS
!include "MUI2.nsh"
|
|
!include "LogicLib.nsh"
|
|
!include "installer.nsh"
|
|
|
|
!ifndef OUTFILE
|
|
!define OUTFILE "farmcontrol-installer.exe"
|
|
!endif
|
|
|
|
!ifndef VERSION
|
|
!define VERSION "0.1.0"
|
|
!endif
|
|
|
|
!ifndef BUILD_NUMBER
|
|
!define BUILD_NUMBER "dev"
|
|
!endif
|
|
|
|
!ifndef APP_SOURCE_DIR
|
|
!define APP_SOURCE_DIR "app"
|
|
!endif
|
|
|
|
Name "Farm Control"
|
|
OutFile "${OUTFILE}"
|
|
InstallDir "$PROGRAMFILES64\Farm Control"
|
|
InstallDirRegKey HKLM "Software\Tom Butcher\Farm Control" "InstallDir"
|
|
RequestExecutionLevel admin
|
|
|
|
!define MUI_ABORTWARNING
|
|
|
|
!ifndef INSTALLER_ICON
|
|
!define INSTALLER_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
|
|
!endif
|
|
|
|
!define MUI_ICON "${INSTALLER_ICON}"
|
|
!define MUI_UNICON "${INSTALLER_ICON}"
|
|
|
|
Icon "${INSTALLER_ICON}"
|
|
UninstallIcon "${INSTALLER_ICON}"
|
|
|
|
BrandingText "Farm Control v${VERSION}-b${BUILD_NUMBER} Installer"
|
|
|
|
!insertmacro MUI_PAGE_DIRECTORY
|
|
!insertmacro MUI_PAGE_INSTFILES
|
|
!insertmacro MUI_UNPAGE_CONFIRM
|
|
!insertmacro MUI_UNPAGE_INSTFILES
|
|
!insertmacro MUI_LANGUAGE "English"
|
|
|
|
Function .onInit
|
|
${If} ${Silent}
|
|
SetAutoClose true
|
|
${EndIf}
|
|
!insertmacro uninstallPreviousFarmControl
|
|
FunctionEnd
|
|
|
|
Section "Farm Control" SecMain
|
|
SectionIn RO
|
|
SetOutPath $INSTDIR
|
|
File /r "${APP_SOURCE_DIR}\*.*"
|
|
|
|
!insertmacro customInstall
|
|
|
|
WriteRegStr HKLM "Software\Tom Butcher\Farm Control" "InstallDir" $INSTDIR
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Farm Control" \
|
|
"DisplayName" "Farm Control"
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Farm Control" \
|
|
"DisplayVersion" "${VERSION}"
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Farm Control" \
|
|
"Publisher" "Tom Butcher"
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Farm Control" \
|
|
"UninstallString" "$INSTDIR\Uninstall.exe"
|
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Farm Control" \
|
|
"NoModify" 1
|
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Farm Control" \
|
|
"NoRepair" 1
|
|
|
|
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
|
|
|
!insertmacro grantUsersInstallAccess
|
|
SectionEnd
|
|
|
|
Section "Uninstall"
|
|
!insertmacro customUnInstall
|
|
|
|
Delete "$INSTDIR\Uninstall.exe"
|
|
RMDir /r "$INSTDIR"
|
|
|
|
DeleteRegKey HKLM "Software\Tom Butcher\Farm Control"
|
|
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Farm Control"
|
|
SectionEnd
|