Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CONSTRUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,9 @@ Path to a post-install script. Some notes:
`%INSTALLER_PLAT%` environment variables. `%INSTALLER_TYPE%` is set to `EXE`.
`%INSTALLER_UNATTENDED%` will be `"1"` in silent mode (`/S`), `"0"` otherwise.
- For Windows `.msi` installers, the script must be a `.bat` file.
The same variables as `.exe` installers are available, except
`%INSTALLER_TYPE%` is set to `MSI` and `%INSTALLER_UNATTENDED%` is not available.
The same variables as `.exe` installers are available.
`%INSTALLER_TYPE%` is set to `MSI`.
`%INSTALLER_UNATTENDED%` will be `"1"` in silent mode (`msiexec /qn`), `"0"` otherwise.

If necessary, you can activate the installed `base` environment like this:

Expand Down
5 changes: 3 additions & 2 deletions constructor/_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,8 +561,9 @@ class ConstructorConfiguration(BaseModel):
`%INSTALLER_PLAT%` environment variables. `%INSTALLER_TYPE%` is set to `EXE`.
`%INSTALLER_UNATTENDED%` will be `"1"` in silent mode (`/S`), `"0"` otherwise.
- For Windows `.msi` installers, the script must be a `.bat` file.
The same variables as `.exe` installers are available, except
`%INSTALLER_TYPE%` is set to `MSI` and `%INSTALLER_UNATTENDED%` is not available.
The same variables as `.exe` installers are available.
`%INSTALLER_TYPE%` is set to `MSI`.
`%INSTALLER_UNATTENDED%` will be `"1"` in silent mode (`msiexec /qn`), `"0"` otherwise.

If necessary, you can activate the installed `base` environment like this:

Expand Down
3 changes: 0 additions & 3 deletions constructor/briefcase/pre_uninstall.bat
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ set "INSTALLER_NAME={{ installer_name }}"
set "INSTALLER_VER={{ installer_version }}"
set "INSTALLER_PLAT={{ installer_platform }}"
set "INSTALLER_TYPE=MSI"
rem INSTALLER_UNATTENDED is not available for MSI installers.
rem Detecting silent mode requires UILevel from WiX, which would need
rem changes to the briefcase-windows-app-template to pass to this script.

