Merge pull request #14260 from Ultimaker/CURA-9157

Cura 9157
This commit is contained in:
Casper Lamboo 2023-01-11 14:18:22 +01:00 committed by GitHub
commit 5d4b6a0249
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 62 additions and 49 deletions

View File

@ -64,7 +64,7 @@ try:
if CuraAppDisplayName == "":
CuraAppDisplayName = DEFAULT_CURA_DISPLAY_NAME
if IsEnterpriseVersion:
CuraAppDisplayName = CuraAppDisplayName + " Enterprise"
CuraAppDisplayName = CuraAppDisplayName
except ImportError:
CuraAppDisplayName = DEFAULT_CURA_DISPLAY_NAME

View File

@ -6,7 +6,7 @@
<Fragment>
<UI>
<Dialog Id="CustomizeCuraDlg" Width="370" Height="270" Title="!(loc.CustomizeDlg_Title)" TrackDiskSpace="yes">
<Control Id="Tree" Type="SelectionTree" X="25" Y="85" Width="175" Height="115" Property="_BrowseProperty" Sunken="yes" TabSkip="no" Text="!(loc.CustomizeDlgTree)" />
<Control Id="Tree" Type="SelectionTree" X="25" Y="85" Width="175" Height="95" Property="_BrowseProperty" Sunken="yes" TabSkip="no" Text="!(loc.CustomizeDlgTree)" />
<Control Id="Browse" Type="PushButton" X="294" Y="210" Width="66" Height="17" Text="!(loc.CustomizeDlgBrowse)">
<Publish Event="SelectionBrowse" Value="BrowseDlg">1</Publish>
<Condition Action="hide">Installed</Condition>
@ -16,7 +16,7 @@
<Publish Event="Reset" Value="0">1</Publish>
<Subscribe Event="SelectionNoItems" Attribute="Enabled" />
</Control>
<Control Id="DiskCost" Type="PushButton" X="91" Y="243" Width="100" Height="17" Text="!(loc.CustomizeDlgDiskCost)">
<Control Id="DiskCost" Type="PushButton" X="91" Y="243" Width="80" Height="17" Text="!(loc.CustomizeDlgDiskCost)">
<Publish Event="SpawnDialog" Value="DiskCostDlg">1</Publish>
<Subscribe Event="SelectionNoItems" Attribute="Enabled" />
</Control>
@ -33,14 +33,14 @@
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.CustomizeDlgDescription)" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="210" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.CustomizeDlgTitle)" />
<Control Id="Box" Type="GroupBox" X="210" Y="81" Width="150" Height="118" />
<Control Id="ItemDescription" Type="Text" X="215" Y="90" Width="131" Height="50" Text="!(loc.CustomizeDlgItemDescription)">
<Control Id="Box" Type="GroupBox" X="210" Y="81" Width="150" Height="88" />
<Control Id="ItemDescription" Type="Text" X="215" Y="90" Width="131" Height="30" Text="!(loc.CustomizeDlgItemDescription)">
<Subscribe Event="SelectionDescription" Attribute="Text" />
</Control>
<Control Id="ItemSize" Type="Text" X="215" Y="140" Width="131" Height="50" Text="!(loc.CustomizeDlgItemSize)">
<Subscribe Event="SelectionSize" Attribute="Text" />
</Control>
<Control Id="UninstallPreviousCheckBox" Type="CheckBox" X="10" Y="210" Width="290" Height="17" Property="PREVIOUS_VERSIONS_INSTALLED" CheckBoxValue="0" Text="Uninstall previous Cura versions." />
<Control Id="UninstallPreviousCheckBox" Type="CheckBox" X="25" Y="190" Width="290" Height="17" Property="PREVIOUS_VERSIONS_INSTALLED" CheckBoxValue="0" Text="Uninstall previous Cura versions." />
<Control Id="Location" Type="Text" X="90" Y="210" Width="200" Height="20" Text="!(loc.CustomizeDlgLocation)">
<Subscribe Event="SelectionPath" Attribute="Text" />
<Subscribe Event="SelectionPathOn" Attribute="Visible" />

View File

