Skip to content

Commit f8da863

Browse files
committed
Relocate var def, add INSTALLER_PLUGINSDIR
1 parent 247a620 commit f8da863

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

constructor/nsis/main.nsi.tmpl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -649,10 +649,6 @@ Function .onInit
649649
Push $R1
650650
Push $R2
651651

652-
{%- if post_install_exists %}
653-
System::Call 'Kernel32::SetEnvironmentVariable(t, t) i("INSTALLER_PATH", "$EXEPATH")'
654-
{%- endif %}
655-
656652
# 1. Initialize core options default values and other variables
657653
Call mui_AnaCustomOptions_InitDefaults
658654
Call InitializeVariables
@@ -1538,7 +1534,8 @@ Section "Install"
15381534
File /nonfatal /r {{ index_cache }}
15391535
File /r {{ repodata_record }}
15401536

1541-
1537+
System::Call 'Kernel32::SetEnvironmentVariable(t, t) i("INSTALLER_PLUGINSDIR", "$PLUGINSDIR")'
1538+
System::Call 'Kernel32::SetEnvironmentVariable(t, t) i("INSTALLER_PATH", "$EXEPATH")'
15421539
{%- for key, escaped_val in SCRIPT_ENV_VARIABLES | items %}
15431540
System::Call 'kernel32::SetEnvironmentVariable(t,t)i("{{ key }}", {{ escaped_val }}).r0'
15441541
{%- endfor %}

examples/scripts/post_install.bat

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ if not exist "%INSTALLER_PATH%" (
1313
echo ERROR: "INSTALLER_PATH=%INSTALLER_PATH%" points to a file that does not exist!
1414
exit 1
1515
)
16+
17+
if not exist "%INSTALLER_PLUGINSDIR%" (
18+
echo ERROR: "INSTALLER_PLUGINSDIR=%INSTALLER_PLUGINSDIR%" points to a directory that does not exist!
19+
exit 1
20+
)

0 commit comments

Comments
 (0)