Product-Full File components; HelperVersion 0.3.6 defaults; no Authenticode claim.
148 lines
5 KiB
NSIS
148 lines
5 KiB
NSIS
; Verae Print Stamp — Windows GUI installer (NSIS 3)
|
|
; Build via platform/windows/build-installer.sh
|
|
|
|
; VERSION: prefer -DVERSION= from build-installer.sh (HelperVersion). Bare
|
|
; makensis fallback must match internal/job.HelperVersion.
|
|
!ifndef VERSION
|
|
!define VERSION "0.3.6"
|
|
!endif
|
|
!ifndef ARCH
|
|
!define ARCH "amd64"
|
|
!endif
|
|
!ifndef SRCDIR
|
|
!define SRCDIR "."
|
|
!endif
|
|
|
|
!define PRODUCT_NAME "Verae Print Stamp"
|
|
!define PRODUCT_PUBLISHER "Verae"
|
|
!define PRODUCT_URL "https://printit.verae.ai/"
|
|
!define PORTAL_URL "https://customer.verae.ai/portal/"
|
|
|
|
Name "${PRODUCT_NAME} ${VERSION}"
|
|
OutFile "VeraePrintStamp-windows-${ARCH}-${VERSION}-setup.exe"
|
|
InstallDir "$LOCALAPPDATA\Verae\PrintStamp"
|
|
InstallDirRegKey HKCU "Software\Verae\PrintStamp" "InstallDir"
|
|
RequestExecutionLevel user
|
|
Unicode true
|
|
SetCompressor /SOLID lzma
|
|
ShowInstDetails show
|
|
|
|
!include "MUI2.nsh"
|
|
!include "WinMessages.nsh"
|
|
|
|
!define MUI_ABORTWARNING
|
|
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
|
|
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
|
|
|
|
!define MUI_WELCOMEPAGE_TITLE "${PRODUCT_NAME}"
|
|
!define MUI_WELCOMEPAGE_TEXT "Setup will install Verae Print Stamp on your computer.$\r$\n$\r$\nDigests-only timestamping: document bytes stay on this PC.$\r$\n$\r$\nClick Next to continue."
|
|
|
|
!define MUI_FINISHPAGE_RUN "$INSTDIR\bin\verae-print.exe"
|
|
!define MUI_FINISHPAGE_RUN_PARAMETERS "setup"
|
|
!define MUI_FINISHPAGE_RUN_TEXT "Run setup now (create account / paste xVerae- key)"
|
|
!define MUI_FINISHPAGE_LINK "Open ${PORTAL_URL}"
|
|
!define MUI_FINISHPAGE_LINK_LOCATION "${PORTAL_URL}"
|
|
|
|
Var StartMenuFolder
|
|
|
|
!insertmacro MUI_PAGE_WELCOME
|
|
!insertmacro MUI_PAGE_LICENSE "${SRCDIR}\LICENSE.txt"
|
|
!insertmacro MUI_PAGE_DIRECTORY
|
|
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
|
|
!insertmacro MUI_PAGE_INSTFILES
|
|
!insertmacro MUI_PAGE_FINISH
|
|
|
|
!insertmacro MUI_UNPAGE_CONFIRM
|
|
!insertmacro MUI_UNPAGE_INSTFILES
|
|
|
|
!insertmacro MUI_LANGUAGE "English"
|
|
|
|
Section "Verae Print Stamp (required)" SecMain
|
|
SectionIn RO
|
|
SetOutPath "$INSTDIR\bin"
|
|
File "${SRCDIR}\verae-print.exe"
|
|
SetOutPath "$INSTDIR"
|
|
File "${SRCDIR}\README.txt"
|
|
File "${SRCDIR}\LICENSE.txt"
|
|
|
|
; Append install bin dir to user PATH if missing
|
|
ReadRegStr $0 HKCU "Environment" "Path"
|
|
StrCmp $0 "" path_empty
|
|
Push "$0"
|
|
Push "$INSTDIR\bin"
|
|
Call StrStr
|
|
Pop $1
|
|
StrCmp $1 "" path_append path_done
|
|
path_empty:
|
|
WriteRegExpandStr HKCU "Environment" "Path" "$INSTDIR\bin"
|
|
Goto path_broadcast
|
|
path_append:
|
|
WriteRegExpandStr HKCU "Environment" "Path" "$0;$INSTDIR\bin"
|
|
path_broadcast:
|
|
SendMessage ${HWND_BROADCAST} ${WM_SETTINGCHANGE} 0 "STR:Environment" /TIMEOUT=3000
|
|
path_done:
|
|
|
|
WriteRegStr HKCU "Software\Verae\PrintStamp" "InstallDir" "$INSTDIR"
|
|
WriteRegStr HKCU "Software\Verae\PrintStamp" "Version" "${VERSION}"
|
|
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\VeraePrintStamp" "DisplayName" "${PRODUCT_NAME} ${VERSION}"
|
|
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\VeraePrintStamp" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\""
|
|
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\VeraePrintStamp" "DisplayVersion" "${VERSION}"
|
|
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\VeraePrintStamp" "Publisher" "${PRODUCT_PUBLISHER}"
|
|
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\VeraePrintStamp" "URLInfoAbout" "${PRODUCT_URL}"
|
|
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
|
|
|
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
|
|
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
|
|
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Setup signing key.lnk" "$INSTDIR\bin\verae-print.exe" "setup"
|
|
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Customer portal.lnk" "${PORTAL_URL}"
|
|
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
|
|
!insertmacro MUI_STARTMENU_WRITE_END
|
|
|
|
CreateShortCut "$DESKTOP\Verae Print Stamp.lnk" "$INSTDIR\bin\verae-print.exe" "setup"
|
|
SectionEnd
|
|
|
|
Section "Uninstall"
|
|
Delete "$INSTDIR\bin\verae-print.exe"
|
|
RMDir "$INSTDIR\bin"
|
|
Delete "$INSTDIR\README.txt"
|
|
Delete "$INSTDIR\LICENSE.txt"
|
|
Delete "$INSTDIR\Uninstall.exe"
|
|
RMDir "$INSTDIR"
|
|
|
|
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
|
|
Delete "$SMPROGRAMS\$StartMenuFolder\*.lnk"
|
|
RMDir "$SMPROGRAMS\$StartMenuFolder"
|
|
Delete "$DESKTOP\Verae Print Stamp.lnk"
|
|
|
|
DeleteRegKey HKCU "Software\Verae\PrintStamp"
|
|
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\VeraePrintStamp"
|
|
SectionEnd
|
|
|
|
; Case-insensitive substring search: haystack, needle → result on stack (needle or "")
|
|
Function StrStr
|
|
Exch $R1 ; needle
|
|
Exch
|
|
Exch $R2 ; haystack
|
|
Push $R3
|
|
Push $R4
|
|
Push $R5
|
|
StrLen $R3 $R1
|
|
StrCpy $R4 0
|
|
loop:
|
|
StrCpy $R5 $R2 $R3 $R4
|
|
StrCmp $R5 "" notfound
|
|
StrCmp $R5 $R1 found
|
|
IntOp $R4 $R4 + 1
|
|
Goto loop
|
|
found:
|
|
StrCpy $R1 $R1
|
|
Goto done
|
|
notfound:
|
|
StrCpy $R1 ""
|
|
done:
|
|
Pop $R5
|
|
Pop $R4
|
|
Pop $R3
|
|
Pop $R2
|
|
Exch $R1
|
|
FunctionEnd
|