@ -1,26 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:fw="http://schemas.microsoft.com/wix/FirewallExtension">
<Product
Id="*"
Id="{{ product_code }}"
Name="{{ app_name }}"
Language="1033"
Version="{{ version_major }}.{{ version_minor }}.{{ version_patch }}"
Manufacturer="{{ company }}"
UpgradeCode="{{ upgrade_code }}"
>
<Package InstallerVersion="500"
<Package
Id="*"
InstallerVersion="500"
Compressed="yes"
InstallScope="perMachine"
Manufacturer="{{ company }}"
Description="UltiMaker Cura the most popular 3D printing slicer"
Keywords="UltiMaker,Cura,3D,printing,slicer"
Comments="Copyright (c) {{ year }} UltiMaker B.V." />
Comments="Copyright (c) {{ year }} {{ company }}" />
<InstallExecuteSequence>
<RemoveExistingProducts Before="InstallInitialize" />
</InstallExecuteSequence>
<Property Id="PREVIOUS_VERSIONS_INSTALLED" Secure="yes" Value="{{ 1 if "Enterpise" in app_name else 0 }}" />
<Property Id="PREVIOUS_VERSIONS_INSTALLED" Secure="yes" Value="{{ 1 if "Enterprise" in app_name else 0 }}" />
<Upgrade Id="{{ upgrade_code }}">
<UpgradeVersion
Minimum="4.13.2" Maximum="{{ version_major }}.{{ version_minor }}.{{ version_patch }}"
@ -28,10 +30,8 @@
IncludeMinimum="no" IncludeMaximum="no"
/>
</Upgrade>
<!--TODO: handle copy of configuration of previous version-->
<!--TODO: handle removal of old configuration once previous version is uninstalled-->
{% if "Enterpise" in app_name %}
{% if "Enterprise" in app_name %}
<Property Id="PREVIOUS_413_INSTALLED" Secure="yes" />
<Upgrade Id="53C603BB-2B17-4206-A609-29C2E0D0B0AE">
<UpgradeVersion
@ -86,43 +86,53 @@
<Property Id="ApplicationFolderName" Value="{{ app_name }} {{ version }}" />
<Property Id="WixAppFolder" Value="WixPerMachineFolder" />
<Component Id="CMP_UltiMaker_Cura_exe" Directory="APPLICATIONFOLDER" Guid="*">
<File Id="FILE_UltiMaker_Cura_exe" KeyPath="yes" Source="$(var.CuraDir)\{{ main_app }}"/>
<!--Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\PackageRepository\Extensions\windows.fileTypeAssociation\.3mf-->
<Component Id="CMP_UltiMaker_Cura_exe" Directory="APPLICATIONFOLDER" Guid="*">
<File Id="FILE_UltiMaker_Cura_exe" KeyPath="yes" Source="$(var.CuraDir)\{{ main_app }}" />
<RegistryValue Root="HKLM" Key="SOFTWARE\{{ app_name }}\Capabilities\FileAssociations" Name=".3mf" Value="PRG_UltiMaker_Cura.3MF" Type="string" />
<RegistryValue Root="HKLM" Key="SOFTWARE\{{ app_name }}\Capabilities\FileAssociations" Name=".stl" Value="PRG_UltiMaker_Cura.STL" Type="string" />
<RegistryValue Root="HKLM" Key="SOFTWARE\{{ app_name }}\Capabilities\MIMEAssociations" Name="application/3mf" Value="PRG_UltiMaker_Cura.3MF" Type="string" />
<RegistryValue Root="HKLM" Key="SOFTWARE\{{ app_name }}\Capabilities\MIMEAssociations" Name="application/stl" Value="PRG_UltiMaker_Cura.STL" Type="string" />
<RegistryValue Root="HKLM" Key="SOFTWARE\{{ app_name }}\Capabilities\shell\Open\command" Value='"[APPLICATIONFOLDER]\{{ main_app }}" "%1"' Type="string" />
<RegistryValue Root="HKLM" Key="SOFTWARE\RegisteredApplications" Name="{{ app_name }}" Value="SOFTWARE\MyApp\Capabilities" Type="string" />
<ProgId Id="Cura" Description="{{ app_name }}" Icon="ICO_Cura" Advertise="yes">
<ProgId Id="3mf" Advertise="yes">
<Extension Id="3mf" ContentType="application/3mf">
<Verb Id="open_3mf" Command="Open" Argument='"%1"' />
<MIME Advertise="yes" ContentType="application/3mf" Default="yes" />
</Extension>
</ProgId>
<ProgId Id="stl" Advertise="yes">
<Extension Id="stl" ContentType="application/stl">
<Verb Id="open_stl" Command="Open" Argument='"%1"' />
<MIME Advertise="yes" ContentType="application/stl" Default="yes" />
</Extension>
</ProgId>
<ProgId Id="gcode" Advertise="yes">
<Extension Id="gcode" ContentType="text/x-gcode">
<Verb Id="open_gcode" Command="Open" Argument='"%1"' />
<MIME Advertise="yes" ContentType="text/x-gcode" Default="yes" />
</Extension>
</ProgId>
<ProgId Id="ufp" Advertise="yes">
<Extension Id="ufp" ContentType="application/x-ufp">
<Verb Id="open_ufp" Command="Open" Argument='"%1"' />
<MIME Advertise="yes" ContentType="application/x-ufp" Default="yes" />
</Extension>
</ProgId>
<ProgId Id="curapackage" Advertise="yes">
<Extension Id='curapackage' ContentType='application/curapackage'>
<Verb Id='open_curapackage' Command="Open" Argument='"%1"' />
<MIME Advertise="yes" ContentType="application/curapackage" Default="yes" />
</Extension>
</ProgId>
</ProgId>
<RegistryValue Root="HKLM" Key="SOFTWARE\Classes\Applications\{{ main_app }}\SupportedTypes" Name=".3mf" Value="" Type="string" />
<RegistryValue Root="HKLM" Key="SOFTWARE\Classes\Applications\{{ main_app }}\SupportedTypes" Name=".stl" Value="" Type="string" />
<RegistryValue Root="HKLM" Key="SOFTWARE\Classes\Applications\{{ main_app }}\shell\open" Name="{{ app_name }}" Value="{{ main_app }}" Type="string" />
<fw:FirewallException Id="FirewallExceptLocalFrontend" Name="Cura (Frontend) Connection (LocalHost)" File="FILE_UltiMaker_Cura_exe" IgnoreFailure="yes">
<fw:RemoteAddress>127.0.0.1</fw:RemoteAddress>
</fw:FirewallException>
</Component>
<Component Id="CMP_CuraEngine_exe" Directory="APPLICATIONFOLDER" Guid="*">
<File Id="FILE_CuraEngine_exe" KeyPath="yes" Source="$(var.CuraDir)\CuraEngine.exe" />
<ProgId Id="PRG_UltiMaker_Cura.STL" Description="{{ app_name }}" Icon="FILE_UltiMaker_Cura_exe">
<Extension Id="STL">
<Verb Id='edit' TargetFile="FILE_UltiMaker_Cura_exe" Argument='"%1"' />
<MIME ContentType="application/stl" Default="yes" />
</Extension>
</ProgId>
<ProgId Id="PRG_UltiMaker_Cura.3MF" Description="{{ app_name }}" Icon="FILE_UltiMaker_Cura_exe">
<Extension Id="3MF">
<Verb Id='edit' TargetFile="FILE_UltiMaker_Cura_exe" Argument='"%1"' />
<MIME ContentType="application/3mf" Default="yes" />
</Extension>
</ProgId>
<!-- Current Cura versions are not supported on XP or Server 2003. Even so, add 'ignorefailure=yes'. After all, worst that can happen is the user gets asked, like before. -->
<fw:FirewallException Id="FirewallExceptLocalFrontend" Name="Cura (Frontend) Connection (LocalHost)" File="FILE_CuraEngine_exe" Port="127.0.0.1" IgnoreFailure="yes" Scope="localSubnet" />
</Component>
<Component Id="CMP_CuraEngine_exe" Directory="APPLICATIONFOLDER" Guid="*">
<File Id="FILE_CuraEngine_exe" KeyPath="yes" Source="$(var.CuraDir)\CuraEngine.exe" />
<!-- Current Cura versions are not supported on XP or Server 2003. Even so, add 'ignorefailure=yes'. After all, worst that can happen is the user gets asked, like before. -->
<fw:FirewallException Id="FirewallExceptLocalEngine" Name="CuraEngine (Backend) Connection (LocalHost)" File="FILE_CuraEngine_exe" Port="127.0.0.1" IgnoreFailure="yes" Scope="localSubnet" />
</Component>
<fw:FirewallException Id="FirewallExceptLocalEngine" Name="CuraEngine (Backend) Connection (LocalHost)" File="FILE_CuraEngine_exe" IgnoreFailure="yes">
<fw:RemoteAddress>127.0.0.1</fw:RemoteAddress>
</fw:FirewallException>
</Component>
<!--Shortcuts-->
<DirectoryRef Id="ShortCutDir">
@ -140,7 +150,7 @@
<RemoveFolder Id="RemoveMyShortcutsDir"
On="uninstall" />
<RegistryValue Root="HKCU"
Key="Software\{{ company }}\{{ app_name }}"
Key="Software\{{ company }}\{{ app_name }}\{{ version }}"
Name="installed"
Type="integer"
Value="1"
@ -148,7 +158,7 @@
</Component>
</DirectoryRef>
<Feature Id="ProductFeature" Title="{{ app_name }}" Level="1">
<Feature Id="ProductFeature" Title="{{ app_name }}" Level="1" ConfigurableDirectory="APPLICATIONFOLDER">
<ComponentRef Id="CMP_UltiMaker_Cura_exe" />
<ComponentRef Id="CMP_CuraEngine_exe" />
<ComponentGroupRef Id="NewFilesGroup" />

