Skip to content

Commit 149eeb7

Browse files
committed
Installer: Write out configuration to json file
JSON file is $INSTDIR/Packages/installation_configuration.json The following data is saved: /Installation/User <string> (either "all" or "current") /Installation/WithHardware <number> (either 1 or 0) Added file to repo, such that it is listed in the files that are part of the installation/uninstallation
1 parent 2f5fc76 commit 149eeb7

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

.pre-commit-config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ exclude: |
44
(?x) # verbose re
55
( # start alternations
66
# not our code
7+
^Packages/installation_configuration.json|
78
^Packages/MIES/IPA_Control.ipf|
89
^tools/installer/nsis|
910
^tools/installer/Shelllink|

Packages/installation_configuration.json

Whitespace-only changes.

tools/installer/installer.nsi

+19
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,25 @@ SkipASLRSetup:
837837
SetRegView default
838838
${EndIf}
839839
SkipITCSetup:
840+
; Write out installed configuration
841+
FileOpen $FILEHANDLE "$INSTDIR\Packages\installation_configuration.json" w
842+
FileWrite $FILEHANDLE '{$\n'
843+
FileWrite $FILEHANDLE '$\t"Installation" : {$\n'
844+
IntCmp $ALLUSER 1 ConfigWriteUserAll
845+
FileWrite $FILEHANDLE '$\t$\t"User" : "current",$\n'
846+
Goto ConfigWriteUserEnd
847+
ConfigWriteUserAll:
848+
FileWrite $FILEHANDLE '$\t$\t"User" : "all",$\n'
849+
ConfigWriteUserEnd:
850+
IntCmp $XOPINST 1 ConfigWriteWithHardwareYes
851+
FileWrite $FILEHANDLE '$\t$\t"WithHardware" : 0$\n'
852+
Goto ConfigWriteWithHardwareEnd
853+
ConfigWriteWithHardwareYes:
854+
FileWrite $FILEHANDLE '$\t$\t"WithHardware" : 1$\n'
855+
ConfigWriteWithHardwareEnd:
856+
FileWrite $FILEHANDLE '$\t}$\n'
857+
FileWrite $FILEHANDLE '}'
858+
FileClose $FILEHANDLE
840859

841860
SectionEnd
842861

0 commit comments

Comments
 (0)