From 056c7016c0b40eaa7b8257a368904642e92e6f51 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 22 Jan 2026 16:20:36 +0800 Subject: [PATCH 1/2] Document MSI_PATH variable for post-install scripts. --- changes/2637.feature.md | 1 + docs/en/reference/platforms/windows/index.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changes/2637.feature.md diff --git a/changes/2637.feature.md b/changes/2637.feature.md new file mode 100644 index 000000000..2b572e256 --- /dev/null +++ b/changes/2637.feature.md @@ -0,0 +1 @@ +Post-install scripts for MSI installers now expose an `MSI_PATH` environment variable. diff --git a/docs/en/reference/platforms/windows/index.md b/docs/en/reference/platforms/windows/index.md index a3bbed05d..dced3990f 100644 --- a/docs/en/reference/platforms/windows/index.md +++ b/docs/en/reference/platforms/windows/index.md @@ -191,7 +191,7 @@ A Boolean describing the initial value of the option in the GUI. If not provided When an installer option is defined, the value of the option will be made available to the post-install or pre-uninstall script as an environment variable. For example, if you define an option with a name of `foo`, an environment variable of `OPTION_FOO` will be defined, with a value of 1 if the option has been selected by the user, and 0 if the option has not been selected. -In the post-install script, the `ALLUSERS` environment variable will also be set; its value will be 1 if the app has been installed for all users, or 0 if it has only been installed for the current user. +In the post-install script, the `ALLUSERS` environment variable will be set; its value will be 1 if the app has been installed for all users, or 0 if it has only been installed for the current user. The `MSI_PATH` environment variable will be set to the path of the MSI file. If a user uninstalls software by clicking "uninstall" through the Windows "Remove software" interface, the uninstall options will not be displayed to the user. The pre-uninstall script *will* be executed, but the uninstall options will assume their default values. The uninstall GUI is only displayed if the user re-runs the installer manually, or if the user specifies the "Modify" option in the Windows "Remove software" interface. This is a quirk of the Windows uninstall tooling. From 56ea46a4c8f94e73e4dc0086928be175f3b5b6dc Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Fri, 23 Jan 2026 06:52:50 +0800 Subject: [PATCH 2/2] Tweak the name of the environment variable. --- changes/2637.feature.md | 2 +- docs/en/reference/platforms/windows/index.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/changes/2637.feature.md b/changes/2637.feature.md index 2b572e256..6dfc7a518 100644 --- a/changes/2637.feature.md +++ b/changes/2637.feature.md @@ -1 +1 @@ -Post-install scripts for MSI installers now expose an `MSI_PATH` environment variable. +Post-install scripts for MSI installers now expose an `INSTALLER_PATH` environment variable. diff --git a/docs/en/reference/platforms/windows/index.md b/docs/en/reference/platforms/windows/index.md index dced3990f..8c3e0f3ab 100644 --- a/docs/en/reference/platforms/windows/index.md +++ b/docs/en/reference/platforms/windows/index.md @@ -191,7 +191,7 @@ A Boolean describing the initial value of the option in the GUI. If not provided When an installer option is defined, the value of the option will be made available to the post-install or pre-uninstall script as an environment variable. For example, if you define an option with a name of `foo`, an environment variable of `OPTION_FOO` will be defined, with a value of 1 if the option has been selected by the user, and 0 if the option has not been selected. -In the post-install script, the `ALLUSERS` environment variable will be set; its value will be 1 if the app has been installed for all users, or 0 if it has only been installed for the current user. The `MSI_PATH` environment variable will be set to the path of the MSI file. +In the post-install script, the `ALLUSERS` environment variable will be set; its value will be 1 if the app has been installed for all users, or 0 if it has only been installed for the current user. The `INSTALLER_PATH` environment variable will be set to the path of the MSI file. If a user uninstalls software by clicking "uninstall" through the Windows "Remove software" interface, the uninstall options will not be displayed to the user. The pre-uninstall script *will* be executed, but the uninstall options will assume their default values. The uninstall GUI is only displayed if the user re-runs the installer manually, or if the user specifies the "Modify" option in the Windows "Remove software" interface. This is a quirk of the Windows uninstall tooling.