✨ update windows main wxs
This commit is contained in:
@@ -4,6 +4,9 @@
|
|||||||
<?elseif $(sys.BUILDARCH)="x64"?>
|
<?elseif $(sys.BUILDARCH)="x64"?>
|
||||||
<?define Win64 = "yes" ?>
|
<?define Win64 = "yes" ?>
|
||||||
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
|
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
|
||||||
|
<?elseif $(sys.BUILDARCH)="arm64"?>
|
||||||
|
<?define Win64 = "yes" ?>
|
||||||
|
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
|
||||||
<?else?>
|
<?else?>
|
||||||
<?error Unsupported value of sys.BUILDARCH=$(sys.BUILDARCH)?>
|
<?error Unsupported value of sys.BUILDARCH=$(sys.BUILDARCH)?>
|
||||||
<?endif?>
|
<?endif?>
|
||||||
@@ -11,11 +14,11 @@
|
|||||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||||
<Product
|
<Product
|
||||||
Id="*"
|
Id="*"
|
||||||
Name="{{{product_name}}}"
|
Name="{{product_name}}"
|
||||||
UpgradeCode="{{{upgrade_code}}}"
|
UpgradeCode="{{upgrade_code}}"
|
||||||
Language="!(loc.TauriLanguage)"
|
Language="!(loc.TauriLanguage)"
|
||||||
Manufacturer="{{{manufacturer}}}"
|
Manufacturer="{{manufacturer}}"
|
||||||
Version="{{{version}}}">
|
Version="{{version}}">
|
||||||
|
|
||||||
<Package Id="*"
|
<Package Id="*"
|
||||||
Keywords="Installer"
|
Keywords="Installer"
|
||||||
@@ -29,6 +32,11 @@
|
|||||||
<!-- reinstall all files; rewrite all registry entries; reinstall all shortcuts -->
|
<!-- reinstall all files; rewrite all registry entries; reinstall all shortcuts -->
|
||||||
<Property Id="REINSTALLMODE" Value="amus" />
|
<Property Id="REINSTALLMODE" Value="amus" />
|
||||||
|
|
||||||
|
<!-- Auto launch app after installation, useful for passive mode which usually used in updates -->
|
||||||
|
<Property Id="AUTOLAUNCHAPP" Secure="yes" />
|
||||||
|
<!-- Property to forward cli args to the launched app to not lose those of the pre-update instance -->
|
||||||
|
<Property Id="LAUNCHAPPARGS" Secure="yes" />
|
||||||
|
|
||||||
{{#if allow_downgrades}}
|
{{#if allow_downgrades}}
|
||||||
<MajorUpgrade Schedule="afterInstallInitialize" AllowDowngrades="yes" />
|
<MajorUpgrade Schedule="afterInstallInitialize" AllowDowngrades="yes" />
|
||||||
{{else}}
|
{{else}}
|
||||||
@@ -42,29 +50,35 @@
|
|||||||
<Media Id="1" Cabinet="app.cab" EmbedCab="yes" />
|
<Media Id="1" Cabinet="app.cab" EmbedCab="yes" />
|
||||||
|
|
||||||
{{#if banner_path}}
|
{{#if banner_path}}
|
||||||
<WixVariable Id="WixUIBannerBmp" Value="{{{banner_path}}}" />
|
<WixVariable Id="WixUIBannerBmp" Value="{{banner_path}}" />
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if dialog_image_path}}
|
{{#if dialog_image_path}}
|
||||||
<WixVariable Id="WixUIDialogBmp" Value="{{{dialog_image_path}}}" />
|
<WixVariable Id="WixUIDialogBmp" Value="{{dialog_image_path}}" />
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if license}}
|
{{#if license}}
|
||||||
<WixVariable Id="WixUILicenseRtf" Value="{{{license}}}" />
|
<WixVariable Id="WixUILicenseRtf" Value="{{license}}" />
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<Icon Id="ProductIcon" SourceFile="{{{icon_path}}}"/>
|
<Icon Id="ProductIcon" SourceFile="{{icon_path}}"/>
|
||||||
<Property Id="ARPPRODUCTICON" Value="ProductIcon" />
|
<Property Id="ARPPRODUCTICON" Value="ProductIcon" />
|
||||||
<Property Id="ARPNOREPAIR" Value="yes" Secure="yes" /> <!-- Remove repair -->
|
<Property Id="ARPNOREPAIR" Value="yes" Secure="yes" /> <!-- Remove repair -->
|
||||||
<SetProperty Id="ARPNOMODIFY" Value="1" After="InstallValidate" Sequence="execute"/>
|
<SetProperty Id="ARPNOMODIFY" Value="1" After="InstallValidate" Sequence="execute"/>
|
||||||
|
|
||||||
|
{{#if homepage}}
|
||||||
|
<Property Id="ARPURLINFOABOUT" Value="{{homepage}}"/>
|
||||||
|
<Property Id="ARPHELPLINK" Value="{{homepage}}"/>
|
||||||
|
<Property Id="ARPURLUPDATEINFO" Value="{{homepage}}"/>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<!-- initialize with previous InstallDir -->
|
<!-- initialize with previous InstallDir -->
|
||||||
<Property Id="INSTALLDIR">
|
<Property Id="INSTALLDIR">
|
||||||
<RegistrySearch Id="PrevInstallDirReg" Root="HKCU" Key="Software\\{{{manufacturer}}}\\{{{product_name}}}" Name="InstallDir" Type="raw"/>
|
<RegistrySearch Id="PrevInstallDirReg" Root="HKCU" Key="Software\\{{manufacturer}}\\{{product_name}}" Name="InstallDir" Type="raw"/>
|
||||||
</Property>
|
</Property>
|
||||||
|
|
||||||
<!-- launch app checkbox -->
|
<!-- launch app checkbox -->
|
||||||
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="!(loc.LaunchApp)" />
|
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="!(loc.LaunchApp)" />
|
||||||
<Property Id="WixShellExecTarget" Value="[!Path]" />
|
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/>
|
||||||
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
|
<CustomAction Id="LaunchApplication" Impersonate="yes" FileKey="Path" ExeCommand="[LAUNCHAPPARGS]" Return="asyncNoWait" />
|
||||||
|
|
||||||
<UI>
|
<UI>
|
||||||
<!-- launch app checkbox -->
|
<!-- launch app checkbox -->
|
||||||
@@ -92,27 +106,49 @@
|
|||||||
<Directory Id="TARGETDIR" Name="SourceDir">
|
<Directory Id="TARGETDIR" Name="SourceDir">
|
||||||
<Directory Id="DesktopFolder" Name="Desktop">
|
<Directory Id="DesktopFolder" Name="Desktop">
|
||||||
<Component Id="ApplicationShortcutDesktop" Guid="*">
|
<Component Id="ApplicationShortcutDesktop" Guid="*">
|
||||||
<Shortcut Id="ApplicationDesktopShortcut" Name="{{{product_name}}}" Description="Runs {{{product_name}}}" Target="[!Path]" WorkingDirectory="INSTALLDIR" />
|
<Shortcut Id="ApplicationDesktopShortcut" Name="{{product_name}}" Description="Runs {{product_name}}" Target="[!Path]" WorkingDirectory="INSTALLDIR" />
|
||||||
<RemoveFolder Id="DesktopFolder" On="uninstall" />
|
<RemoveFolder Id="DesktopFolder" On="uninstall" />
|
||||||
<RegistryValue Root="HKCU" Key="Software\\{{{manufacturer}}}\\{{{product_name}}}" Name="Desktop Shortcut" Type="integer" Value="1" KeyPath="yes" />
|
<RegistryValue Root="HKCU" Key="Software\\{{manufacturer}}\\{{product_name}}" Name="Desktop Shortcut" Type="integer" Value="1" KeyPath="yes" />
|
||||||
</Component>
|
</Component>
|
||||||
</Directory>
|
</Directory>
|
||||||
<Directory Id="$(var.PlatformProgramFilesFolder)" Name="PFiles">
|
<Directory Id="$(var.PlatformProgramFilesFolder)" Name="PFiles">
|
||||||
<Directory Id="INSTALLDIR" Name="{{{product_name}}}"/>
|
<Directory Id="INSTALLDIR" Name="{{product_name}}"/>
|
||||||
</Directory>
|
</Directory>
|
||||||
<Directory Id="ProgramMenuFolder">
|
<Directory Id="ProgramMenuFolder">
|
||||||
<Directory Id="ApplicationProgramsFolder" Name="{{{product_name}}}"/>
|
<Directory Id="ApplicationProgramsFolder" Name="{{product_name}}"/>
|
||||||
</Directory>
|
</Directory>
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
||||||
<DirectoryRef Id="INSTALLDIR">
|
<DirectoryRef Id="INSTALLDIR">
|
||||||
<Component Id="RegistryEntries" Guid="*">
|
<Component Id="RegistryEntries" Guid="*">
|
||||||
<RegistryKey Root="HKCU" Key="Software\\{{{manufacturer}}}\\{{{product_name}}}">
|
<RegistryKey Root="HKCU" Key="Software\\{{manufacturer}}\\{{product_name}}">
|
||||||
<RegistryValue Name="InstallDir" Type="string" Value="[INSTALLDIR]" KeyPath="yes" />
|
<RegistryValue Name="InstallDir" Type="string" Value="[INSTALLDIR]" KeyPath="yes" />
|
||||||
</RegistryKey>
|
</RegistryKey>
|
||||||
|
<!-- Change the Root to HKCU for perUser installations -->
|
||||||
|
{{#each deep_link_protocols as |protocol| ~}}
|
||||||
|
<RegistryKey Root="HKLM" Key="Software\Classes\\{{protocol}}">
|
||||||
|
<RegistryValue Type="string" Name="URL Protocol" Value=""/>
|
||||||
|
<RegistryValue Type="string" Value="URL:{{bundle_id}} protocol"/>
|
||||||
|
<RegistryKey Key="DefaultIcon">
|
||||||
|
<RegistryValue Type="string" Value=""[!Path]",0" />
|
||||||
|
</RegistryKey>
|
||||||
|
<RegistryKey Key="shell\open\command">
|
||||||
|
<RegistryValue Type="string" Value=""[!Path]" "%1"" />
|
||||||
|
</RegistryKey>
|
||||||
|
</RegistryKey>
|
||||||
|
{{/each~}}
|
||||||
</Component>
|
</Component>
|
||||||
<Component Id="Path" Guid="{{{path_component_guid}}}" Win64="$(var.Win64)">
|
<Component Id="Path" Guid="{{path_component_guid}}" Win64="$(var.Win64)">
|
||||||
<File Id="Path" Source="{{{app_exe_source}}}" KeyPath="yes" Checksum="yes"/>
|
<File Id="Path" Source="{{main_binary_path}}" KeyPath="yes" Checksum="yes"/>
|
||||||
|
{{#each file_associations as |association| ~}}
|
||||||
|
{{#each association.ext as |ext| ~}}
|
||||||
|
<ProgId Id="{{../../product_name}}.{{ext}}" Advertise="yes" Description="{{association.description}}">
|
||||||
|
<Extension Id="{{ext}}" Advertise="yes">
|
||||||
|
<Verb Id="open" Command="Open with {{../../product_name}}" Argument=""%1"" />
|
||||||
|
</Extension>
|
||||||
|
</ProgId>
|
||||||
|
{{/each~}}
|
||||||
|
{{/each~}}
|
||||||
</Component>
|
</Component>
|
||||||
{{#each binaries as |bin| ~}}
|
{{#each binaries as |bin| ~}}
|
||||||
<Component Id="{{ bin.id }}" Guid="{{bin.guid}}" Win64="$(var.Win64)">
|
<Component Id="{{ bin.id }}" Guid="{{bin.guid}}" Win64="$(var.Win64)">
|
||||||
@@ -130,12 +166,12 @@
|
|||||||
<File Id="UpdateTaskUninstaller" Source="uninstall-task.ps1" KeyPath="yes" Checksum="yes"/>
|
<File Id="UpdateTaskUninstaller" Source="uninstall-task.ps1" KeyPath="yes" Checksum="yes"/>
|
||||||
</Component>
|
</Component>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{{resources}}}
|
{{resources}}
|
||||||
<Component Id="CMP_UninstallShortcut" Guid="*">
|
<Component Id="CMP_UninstallShortcut" Guid="*">
|
||||||
|
|
||||||
<Shortcut Id="UninstallShortcut"
|
<Shortcut Id="UninstallShortcut"
|
||||||
Name="Uninstall {{{product_name}}}"
|
Name="Uninstall {{product_name}}"
|
||||||
Description="Uninstalls {{{product_name}}}"
|
Description="Uninstalls {{product_name}}"
|
||||||
Target="[System64Folder]msiexec.exe"
|
Target="[System64Folder]msiexec.exe"
|
||||||
Arguments="/x [ProductCode]" />
|
Arguments="/x [ProductCode]" />
|
||||||
|
|
||||||
@@ -143,7 +179,7 @@
|
|||||||
On="uninstall" />
|
On="uninstall" />
|
||||||
|
|
||||||
<RegistryValue Root="HKCU"
|
<RegistryValue Root="HKCU"
|
||||||
Key="Software\\{{{manufacturer}}}\\{{{product_name}}}"
|
Key="Software\\{{manufacturer}}\\{{product_name}}"
|
||||||
Name="Uninstaller Shortcut"
|
Name="Uninstaller Shortcut"
|
||||||
Type="integer"
|
Type="integer"
|
||||||
Value="1"
|
Value="1"
|
||||||
@@ -154,15 +190,15 @@
|
|||||||
<DirectoryRef Id="ApplicationProgramsFolder">
|
<DirectoryRef Id="ApplicationProgramsFolder">
|
||||||
<Component Id="ApplicationShortcut" Guid="*">
|
<Component Id="ApplicationShortcut" Guid="*">
|
||||||
<Shortcut Id="ApplicationStartMenuShortcut"
|
<Shortcut Id="ApplicationStartMenuShortcut"
|
||||||
Name="{{{product_name}}}"
|
Name="{{product_name}}"
|
||||||
Description="Runs {{{product_name}}}"
|
Description="Runs {{product_name}}"
|
||||||
Target="[!Path]"
|
Target="[!Path]"
|
||||||
Icon="ProductIcon"
|
Icon="ProductIcon"
|
||||||
WorkingDirectory="INSTALLDIR">
|
WorkingDirectory="INSTALLDIR">
|
||||||
<ShortcutProperty Key="System.AppUserModel.ID" Value="{{{bundle_id}}}"/>
|
<ShortcutProperty Key="System.AppUserModel.ID" Value="{{bundle_id}}"/>
|
||||||
</Shortcut>
|
</Shortcut>
|
||||||
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
|
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
|
||||||
<RegistryValue Root="HKCU" Key="Software\\{{{manufacturer}}}\\{{{product_name}}}" Name="Start Menu Shortcut" Type="integer" Value="1" KeyPath="yes"/>
|
<RegistryValue Root="HKCU" Key="Software\\{{manufacturer}}\\{{product_name}}" Name="Start Menu Shortcut" Type="integer" Value="1" KeyPath="yes"/>
|
||||||
</Component>
|
</Component>
|
||||||
</DirectoryRef>
|
</DirectoryRef>
|
||||||
|
|
||||||
@@ -246,7 +282,7 @@
|
|||||||
</Property>
|
</Property>
|
||||||
|
|
||||||
{{#if download_bootstrapper}}
|
{{#if download_bootstrapper}}
|
||||||
<CustomAction Id='DownloadAndInvokeBootstrapper' Directory="INSTALLDIR" Execute="deferred" ExeCommand='powershell.exe -NoProfile -windowstyle hidden try [\{] [\[]Net.ServicePointManager[\]]::SecurityProtocol = [\[]Net.SecurityProtocolType[\]]::Tls12 [\}] catch [\{][\}]; Invoke-WebRequest -Uri "https://go.microsoft.com/fwlink/p/?LinkId=2124703" -OutFile "$env:TEMP\MicrosoftEdgeWebview2Setup.exe" ; Start-Process -FilePath "$env:TEMP\MicrosoftEdgeWebview2Setup.exe" -ArgumentList ({{{webview_installer_args}}} '/install') -Wait' Return='check'/>
|
<CustomAction Id='DownloadAndInvokeBootstrapper' Directory="INSTALLDIR" Execute="deferred" ExeCommand='powershell.exe -NoProfile -windowstyle hidden try [\{] [\[]Net.ServicePointManager[\]]::SecurityProtocol = [\[]Net.SecurityProtocolType[\]]::Tls12 [\}] catch [\{][\}]; Invoke-WebRequest -Uri "https://go.microsoft.com/fwlink/p/?LinkId=2124703" -OutFile "$env:TEMP\MicrosoftEdgeWebview2Setup.exe" ; Start-Process -FilePath "$env:TEMP\MicrosoftEdgeWebview2Setup.exe" -ArgumentList ({{webview_installer_args}} '/install') -Wait' Return='check'/>
|
||||||
<InstallExecuteSequence>
|
<InstallExecuteSequence>
|
||||||
<Custom Action='DownloadAndInvokeBootstrapper' Before='InstallFinalize'>
|
<Custom Action='DownloadAndInvokeBootstrapper' Before='InstallFinalize'>
|
||||||
<![CDATA[NOT(REMOVE OR WVRTINSTALLED)]]>
|
<![CDATA[NOT(REMOVE OR WVRTINSTALLED)]]>
|
||||||
@@ -256,8 +292,8 @@
|
|||||||
|
|
||||||
<!-- Embedded webview bootstrapper mode -->
|
<!-- Embedded webview bootstrapper mode -->
|
||||||
{{#if webview2_bootstrapper_path}}
|
{{#if webview2_bootstrapper_path}}
|
||||||
<Binary Id="MicrosoftEdgeWebview2Setup.exe" SourceFile="{{{webview2_bootstrapper_path}}}"/>
|
<Binary Id="MicrosoftEdgeWebview2Setup.exe" SourceFile="{{webview2_bootstrapper_path}}"/>
|
||||||
<CustomAction Id='InvokeBootstrapper' BinaryKey='MicrosoftEdgeWebview2Setup.exe' Execute="deferred" ExeCommand='{{{webview_installer_args}}} /install' Return='check' />
|
<CustomAction Id='InvokeBootstrapper' BinaryKey='MicrosoftEdgeWebview2Setup.exe' Execute="deferred" ExeCommand='{{webview_installer_args}} /install' Return='check' />
|
||||||
<InstallExecuteSequence>
|
<InstallExecuteSequence>
|
||||||
<Custom Action='InvokeBootstrapper' Before='InstallFinalize'>
|
<Custom Action='InvokeBootstrapper' Before='InstallFinalize'>
|
||||||
<![CDATA[NOT(REMOVE OR WVRTINSTALLED)]]>
|
<![CDATA[NOT(REMOVE OR WVRTINSTALLED)]]>
|
||||||
@@ -267,8 +303,8 @@
|
|||||||
|
|
||||||
<!-- Embedded offline installer -->
|
<!-- Embedded offline installer -->
|
||||||
{{#if webview2_installer_path}}
|
{{#if webview2_installer_path}}
|
||||||
<Binary Id="MicrosoftEdgeWebView2RuntimeInstaller.exe" SourceFile="{{{webview2_installer_path}}}"/>
|
<Binary Id="MicrosoftEdgeWebView2RuntimeInstaller.exe" SourceFile="{{webview2_installer_path}}"/>
|
||||||
<CustomAction Id='InvokeStandalone' BinaryKey='MicrosoftEdgeWebView2RuntimeInstaller.exe' Execute="deferred" ExeCommand='{{{webview_installer_args}}} /install' Return='check' />
|
<CustomAction Id='InvokeStandalone' BinaryKey='MicrosoftEdgeWebView2RuntimeInstaller.exe' Execute="deferred" ExeCommand='{{webview_installer_args}} /install' Return='check' />
|
||||||
<InstallExecuteSequence>
|
<InstallExecuteSequence>
|
||||||
<Custom Action='InvokeStandalone' Before='InstallFinalize'>
|
<Custom Action='InvokeStandalone' Before='InstallFinalize'>
|
||||||
<![CDATA[NOT(REMOVE OR WVRTINSTALLED)]]>
|
<![CDATA[NOT(REMOVE OR WVRTINSTALLED)]]>
|
||||||
@@ -305,6 +341,10 @@
|
|||||||
</InstallExecuteSequence>
|
</InstallExecuteSequence>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
<InstallExecuteSequence>
|
||||||
|
<Custom Action="LaunchApplication" After="InstallFinalize">AUTOLAUNCHAPP AND NOT Installed</Custom>
|
||||||
|
</InstallExecuteSequence>
|
||||||
|
|
||||||
<SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLDIR]" After="CostFinalize"/>
|
<SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLDIR]" After="CostFinalize"/>
|
||||||
</Product>
|
</Product>
|
||||||
</Wix>
|
</Wix>
|
||||||
|
|||||||
Reference in New Issue
Block a user