From 01679658256b6ce340f9dee512c457daeb78e7bd Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 28 May 2026 14:35:50 +0800 Subject: [PATCH] Miscellaneous improvements to MSI installers. --- .../run_post_install.bat | 3 +- .../run_pre_uninstall.bat | 4 +- .../{{ cookiecutter.app_name }}.wxs | 186 ++++++++++++++++-- 3 files changed, 170 insertions(+), 23 deletions(-) diff --git a/{{ cookiecutter.format }}/extras/{{ cookiecutter.installer_path }}/run_post_install.bat b/{{ cookiecutter.format }}/extras/{{ cookiecutter.installer_path }}/run_post_install.bat index b030815..6c45296 100644 --- a/{{ cookiecutter.format }}/extras/{{ cookiecutter.installer_path }}/run_post_install.bat +++ b/{{ cookiecutter.format }}/extras/{{ cookiecutter.installer_path }}/run_post_install.bat @@ -2,8 +2,9 @@ setlocal enabledelayedexpansion SET ALLUSERS=%1 SET INSTALLER_PATH=%2 +SET INSTALLER_UNATTENDED=%3 {% for name in cookiecutter.install_options -%} -{%- set argn = loop.index + 2 -%} +{%- set argn = loop.index + 3 -%} SET OPTION_{{ name.upper() }}=%{{ argn }} {% endfor -%} diff --git a/{{ cookiecutter.format }}/extras/{{ cookiecutter.installer_path }}/run_pre_uninstall.bat b/{{ cookiecutter.format }}/extras/{{ cookiecutter.installer_path }}/run_pre_uninstall.bat index 49dd9da..d052da0 100644 --- a/{{ cookiecutter.format }}/extras/{{ cookiecutter.installer_path }}/run_pre_uninstall.bat +++ b/{{ cookiecutter.format }}/extras/{{ cookiecutter.installer_path }}/run_pre_uninstall.bat @@ -1,7 +1,9 @@ @echo off setlocal enabledelayedexpansion +SET INSTALLER_UNATTENDED=%1 {% for name in cookiecutter.uninstall_options -%} -SET OPTION_{{ name.upper() }}=%{{ loop.index }} +{%- set argn = loop.index + 1 -%} +SET OPTION_{{ name.upper() }}=%{{ argn }} {% endfor -%} CALL "%~dp0pre_uninstall.bat" diff --git a/{{ cookiecutter.format }}/{{ cookiecutter.app_name }}.wxs b/{{ cookiecutter.format }}/{{ cookiecutter.app_name }}.wxs index 41da9ab..1eedc6a 100644 --- a/{{ cookiecutter.format }}/{{ cookiecutter.app_name }}.wxs +++ b/{{ cookiecutter.format }}/{{ cookiecutter.app_name }}.wxs @@ -209,6 +209,17 @@ Sequence="execute" Condition="ALLUSERS = 1" /> + + + + {% if cookiecutter.console_app %} + + + + + + + + + + + + + + + + + + + + {% if cookiecutter.install_options %} @@ -544,7 +631,7 @@ {% if cookiecutter.install_options %} @@ -554,7 +641,7 @@ Dialog="InstallOptionsDlg" Control="Back" Event="NewDialog" - Value="InstallDirDlg" /> + Value="CustomInstallDirDlg" /> @@ -582,7 +669,7 @@ Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" - Value="InstallDirDlg" + Value="CustomInstallDirDlg" Order="1" Condition="NOT Installed" /> {% endif %} @@ -672,12 +759,12 @@ Dialog="InstallScopeDlg" Control="Next" Event="NewDialog" - Value="InstallDirDlg" + Value="CustomInstallDirDlg" Order="99"/> @@ -685,7 +772,7 @@ {% if cookiecutter.install_options %} @@ -695,7 +782,7 @@ Dialog="InstallOptionsDlg" Control="Back" Event="NewDialog" - Value="InstallDirDlg" /> + Value="CustomInstallDirDlg" /> {% else %} {% endif %} @@ -732,18 +819,24 @@ - + + + + + + + + {% endif %} {% if cookiecutter.pre_uninstall_script %} + + + + + {% endif %} {% if cookiecutter.post_install_script %} - + + + + + + {% endif %} {% if cookiecutter.pre_uninstall_script %} - + + + + + + {% endif %}