mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 03:46:05 +08:00
Attempt to set file associations and fire-wall exceptions.
The fire-wall exceptions work, but the device needs to be restarted. Is that worth it? A more important problem is that windows overhauled the file associations a few years ago. The approach here doesn't work (but is at least consistent with how it worked before, so it might work for Windows < 10 or unupdated). The current go-to approach is the one used by firefox, and it happens after the installer, at first start-up of the program. part of CURA-9157
This commit is contained in:
parent
ddd7ac58b0
commit
5b8bac6a61
@ -27,7 +27,6 @@
|
||||
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
|
||||
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
|
||||
</Control>
|
||||
<Control Id="DesktopShortcutCheckBox" Type="CheckBox" X="20" Y="160" Width="290" Height="17" Property="PREVIOUS_VERSIONS_INSTALLED" CheckBoxValue="0" Text="Uninstall previous Cura versions." />
|
||||
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.CustomizeDlgBannerBitmap)" />
|
||||
<Control Id="Text" Type="Text" X="25" Y="55" Width="320" Height="20" Text="!(loc.CustomizeDlgText)" />
|
||||
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
|
||||
@ -41,6 +40,7 @@
|
||||
<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="Location" Type="Text" X="90" Y="210" Width="200" Height="20" Text="!(loc.CustomizeDlgLocation)">
|
||||
<Subscribe Event="SelectionPath" Attribute="Text" />
|
||||
<Subscribe Event="SelectionPathOn" Attribute="Visible" />
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:fw="http://schemas.microsoft.com/wix/FirewallExtension">
|
||||
<Product
|
||||
Id="*"
|
||||
Name="{{ app_name }}"
|
||||
@ -14,7 +14,7 @@
|
||||
Manufacturer="{{ company }}"
|
||||
Description="UltiMaker Cura the most popular 3D printing slicer"
|
||||
Keywords="UltiMaker,Cura,3D,printing,slicer"
|
||||
Comments="Copyright (c) {{ year }} UltiMaker" />
|
||||
Comments="Copyright (c) {{ year }} UltiMaker B.V." />
|
||||
|
||||
<InstallExecuteSequence>
|
||||
<RemoveExistingProducts Before="InstallInitialize" />
|
||||
@ -88,23 +88,40 @@
|
||||
|
||||
<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-->
|
||||
|
||||
<ProgId Id="PRG_UltiMaker_Cura" Description="{{ app_name }}" Icon="ICO_Cura" Advertise="yes">
|
||||
<Extension Id="stl">
|
||||
<Verb Id='open' Command="[APPLICATIONFOLDER]{{ main_app }}" Argument='"%1"' />
|
||||
<MIME Advertise="yes" ContentType="application/stl" Default="yes" />
|
||||
</Extension>
|
||||
<Extension Id="3mf">
|
||||
<Verb Id='open' Command="[APPLICATIONFOLDER]{{ main_app }}" Argument='"%1"' />
|
||||
<MIME Advertise="yes" ContentType="application/3mf" Default="yes" />
|
||||
<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" />
|
||||
|
||||
<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" />
|
||||
|
||||
<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" />
|
||||
<!--TODO: add firewall exception, see: https://wixtoolset.org/docs/v3/xsd/firewall/firewallexception/-->
|
||||
|
||||
<!-- 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>
|
||||
|
||||
<!--Shortcuts-->
|
||||
@ -113,7 +130,7 @@
|
||||
<Shortcut Id="SHRT_Cura"
|
||||
Name="{{ app_name }} {{ version }}"
|
||||
Description="{{ app_name }} {{ version }}"
|
||||
Target="[APPLICATIONFOLDER]{{ main_app }}"
|
||||
Target="[APPLICATIONFOLDER]\{{ main_app }}"
|
||||
Icon="ICO_Cura" />
|
||||
<Shortcut Id="SHRT_UninstallShortcut"
|
||||
Name="Uninstall {{ app_name }} {{ version }}"
|
||||
|
@ -87,13 +87,17 @@ def build(dist_path: Path, filename: str):
|
||||
"-out", f"{heat_loc.as_posix()}"]
|
||||
subprocess.call(heat_command)
|
||||
|
||||
build_command = ["candle", "-arch", "x64", f"-dCuraDir={dist_loc}\\", "-out", f"{build_loc.as_posix()}\\",
|
||||
build_command = ["candle", "-arch", "x64", f"-dCuraDir={dist_loc}\\",
|
||||
"-ext", "WixFirewallExtension",
|
||||
"-out", f"{build_loc.as_posix()}\\",
|
||||
f"{wxs_loc.as_posix()}", f"{heat_loc.as_posix()}", f"{manageoldcuradlg_loc.as_posix()}"]
|
||||
subprocess.call(build_command)
|
||||
|
||||
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')}", "-ext", "WixUIExtension",
|
||||
f"{build_loc.joinpath(manageoldcuradlg_loc.name).with_suffix('.wixobj')}",
|
||||
"-ext", "WixUIExtension",
|
||||
"-ext", "WixFirewallExtension",
|
||||
"-out", f"{work_loc.joinpath(filename.name)}"]
|
||||
subprocess.call(link_command)
|
||||
|
||||
@ -106,6 +110,6 @@ if __name__ == "__main__":
|
||||
help="Filename of the exe (e.g. 'UltiMaker-Cura-5.1.0-beta-Windows-X64.msi')")
|
||||
parser.add_argument("name", type=str, help="App name (e.g. 'UltiMaker Cura')")
|
||||
args = parser.parse_args()
|
||||
generate_wxs(args.source_path, args.dist_path, args.filename, args.name)
|
||||
cleanup_artifacts(args.dist_path)
|
||||
build(args.dist_path, args.filename)
|
||||
generate_wxs(args.source_path.resolve(), args.dist_path.resolve(), args.filename.resolve(), args.name)
|
||||
cleanup_artifacts(args.dist_path.resolve())
|
||||
build(args.dist_path.resolve(), args.filename)
|
||||
|
Loading…
x
Reference in New Issue
Block a user