Skip to content

Commit

Permalink
ship license file and refer to it during silent install
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp committed Sep 6, 2024
1 parent 55e8e83 commit 747d88e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
16 changes: 10 additions & 6 deletions constructor/nsis/main.nsi.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -723,11 +723,7 @@ Function .onInit

Call OnInit_Release

${Print} "Welcome to ${NAME} ${VERSION}"
#if has_license
${Print} "By continuing this installation you are accepting a license agreement."
${Print} "Please run the installer in GUI mode to read the details."
#endif
${Print} "Welcome to ${NAME} ${VERSION}$\n"

Pop $R2
Pop $R1
Expand Down Expand Up @@ -1141,8 +1137,16 @@ Section "Install"
${EndIf}
StrCpy $INSTDIR $0

#if has_license
SetOutPath "$INSTDIR"
File __LICENSEFILE__
${Print} "By continuing this installation you are accepting this license agreement:"
${Print} "$INSTDIR\@LICENSEFILENAME@"
${Print} "Please run the installer in GUI mode to read the details.$\n"
#endif

${Print} "${NAME} will now be installed into this location:"
${Print} "$INSTDIR"
${Print} "$INSTDIR$\n"

ReadEnvStr $0 SystemRoot
# set PATH for the installer process, so that MSVC runtimes get found OK
Expand Down
4 changes: 2 additions & 2 deletions constructor/winexe.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import shutil
import sys
import tempfile
from os.path import abspath, dirname, isfile, join
from os.path import abspath, basename, dirname, isfile, join
from pathlib import Path
from subprocess import check_output, run
from typing import List, Union
Expand Down Expand Up @@ -376,7 +376,7 @@ def make_nsi(
),
('@TEMP_EXTRA_FILES@', '\n '.join(insert_tempfiles_commands(temp_extra_files))),
('@VIRTUAL_SPECS@', " ".join([f'"{spec}"' for spec in info.get("virtual_specs", ())])),

('@LICENSEFILENAME@', basename(info.get('license_file', join(NSIS_DIR, 'placeholder_license.txt')))),
]:
data = data.replace(key, value)

Expand Down

0 comments on commit 747d88e

Please sign in to comment.