View File

@ -40,6 +40,7 @@ def generate_wxs(source_path: Path, dist_path: Path, filename: Path, app_name: s
company="UltiMaker",
web_site="https://ultimaker.com",
year=datetime.now().year,
product_code=str(uuid.uuid5(uuid.NAMESPACE_DNS, app_name + os.environ.get("CURA_VERSION_MAJOR") + os.environ.get("CURA_VERSION_MINOR"))),
upgrade_code=str(uuid.uuid5(uuid.NAMESPACE_DNS, app_name)),
shortcut_uuid=str(uuid.uuid5(uuid.NAMESPACE_DNS, f"Shortcut {app_name}")),
cura_license_file=str(source_loc.joinpath("packaging", "msi", "cura_license.rtf")),
@ -96,6 +97,8 @@ def build(dist_path: Path, filename: Path):
link_command = ["light", f"{build_loc.joinpath(wxs_loc.name).with_suffix('.wixobj')}",
f"{build_loc.joinpath(heat_loc.name).with_suffix('.wixobj')}",
f"{build_loc.joinpath(manageoldcuradlg_loc.name).with_suffix('.wixobj')}",
"-sw1076",
"-dcl:high",
"-ext", "WixUIExtension",
"-ext", "WixFirewallExtension",
"-out", f"{work_loc.joinpath(filename.name)}"]