Skip to content

Commit 7ae9015

Browse files
committed
Add Install Options Page - WIP
1 parent ef398ec commit 7ae9015

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

constructor/briefcase.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,34 @@ def file_path(self) -> Path:
278278
return self._dst / "pre_uninstall.bat"
279279

280280

281+
def create_install_options_list(info: dict) -> list[dict]:
282+
"""Returns a list of dicts with data formatted for the installation options page."""
283+
options = []
284+
register_python = info.get("register_python", True)
285+
if register_python:
286+
options.append(
287+
{
288+
"name": "register_python",
289+
"title": "Register Python as System Default",
290+
"description": "TODO: Register Python description",
291+
"default": info.get("register_python_default", False),
292+
}
293+
)
294+
initialize_conda = info.get("initialize_conda", "classic")
295+
if initialize_conda:
296+
# TODO: How would we distinguish between True/classic in the UI? Same for NSIS
297+
options.append(
298+
{
299+
"name": "initialize_conda",
300+
"title": "Initialize Conda",
301+
"description": "TODO: Initialize conda description",
302+
"default": info.get("initialize_by_default", False),
303+
}
304+
)
305+
306+
return options
307+
308+
281309
# Create a Briefcase configuration file. Using a full TOML writer rather than a Jinja
282310
# template allows us to avoid escaping strings everywhere.
283311
def write_pyproject_toml(tmp_dir, info, uninstall_bat):
@@ -298,6 +326,7 @@ def write_pyproject_toml(tmp_dir, info, uninstall_bat):
298326
"install_launcher": False,
299327
"post_install_script": str(BRIEFCASE_DIR / "run_installation.bat"),
300328
"pre_uninstall_script": str(uninstall_bat.file_path),
329+
"install_option": create_install_options_list(info),
301330
}
302331
},
303332
}

0 commit comments

Comments
 (0)