rem Determine install mode from .nonadmin marker file written at install time
if exist "%BASE_PATH%\.nonadmin" (
Expand Down
3 changes: 0 additions & 3 deletions constructor/briefcase/run_installation.bat
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ set "INSTALLER_NAME={{ installer_name }}"
set "INSTALLER_VER={{ installer_version }}"
set "INSTALLER_PLAT={{ installer_platform }}"
set "INSTALLER_TYPE=MSI"
rem INSTALLER_UNATTENDED is not available for MSI installers.
rem Detecting silent mode requires UILevel from WiX, which would need
rem changes to the briefcase-windows-app-template to pass to this script.

{%- if add_debug %}
>> "%LOG%" echo ==== run_installation start ====
Expand Down
2 changes: 1 addition & 1 deletion constructor/data/construct.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@
}
],
"default": null,
"description": "Path to a post-install script. Some notes:\n- For Unix `.sh` installers, the shebang line is respected if present; otherwise, the script is run by the POSIX shell `sh`. Note that the use of a shebang can reduce the portability of the installer. The installation path is available as `${PREFIX}`. Installer metadata is available in the `${INSTALLER_NAME}`, `${INSTALLER_VER}`, `${INSTALLER_PLAT}` environment variables. `${INSTALLER_TYPE}` is set to `SH`. `${INSTALLER_UNATTENDED}` will be `\"1\"` in batch mode (`-b`), `\"0\"` otherwise.\n- For PKG installers, the shebang line is respected if present; otherwise, `bash` is used. The same variables mentioned for `sh` installers are available here. `${INSTALLER_TYPE}` is set to `PKG`. `${INSTALLER_UNATTENDED}` will be `\"1\"` for command line installs, `\"0\"` otherwise.\n- For Windows `.exe` installers, the script must be a `.bat` file. Installation path is available as `%PREFIX%`. Metadata about the installer can be found in the `%INSTALLER_NAME%`, `%INSTALLER_VER%`, `%INSTALLER_PLAT%` environment variables. `%INSTALLER_TYPE%` is set to `EXE`. `%INSTALLER_UNATTENDED%` will be `\"1\"` in silent mode (`/S`), `\"0\"` otherwise.\n- For Windows `.msi` installers, the script must be a `.bat` file. The same variables as `.exe` installers are available, except `%INSTALLER_TYPE%` is set to `MSI` and `%INSTALLER_UNATTENDED%` is not available.\nIf necessary, you can activate the installed `base` environment like this:\n- Unix: `. \"$PREFIX/etc/profile.d/conda.sh\" && conda activate \"$PREFIX\"`\n- Windows: `call \"%PREFIX%\\Scripts\\activate.bat\"`",
"description": "Path to a post-install script. Some notes:\n- For Unix `.sh` installers, the shebang line is respected if present; otherwise, the script is run by the POSIX shell `sh`. Note that the use of a shebang can reduce the portability of the installer. The installation path is available as `${PREFIX}`. Installer metadata is available in the `${INSTALLER_NAME}`, `${INSTALLER_VER}`, `${INSTALLER_PLAT}` environment variables. `${INSTALLER_TYPE}` is set to `SH`. `${INSTALLER_UNATTENDED}` will be `\"1\"` in batch mode (`-b`), `\"0\"` otherwise.\n- For PKG installers, the shebang line is respected if present; otherwise, `bash` is used. The same variables mentioned for `sh` installers are available here. `${INSTALLER_TYPE}` is set to `PKG`. `${INSTALLER_UNATTENDED}` will be `\"1\"` for command line installs, `\"0\"` otherwise.\n- For Windows `.exe` installers, the script must be a `.bat` file. Installation path is available as `%PREFIX%`. Metadata about the installer can be found in the `%INSTALLER_NAME%`, `%INSTALLER_VER%`, `%INSTALLER_PLAT%` environment variables. `%INSTALLER_TYPE%` is set to `EXE`. `%INSTALLER_UNATTENDED%` will be `\"1\"` in silent mode (`/S`), `\"0\"` otherwise.\n- For Windows `.msi` installers, the script must be a `.bat` file. The same variables as `.exe` installers are available. `%INSTALLER_TYPE%` is set to `MSI`. `%INSTALLER_UNATTENDED%` will be `\"1\"` in silent mode (`msiexec /qn`), `\"0\"` otherwise.\nIf necessary, you can activate the installed `base` environment like this:\n- Unix: `. \"$PREFIX/etc/profile.d/conda.sh\" && conda activate \"$PREFIX\"`\n- Windows: `call \"%PREFIX%\\Scripts\\activate.bat\"`",
"title": "Post Install"
},
"post_install_desc": {
Expand Down
2 changes: 1 addition & 1 deletion dev/extra-requirements-windows.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
conda-forge::briefcase>=0.3.26
conda-forge::briefcase>=0.4.3
conda-forge::nsis>=3.08=*_log_*
conda-forge::tomli-w>=1.2.0
5 changes: 3 additions & 2 deletions docs/source/construct-yaml.md
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,9 @@ Path to a post-install script. Some notes:
`%INSTALLER_PLAT%` environment variables. `%INSTALLER_TYPE%` is set to `EXE`.
`%INSTALLER_UNATTENDED%` will be `"1"` in silent mode (`/S`), `"0"` otherwise.
- For Windows `.msi` installers, the script must be a `.bat` file.
The same variables as `.exe` installers are available, except
`%INSTALLER_TYPE%` is set to `MSI` and `%INSTALLER_UNATTENDED%` is not available.
The same variables as `.exe` installers are available.
`%INSTALLER_TYPE%` is set to `MSI`.
`%INSTALLER_UNATTENDED%` will be `"1"` in silent mode (`msiexec /qn`), `"0"` otherwise.

If necessary, you can activate the installed `base` environment like this:

Expand Down
3 changes: 1 addition & 2 deletions examples/scripts/post_install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ if not "%INSTALLER_NAME%" == "Scripts" exit 1
if not "%INSTALLER_VER%" == "1.0.0" exit 1
if not "%INSTALLER_PLAT%" == "win-64" exit 1
if not "%INSTALLER_TYPE%" == "EXE" if not "%INSTALLER_TYPE%" == "MSI" exit 1
rem INSTALLER_UNATTENDED is not yet set by MSI installers (see conda/constructor#1276).
if "%INSTALLER_TYPE%" == "EXE" if not "%INSTALLER_UNATTENDED%" == "1" exit 1
if not "%INSTALLER_UNATTENDED%" == "1" exit 1
if "%PREFIX%" == "" exit 1
if not "%CUSTOM_VARIABLE_1%" == "FIR$T-CUSTOM_STRING WITH SPACES AND @*! CHARACTERS" exit 1
if not "%CUSTOM_VARIABLE_2%" == "$ECOND-CUSTOM_STRING WITH SPACES AND @*! CHARACTERS" exit 1
Expand Down
3 changes: 1 addition & 2 deletions examples/scripts/pre_install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ if not "%INSTALLER_NAME%" == "Scripts" exit 1
if not "%INSTALLER_VER%" == "1.0.0" exit 1
if not "%INSTALLER_PLAT%" == "win-64" exit 1
if not "%INSTALLER_TYPE%" == "EXE" if not "%INSTALLER_TYPE%" == "MSI" exit 1
rem INSTALLER_UNATTENDED is not yet set by MSI installers (see conda/constructor#1276).
if "%INSTALLER_TYPE%" == "EXE" if not "%INSTALLER_UNATTENDED%" == "1" exit 1
if not "%INSTALLER_UNATTENDED%" == "1" exit 1
if "%PREFIX%" == "" exit 1
if not "%CUSTOM_VARIABLE_1%" == "FIR$T-CUSTOM_STRING WITH SPACES AND @*! CHARACTERS" exit 1
if not "%CUSTOM_VARIABLE_2%" == "$ECOND-CUSTOM_STRING WITH SPACES AND @*! CHARACTERS" exit 1
Expand Down
19 changes: 19 additions & 0 deletions news/1276-msi-installer-unattended
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* <news item>

### Bug fixes

* <news item>

### Deprecations

* <news item>

### Docs

* Updated docs to clarify the use of `INSTALLER_UNATTENDED` within the context of MSI installers, and updated minimum `briefcase` version to `0.4.3`. (#1278)

### Other

* <news item>
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies = [
"pillow >=3.1 ; platform_system=='Windows' or platform_system=='Darwin'",
"jinja2",
"jsonschema >=4",
"briefcase >=0.3.26 ; platform_system=='Windows'",
"briefcase >=0.4.3 ; platform_system=='Windows'",
"tomli-w >=1.2.0 ; platform_system=='Windows'",
]

Expand Down
12 changes: 6 additions & 6 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ requirements:
- conda-standalone >=24.11.0
- jinja2
- jsonschema >=4
- pillow >=3.1 # [win or osx]
- nsis >=3.08 # [win]
- briefcase >=0.3.26 # [win]
- tomli-w >=1.2.0 # [win]
run_constrained: # [unix]
- nsis >=3.08 # [unix]
- pillow >=3.1 # [win or osx]
- nsis >=3.08 # [win]
- briefcase >=0.4.3 # [win]
- tomli-w >=1.2.0 # [win]
run_constrained: # [unix]
- nsis >=3.08 # [unix]
- conda-libmamba-solver !=24.11.0
- pydantic >=2

Expand Down
1 change: 0 additions & 1 deletion tests/test_briefcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,6 @@ def test_render_templates_installer_metadata(template_name):
assert 'set "INSTALLER_VER=1.0.0"' in text
assert f'set "INSTALLER_PLAT={cc_platform}"' in text
assert 'set "INSTALLER_TYPE=MSI"' in text
assert "INSTALLER_UNATTENDED is not available" in text


@pytest.mark.skipif(sys.platform != "win32", reason="Windows-only")
Expand Down
Loading