Skip to content
Open
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
15 changes: 14 additions & 1 deletion tugger-wix/src/simple_msi_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ pub struct WiXSimpleMsiBuilder {
upgrade_code: Option<String>,
package_keywords: Option<String>,
package_description: Option<String>,
per_user_install: Option<bool>,
license_source: Option<PathBuf>,
product_icon: Option<PathBuf>,
help_url: Option<String>,
Expand Down Expand Up @@ -140,6 +141,13 @@ impl WiXSimpleMsiBuilder {
self
}

/// If enabled install per-user rather than per-machine.
#[must_use]
pub fn per_user_install(mut self, value: bool) -> Self {
self.per_user_install = Some(value);
self
}

/// Set the path to the file containing the license for this application.
#[must_use]
pub fn license_path<P: AsRef<Path>>(mut self, path: P) -> Self {
Expand Down Expand Up @@ -307,10 +315,15 @@ impl WiXSimpleMsiBuilder {
.attr("InstallerVersion", &self.package_installer_version)
.attr("Languages", &self.package_languages)
.attr("Compressed", "yes")
.attr("InstallScope", "perMachine")
.attr("SummaryCodepage", "1252")
.attr("Platform", "$(sys.BUILDARCH)");

let package = if self.per_user_install.unwrap_or(false) {
package
} else {
package.attr("InstallScope", "perMachine")
};

let package = if let Some(keywords) = &self.package_keywords {
package.attr("Keywords", keywords)
} else {
Expand Down
7 changes: 7 additions & 0 deletions tugger/docs/tugger_starlark_type_wix_msi_builder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@

Keywords for the application being installed.

.. py:attribute:: per_user_install

(``bool``)

When set (off be default) the application will be installed per-user
rather than per-machine.

.. py:attribute:: product_icon_path

(``str``)
Expand Down
3 changes: 3 additions & 0 deletions tugger/src/starlark/wix_msi_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ impl TypedValue for WiXMsiBuilderValue {
"package_keywords" => {
inner.builder = inner.builder.clone().package_keywords(value.to_string());
}
"per_user_install" => {
inner.builder = inner.builder.clone().per_user_install(value.to_bool());
}
"product_icon_path" => {
inner.builder = inner.builder.clone().product_icon_path(value.to_string());
}
Expand Down