Skip to content

Commit

Permalink
Add support for passing UpgradeCodeGuideId into wix config (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwronski authored Oct 12, 2022
1 parent 8551bfa commit e1945d9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ final case class WindowsOptions(
is64Bits: Boolean = true,
@Group("Windows")
@HelpMessage("WIX installer version")
installerVersion: Option[String] = None
installerVersion: Option[String] = None,
@Group("Windows")
@HelpMessage("The GUID to identify that the windows package can be upgraded.")
wixUpgradeCodeGuid: Option[String] = None
) {

def toWindowsSettings(
Expand All @@ -53,7 +56,8 @@ final case class WindowsOptions(
suppressValidation = suppressValidation,
extraConfigs = extraConfigs,
is64Bits = is64Bits,
installerVersion = installerVersion
installerVersion = installerVersion,
wixUpgradeCodeGuid = wixUpgradeCodeGuid
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class WindowsPackageTests extends munit.FunSuite with NativePackageHelper {
suppressValidation = true,
extraConfigs = Nil,
is64Bits = false,
installerVersion = None
installerVersion = None,
wixUpgradeCodeGuid = None,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ case class WindowsSettings(
suppressValidation: Boolean,
extraConfigs: List[String],
is64Bits: Boolean,
installerVersion: Option[String]
installerVersion: Option[String],
wixUpgradeCodeGuid: Option[String]
) extends NativeSettings
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ case class WindowsPackage(
launcherAppName = launcherApp,
extraConfigs = buildSettings.extraConfigs,
is64Bits = buildSettings.is64Bits,
installerVersion = buildSettings.installerVersion
installerVersion = buildSettings.installerVersion,
wixUpgradeCodeGuid = buildSettings.wixUpgradeCodeGuid
)

createConfFile(wixConfig)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ case class WindowsWixConfig(
launcherAppName: String,
extraConfigs: List[String],
is64Bits: Boolean,
installerVersion: Option[String]
installerVersion: Option[String],
wixUpgradeCodeGuid: Option[String]
) {

lazy val extraConfig: Option[String] =
Expand Down Expand Up @@ -72,7 +73,7 @@ case class WindowsWixConfig(
def generateContent(): String =
s"""<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" UpgradeCode="$randomGuid"
<Product Id="*" UpgradeCode="${wixUpgradeCodeGuid.getOrElse(randomGuid)}"
Name="$productName" Version="$version" Manufacturer="$maintainer" Language="1033">
<Package $extraPackage InstallerVersion="${installerVersion.getOrElse(
"200"
Expand Down

0 comments on commit e1945d9

Please sign in to comment.