diff --git a/cookiecutter.json b/cookiecutter.json index a909ae3..4c6781c 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -18,6 +18,7 @@ "install_launcher": true, "document_types": "", "install_options": "", + "uninstall_options": "", "installer_path": "_installer", "post_install_script": "", "pre_uninstall_script": "", 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 ec080ef..49dd9da 100644 --- a/{{ cookiecutter.format }}/extras/{{ cookiecutter.installer_path }}/run_pre_uninstall.bat +++ b/{{ cookiecutter.format }}/extras/{{ cookiecutter.installer_path }}/run_pre_uninstall.bat @@ -1,4 +1,7 @@ @echo off setlocal enabledelayedexpansion +{% for name in cookiecutter.uninstall_options -%} +SET OPTION_{{ name.upper() }}=%{{ loop.index }} +{% endfor -%} CALL "%~dp0pre_uninstall.bat" diff --git a/{{ cookiecutter.format }}/unicode.wxl b/{{ cookiecutter.format }}/unicode.wxl index 97ee277..047016f 100644 --- a/{{ cookiecutter.format }}/unicode.wxl +++ b/{{ cookiecutter.format }}/unicode.wxl @@ -1,7 +1,18 @@ - - \ No newline at end of file + + + + + + + + diff --git a/{{ cookiecutter.format }}/{{ cookiecutter.app_name }}.wxs b/{{ cookiecutter.format }}/{{ cookiecutter.app_name }}.wxs index 3bf2740..215d4ba 100644 --- a/{{ cookiecutter.format }}/{{ cookiecutter.app_name }}.wxs +++ b/{{ cookiecutter.format }}/{{ cookiecutter.app_name }}.wxs @@ -21,8 +21,10 @@ {% if cookiecutter.author_email -%} {% endif -%} + {% if not cookiecutter.uninstall_options %} + {% endif %} - {% for name, install_option in cookiecutter.install_options.items() %} - - - - {% endfor %} - {% for name, install_option in cookiecutter.install_options.items() %} - + {% for name, option in cookiecutter.install_options.items() %} + {% if option.default %} + + {% endif %} + Condition="OPTION_{{ name.upper() }} <> "1"" /> + {% endfor %} + + {% for name, option in cookiecutter.uninstall_options.items() %} + {% if option.default %} + + {% endif %} + {% endfor %} + {% if cookiecutter.install_options %} + + + Text="!(loc.CustomizeDlgBannerBitmap)" /> - - - + Id="Title" + Type="Text" + X="15" Y="6" Width="210" Height="15" + Transparent="yes" + NoPrefix="yes" + Text="!(loc.CustomizeDlgTitle)" /> + + + + {% for name, option in cookiecutter.install_options.items() %} + {% set checkbox_y = 50 + loop.index0 * 46 %} + {% set description_y = 65 + loop.index0 * 46 %} + + + {% endfor %} + + X="192" Y="243" Width="56" Height="17" + Text="!(loc.WixUIBack)" /> + Text="!(loc.WixUINext)"> + Text="!(loc.WixUICancel)"> + + {% endif %} + {% if cookiecutter.uninstall_options %} + + + - - - + Text="!(loc.CustomizeDlgTitle)" /> + Text="Select options for the uninstall process" /> + + + {% for name, option in cookiecutter.uninstall_options.items() %} + {% set checkbox_y = 50 + loop.index0 * 46 %} + {% set description_y = 65 + loop.index0 * 46 %} + Id="UninstallOptionCheck_{{ name }}" + X="25" Y="{{ checkbox_y }}" Width="290" Height="15" + Type="CheckBox" + Property="OPTION_{{ name.upper() }}" + CheckBoxValue="1" + Text="{{ option.title }}" /> - + Text="{{ option.description }}" /> + {% endfor %} + + + + + + + + + {% endif %} - @@ -645,7 +666,8 @@ Control="Back" Event="NewDialog" Value="InstallOptionsDlg" - Order="1" /> + Order="1" + Condition="NOT Installed" /> {% else %} + Order="1" + Condition="NOT Installed" /> {% endif %} {% endif %} @@ -679,6 +702,71 @@ Value="BrowseDlg" Order="2"/> + + + + + + {% if cookiecutter.uninstall_options %} + + + + + + + + + {% else %} + + + + + + + {% endif %} +