Skip to content

Commit

Permalink
feat(bundler/windows): Update wix to fix vulnerabilities and add arm …
Browse files Browse the repository at this point in the history
…support (#9861) (#10072)

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
  • Loading branch information
FabianLars and lucasfernog authored Jul 8, 2024
1 parent afb102c commit c734b9e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changes/feat-wix-arm64.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"tauri-bundler": "patch:feat"
"tauri-cli": "patch:feat"
---

Upgraded the WiX version to 3.14 which fixes vulnerability issues and adds support for Arm targets.
2 changes: 1 addition & 1 deletion tooling/bundler/src/bundle/windows/msi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const WIX_REQUIRED_FILES: &[&str] = &[
/// Returns a vector of PathBuf that shows where the MSI was created.
pub fn bundle_project(settings: &Settings, updater: bool) -> crate::Result<Vec<PathBuf>> {
let mut wix_path = dirs::cache_dir().unwrap();
wix_path.push("tauri/WixTools");
wix_path.push("tauri/WixTools314");

if !wix_path.exists() {
wix::get_and_extract_wix(&wix_path)?;
Expand Down
7 changes: 5 additions & 2 deletions tooling/bundler/src/bundle/windows/msi/wix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ use uuid::Uuid;

// URLS for the WIX toolchain. Can be used for cross-platform compilation.
pub const WIX_URL: &str =
"https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip";
pub const WIX_SHA256: &str = "2c1888d5d1dba377fc7fa14444cf556963747ff9a0a289a3599cf09da03b9e2e";
"https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip";
pub const WIX_SHA256: &str = "6ac824e1642d6f7277d0ed7ea09411a508f6116ba6fae0aa5f2c7daa2ff43d31";

// For Cross Platform Compilation.

Expand Down Expand Up @@ -182,6 +182,7 @@ fn app_installer_output_path(
let arch = match settings.binary_arch() {
"x86" => "x86",
"x86_64" => "x64",
"aarch64" => "arm64",
target => {
return Err(crate::Error::ArchError(format!(
"Unsupported architecture: {}",
Expand Down Expand Up @@ -294,6 +295,7 @@ fn run_candle(
let arch = match settings.binary_arch() {
"x86_64" => "x64",
"x86" => "x86",
"aarch64" => "arm64",
target => {
return Err(crate::Error::ArchError(format!(
"unsupported target: {}",
Expand Down Expand Up @@ -388,6 +390,7 @@ pub fn build_wix_app_installer(
let arch = match settings.binary_arch() {
"x86_64" => "x64",
"x86" => "x86",
"aarch64" => "arm64",
target => {
return Err(crate::Error::ArchError(format!(
"unsupported target: {}",
Expand Down
3 changes: 3 additions & 0 deletions tooling/bundler/src/bundle/windows/templates/main.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<?elseif $(sys.BUILDARCH)="x64"?>
<?define Win64 = "yes" ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?elseif $(sys.BUILDARCH)="arm64"?>
<?define Win64 = "yes" ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?else?>
<?error Unsupported value of sys.BUILDARCH=$(sys.BUILDARCH)?>
<?endif?>
Expand Down

0 comments on commit c734b9e

Please sign in to comment.