wip: working installer. cleanup/bindir/logo missing

This commit is contained in:
Hane 2024-12-24 00:29:23 +01:00
commit 94d2ebf1c2
3 changed files with 233 additions and 0 deletions

22
install/version.nsi Normal file
View file

@ -0,0 +1,22 @@
!define File "..\build\debug\qtest.exe"
OutFile "GetVersion.exe"
SilentInstall silent
RequestExecutionLevel user ; don't write $EXEDIR\Version.txt with admin permissions and prevent invoking UAC
Section
## Get file version
GetDllVersion "${File}" $R0 $R1
IntOp $R2 $R0 / 0x00010000
IntOp $R3 $R0 & 0x0000FFFF
IntOp $R4 $R1 / 0x00010000
IntOp $R5 $R1 & 0x0000FFFF
StrCpy $R1 "$R2.$R3.$R4.$R5"
## Write it to a !define for use in main script
FileOpen $R0 "$EXEDIR\Version.txt" w
FileWrite $R0 '!define version "$R1"'
FileClose $R0
SectionEnd