Browse Source

Merge branch 'Ultimaker:main' into master

Duarte Bragadesto 2 years ago
parent
commit
63a1994e75

+ 2 - 1
.github/workflows/conan-recipe-version.yml

@@ -134,7 +134,8 @@ jobs:
                                 version = tools.Version(tag)
                             except ConanException:
                                 continue
-                            if version > latest_branch_version:
+                            if version > latest_branch_version and latest_branch_version < tools.Version("10.0.0"):
+                                # FIXME: stupid old Cura tags 13.04 etc. keep popping up
                                 latest_branch_version = version
                                 latest_branch_tag = repo.tag(tag)
                         

+ 29 - 5
.github/workflows/cura-all-installers.yml

@@ -1,5 +1,5 @@
 name: Cura All Installers
-run-name: ${{ inputs.cura_conan_version }} for Windows ${{ inputs.build_windows }}, MacOS ${{ inputs.build_macos }}, Linux ${{ inputs.build_linux }}
+run-name: ${{ inputs.cura_conan_version }} for exe ${{ inputs.build_windows_exe }}, msi ${{ inputs.build_windows_msi }}, dmg ${{ inputs.build_macos }}, appimage ${{ inputs.build_linux }}
 
 on:
     workflow_dispatch:
@@ -34,8 +34,13 @@ on:
                 default: true
                 required: true
                 type: boolean
-            build_windows:
-                description: 'Build for Windows'
+            build_windows_exe:
+                description: 'Build for Windows exe'
+                default: false
+                required: true
+                type: boolean
+            build_windows_msi:
+                description: 'Build for Windows msi'
                 default: true
                 required: true
                 type: boolean
@@ -55,8 +60,23 @@ on:
     - cron: '25 3 * * 1-5'
 
 jobs:
-    windows-installer-create:
-        if: ${{ inputs.build_windows }}
+    windows-installer-create-exe:
+        if: ${{ inputs.build_windows_exe }}
+        uses: ./.github/workflows/cura-installer.yml
+        with:
+            platform: 'windows-2022'
+            os_name: 'win64'
+            cura_conan_version: ${{ inputs.cura_conan_version }}
+            conan_args: ${{ inputs.conan_args }}
+            conan_config: ${{ inputs.conan_config }}
+            enterprise: ${{ inputs.enterprise }}
+            staging: ${{ inputs.staging }}
+            installer: ${{ inputs.installer }}
+            msi_installer: false
+        secrets: inherit
+
+    windows-installer-create-msi:
+        if: ${{ inputs.build_windows_msi }}
         uses: ./.github/workflows/cura-installer.yml
         with:
             platform: 'windows-2022'
@@ -67,6 +87,7 @@ jobs:
             enterprise: ${{ inputs.enterprise }}
             staging: ${{ inputs.staging }}
             installer: ${{ inputs.installer }}
+            msi_installer: true
         secrets: inherit
 
     linux-installer-create:
@@ -81,6 +102,7 @@ jobs:
             enterprise: ${{ inputs.enterprise }}
             staging: ${{ inputs.staging }}
             installer: ${{ inputs.installer }}
+            msi_installer: false
         secrets: inherit
 
     linux-modern-installer-create:
@@ -95,6 +117,7 @@ jobs:
             enterprise: ${{ inputs.enterprise }}
             staging: ${{ inputs.staging }}
             installer: ${{ inputs.installer }}
+            msi_installer: false
         secrets: inherit
 
     macos-installer-create:
@@ -109,4 +132,5 @@ jobs:
             enterprise: ${{ inputs.enterprise }}
             staging: ${{ inputs.staging }}
             installer: ${{ inputs.installer }}
+            msi_installer: false
         secrets: inherit

+ 50 - 13
.github/workflows/cura-installer.yml

@@ -44,6 +44,11 @@ on:
                 default: true
                 required: true
                 type: boolean
+            msi_installer:
+                description: 'Create the msi'
+                default: false
+                required: true
+                type: boolean
 
 env:
     CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }}
@@ -61,6 +66,8 @@ env:
     MACOS_CERT_USER: ${{ secrets.MACOS_CERT_USER }}
     GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
     MACOS_CERT_PASSPHRASE: ${{ secrets.MACOS_CERT_PASSPHRASE }}
+    WIN_CERT_INSTALLER_CER: ${{ secrets.WIN_CERT_INSTALLER_CER }}
+    WIN_CERT_INSTALLER_CER_PASS: ${{ secrets.WIN_CERT_INSTALLER_CER_PASS }}
     CURA_CONAN_VERSION: ${{ inputs.cura_conan_version }}
     ENTERPRISE: ${{ inputs.enterprise }}
     STAGING: ${{ inputs.staging }}
@@ -126,14 +133,14 @@ jobs:
                     echo "APPIMAGETOOL_LOCATION=$GITHUB_WORKSPACE/appimagetool" >> $GITHUB_ENV
 
             -   name: Install GCC-12 on ubuntu-22.04
-                if: ${{ startsWith(inputs.runs_on, 'ubuntu-22.04') }}
+                if: ${{ startsWith(inputs.platform, 'ubuntu-22.04') }}
                 run: |
                     sudo apt install g++-12 gcc-12 -y
                     sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12
                     sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12
 
             -   name: Use GCC-10 on ubuntu-20.04
-                if: ${{ startsWith(inputs.runs_on, 'ubuntu-20.04') }}
+                if: ${{ startsWith(inputs.platform, 'ubuntu-20.04') }}
                 run: |
                     sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
                     sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
@@ -153,16 +160,23 @@ jobs:
                     p12-file-base64: ${{ secrets.MACOS_CERT_P12 }}
                     p12-password: ${{ secrets.MACOS_CERT_PASSPHRASE }}
 
-            -   name: Clean Conan local cache
-                if: ${{ inputs.conan_clean_local_cache }}
-                run: conan remove "*" -f
+            -   name: Create PFX certificate from BASE64_PFX_CONTENT secret
+                if: ${{ runner.os == 'Windows' }}
+                id: create-pfx
+                env:
+                    PFX_CONTENT: ${{ secrets.WIN_CERT_INSTALLER_CER }}
+                run: |
+                    $pfxPath = Join-Path -Path $env:RUNNER_TEMP -ChildPath "cert.pfx"; 
+                    $encodedBytes = [System.Convert]::FromBase64String($env:PFX_CONTENT); 
+                    Set-Content $pfxPath -Value $encodedBytes -AsByteStream;
+                    echo "PFX_PATH=$pfxPath" >> $env:GITHUB_OUTPUT;
 
             -   name: Get Conan configuration from branch
-                if: ${{ inputs.conan_config_branch != '' }}
-                run: conan config install https://github.com/Ultimaker/conan-config.git -a "-b ${{ inputs.conan_config_branch }}"
+                if: ${{ inputs.conan_config != '' }}
+                run: conan config install https://github.com/Ultimaker/conan-config.git -a "-b ${{ inputs.conan_config }}"
 
             -   name: Get Conan configuration
-                if: ${{ inputs.conan_config_branch == '' }}
+                if: ${{ inputs.conan_config == '' }}
                 run: conan config install https://github.com/Ultimaker/conan-config.git
 
             -   name: Create the Packages (Bash)
@@ -182,6 +196,7 @@ jobs:
             -   name: Set Environment variables for Cura (Powershell)
                 if: ${{ runner.os == 'Windows' }}
                 run: |
+                    echo "${Env:WIX}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
                     .\cura_inst\Scripts\activate_github_actions_env.ps1
                     .\cura_inst\Scripts\activate_github_actions_version_env.ps1
 
@@ -215,28 +230,50 @@ jobs:
                 run: pyinstaller ./cura_inst/UltiMaker-Cura.spec
 
             -   name: Archive the artifacts (bash)
-                if: ${{ github.event.inputs.installer == 'false' && runner.os != 'Windows' }}
+                if: ${{ !inputs.installer && runner.os != 'Windows' }}
                 run: tar -zcf "./UltiMaker-Cura-$CURA_VERSION_FULL-${{ inputs.os_name }}.tar.gz" "./UltiMaker-Cura/"
                 working-directory: dist
 
             -   name: Archive the artifacts (Powershell)
-                if: ${{ github.event.inputs.installer == 'false' && runner.os == 'Windows' }}
+                if: ${{ !inputs.installer && runner.os == 'Windows' }}
                 run: Compress-Archive -Path ".\UltiMaker-Cura" -DestinationPath ".\UltiMaker-Cura-$Env:CURA_VERSION_FULL-${{ inputs.os_name }}.zip"
                 working-directory: dist
 
             -   name: Create the Windows exe installer (Powershell)
-                if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Windows' }}
+                if: ${{ inputs.installer && runner.os == 'Windows' && !inputs.msi_installer }}
                 run: |
                     python ..\cura_inst\packaging\NSIS\create_windows_installer.py ../cura_inst . "UltiMaker-Cura-$Env:CURA_VERSION_FULL-${{ inputs.os_name }}.exe"
                 working-directory: dist
 
+            -   name: Create the Windows msi installer (Powershell)
+                if: ${{ inputs.installer && runner.os == 'Windows' && inputs.msi_installer }}
+                run: |
+                    python ..\cura_inst\packaging\msi\create_windows_msi.py ..\cura_inst .\UltiMaker-Cura "UltiMaker-Cura-$Env:CURA_VERSION_FULL-${{ inputs.os_name }}.msi" "$Env:CURA_APP_NAME"
+                working-directory: dist
+
+            -   name: Sign the Windows exe installer (Powershell)
+                if: ${{ inputs.installer && runner.os == 'Windows' && !inputs.msi_installer }}
+                env:
+                    PFX_PATH: ${{ steps.create-pfx.outputs.PFX_PATH }}
+                run: |
+                    & "C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe" sign /f $Env:PFX_PATH /p "$Env:WIN_CERT_INSTALLER_CER_PASS" /fd SHA256 /t http://timestamp.digicert.com "UltiMaker-Cura-$Env:CURA_VERSION_FULL-${{ inputs.os_name }}.exe"
+                working-directory: dist
+
+            -   name: Sign the Windows msi installer (Powershell)
+                if: ${{ inputs.installer && runner.os == 'Windows' && inputs.msi_installer }}
+                env:
+                    PFX_PATH: ${{ steps.create-pfx.outputs.PFX_PATH }}
+                run: |
+                    & "C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe" sign /f $Env:PFX_PATH /p "$Env:WIN_CERT_INSTALLER_CER_PASS" /fd SHA256 /t http://timestamp.digicert.com "UltiMaker-Cura-$Env:CURA_VERSION_FULL-${{ inputs.os_name }}.msi"
+                working-directory: dist
+
             -   name: Create the Linux AppImage (Bash)
-                if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Linux' }}
+                if: ${{ inputs.installer && runner.os == 'Linux' }}
                 run: python ../cura_inst/packaging/AppImage/create_appimage.py ./UltiMaker-Cura $CURA_VERSION_FULL "UltiMaker-Cura-$CURA_VERSION_FULL-${{ inputs.os_name }}.AppImage"
                 working-directory: dist
 
             -   name: Create the MacOS dmg (Bash)
-                if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Macos' }}
+                if: ${{ inputs.installer && runner.os == 'Macos' }}
                 run: python ../cura_inst/packaging/dmg/dmg_sign_noterize.py ../cura_inst . "UltiMaker-Cura-$CURA_VERSION_FULL-${{ inputs.os_name }}.dmg"
                 working-directory: dist
 

+ 9 - 1
conanfile.py

@@ -85,6 +85,12 @@ class CuraConan(ConanFile):
     def _enterprise(self):
         return self.options.enterprise in ["True", 'true']
 
+    @property
+    def _app_name(self):
+        if self._enterprise:
+            return str(self.options.display_name) + " Enterprise"
+        return str(self.options.display_name)
+
     @property
     def _cloud_api_root(self):
         return "https://api-staging.ultimaker.com" if self._staging else "https://api.ultimaker.com"
@@ -161,7 +167,7 @@ class CuraConan(ConanFile):
         with open(Path(location, "CuraVersion.py"), "w") as f:
             f.write(cura_version_py.render(
                 cura_app_name = self.name,
-                cura_app_display_name = self.options.display_name,
+                cura_app_display_name = self._app_name,
                 cura_version = cura_version,
                 cura_build_type = "Enterprise" if self._enterprise else "",
                 cura_debug_mode = self.options.cura_debug_mode,
@@ -425,11 +431,13 @@ echo "CURA_VERSION_MINOR={{ cura_version_minor }}" >> ${{ env_prefix }}GITHUB_EN
 echo "CURA_VERSION_PATCH={{ cura_version_patch }}" >> ${{ env_prefix }}GITHUB_ENV
 echo "CURA_VERSION_BUILD={{ cura_version_build }}" >> ${{ env_prefix }}GITHUB_ENV
 echo "CURA_VERSION_FULL={{ cura_version_full }}" >> ${{ env_prefix }}GITHUB_ENV
+echo "CURA_APP_NAME={{ cura_app_name }}" >> ${{ env_prefix }}GITHUB_ENV
         """).render(cura_version_major = cura_version.major,
                     cura_version_minor = cura_version.minor,
                     cura_version_patch = cura_version.patch,
                     cura_version_build = cura_version.build if cura_version.build != "" else "0",
                     cura_version_full = self.version,
+                    cura_app_name = self._app_name,
                     env_prefix = env_prefix)
 
         ext = ".sh" if self.settings.os != "Windows" else ".ps1"

+ 8 - 6
cura/Machines/Models/UserChangesModel.py

@@ -118,12 +118,14 @@ class UserChangesModel(ListModel):
                     if original_value is not None:
                         break
 
-                item_to_add = {"key": setting_key,
-                               "label": label,
-                               "user_value": str(user_changes.getProperty(setting_key, "value")),
-                               "original_value": str(original_value),
-                               "extruder": "",
-                               "category": category_label}
+                item_to_add = {
+                    "key": setting_key,
+                    "label": label,
+                    "user_value": str(user_changes.getProperty(setting_key, "value", default_value_resolve_context)),
+                    "original_value": str(original_value),
+                    "extruder": "",
+                    "category": category_label,
+                }
 
                 if stack != global_stack:
                     item_to_add["extruder"] = stack.getName()

+ 6 - 1
packaging/AppImage/AppRun

@@ -17,4 +17,9 @@ export OPENSSL_CONF="$scriptdir/openssl.cnf"
 # unset `QT_STYLE_OVERRIDE` as a precaution
 unset QT_STYLE_OVERRIDE
 
-$scriptdir/UltiMaker-Cura "$@"
+BIN=`basename "$ARGV0" .AppImage`
+if [ -f $scriptdir/$BIN ]; then
+    $scriptdir/$BIN "$@"
+else
+    $scriptdir/UltiMaker-Cura "$@"
+fi;

+ 56 - 0
packaging/msi/CustomizeCuraDlg.wxs

@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
+
+
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+    <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="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>
+                    <Condition Action="disable">Installed</Condition>
+                </Control>
+                <Control Id="Reset" Type="PushButton" X="10" Y="243" Width="81" Height="17" Text="!(loc.CustomizeDlgReset)">
+                    <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)">
+                    <Publish Event="SpawnDialog" Value="DiskCostDlg">1</Publish>
+                    <Subscribe Event="SelectionNoItems" Attribute="Enabled" />
+                </Control>
+                <Control Id="Back" Type="PushButton" X="192" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
+                <Control Id="Next" Type="PushButton" X="248" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)">
+                    <Subscribe Event="SelectionNoItems" Attribute="Enabled" />
+                </Control>
+                <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="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" />
+                <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)">
+                    <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="Location" Type="Text" X="90" Y="210" Width="200" Height="20" Text="!(loc.CustomizeDlgLocation)">
+                    <Subscribe Event="SelectionPath" Attribute="Text" />
+                    <Subscribe Event="SelectionPathOn" Attribute="Visible" />
+                    <Condition Action="hide">Installed</Condition>
+                </Control>
+                <Control Id="LocationLabel" Type="Text" X="25" Y="210" Width="65" Height="10" Text="!(loc.CustomizeDlgLocationLabel)">
+                    <Subscribe Event="SelectionPathOn" Attribute="Visible" />
+                    <Condition Action="hide">Installed</Condition>
+                </Control>
+            </Dialog>
+        </UI>
+    </Fragment>
+</Wix>

+ 37 - 0
packaging/msi/ExcludeComponents.xslt

@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet
+        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+        xmlns:wix="http://schemas.microsoft.com/wix/2006/wi"
+        xmlns="http://schemas.microsoft.com/wix/2006/wi"
+        version="1.0"
+        exclude-result-prefixes="xsl wix" >
+
+    <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
+    <xsl:strip-space elements="*"/>
+
+    <!--
+    Find all <Component> elements with <File> elements with Source="" attributes ending in ".exe" and tag it with the "ExeToRemove" key.
+
+    <Component Id="cmpSYYKP6B1M7WSD5KLEQ7PZW4YLOPYG61L" Directory="INSTALLDIR" Guid="*">
+        <File Id="filKUS7ZRMJ0AOKDU6ATYY6IRUSR2ECPDFO" KeyPath="yes" Source="!(wix.StagingAreaPath)\ProofOfPEqualsNP.exe" />
+    </Component>
+
+    Because WiX's Heat.exe only supports XSLT 1.0 and not XSLT 2.0 we cannot use `ends-with( haystack, needle )` (e.g. `ends-with( wix:File/@Source, '.exe' )`...
+    ...but we can use this longer `substring` expression instead (see https://github.com/wixtoolset/issues/issues/5609 )
+    -->
+    <xsl:key
+            name="ExeToRemove"
+            match="wix:Component[ substring( wix:File/@Source, string-length( wix:File/@Source ) - 3 ) = '.exe' ]"
+            use="@Id"
+    /> <!-- Get the last 4 characters of a string using `substring( s, len(s) - 3 )`, it uses -3 and not -4 because XSLT uses 1-based indexes, not 0-based indexes. -->
+
+    <!-- By default, copy all elements and nodes into the output... -->
+    <xsl:template match="@*|node()">
+        <xsl:copy>
+            <xsl:apply-templates select="@*|node()"/>
+        </xsl:copy>
+    </xsl:template>
+
+    <!-- ...but if the element has the "ExeToRemove" key then don't render anything (i.e. removing it from the output) -->
+    <xsl:template match="*[ self::wix:Component or self::wix:ComponentRef ][ key( 'ExeToRemove', @Id ) ]"/>
+</xsl:stylesheet>

+ 158 - 0
packaging/msi/UltiMaker-Cura.wxs.jinja

@@ -0,0 +1,158 @@
+<?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="*"
+        Name="{{ app_name }}"
+        Language="1033"
+        Version="{{ version_major }}.{{ version_minor }}.{{ version_patch }}"
+        Manufacturer="{{ company }}"
+        UpgradeCode="{{ upgrade_code }}"
+    >
+        <Package 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." />
+
+        <InstallExecuteSequence>
+            <RemoveExistingProducts Before="InstallInitialize" />
+        </InstallExecuteSequence>
+
+        <Property Id="PREVIOUS_VERSIONS_INSTALLED" Secure="yes" Value="{{ 1 if "Enterpise" in app_name else 0 }}" />
+        <Upgrade Id="{{ upgrade_code }}">
+            <UpgradeVersion
+                Minimum="4.13.2" Maximum="{{ version_major }}.{{ version_minor }}.{{ version_patch }}"
+                Property="PREVIOUS_VERSIONS_INSTALLED"
+                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 %}
+        <Property Id="PREVIOUS_413_INSTALLED" Secure="yes" />
+        <Upgrade Id="53C603BB-2B17-4206-A609-29C2E0D0B0AE">
+            <UpgradeVersion
+                Minimum="1.0.0" Maximum="4.13.2"
+                Property="PREVIOUS_413_INSTALLED"
+                IncludeMinimum="yes" IncludeMaximum="yes"
+            />
+        </Upgrade>
+        {% endif %}
+
+        <Condition Message= "OS must be Windows 8.1 64bit or higher.">
+            <![CDATA[Installed OR VersionNT64 >= 600]]>
+        </Condition>
+
+        <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
+
+        <UI Id="MyWixUI_Mondo">
+            <UIRef Id="WixUI_Mondo" />
+
+            <DialogRef Id="CustomizeCuraDlg" />
+
+            <Publish Dialog="SetupTypeDlg" Control="CustomButton" Event="NewDialog" Value="CustomizeCuraDlg">1</Publish>
+
+            <Publish Dialog="CustomizeCuraDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="1">WixUI_InstallMode = "Change"</Publish>
+            <Publish Dialog="CustomizeCuraDlg" Control="Back" Event="NewDialog" Value="SetupTypeDlg" Order="2">WixUI_InstallMode = "InstallCustom"</Publish>
+            <Publish Dialog="CustomizeCuraDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
+
+            <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeCuraDlg" Order="1">WixUI_InstallMode = "InstallCustom"</Publish>
+            <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeCuraDlg" Order="3">WixUI_InstallMode = "Change"</Publish>
+            <Publish Dialog="MaintenanceTypeDlg" Control="ChangeButton" Event="NewDialog" Value="CustomizeCuraDlg">1</Publish>
+
+        </UI>
+        <UIRef Id="WixUI_ErrorProgressText" />
+
+        <WixVariable Id="WixUILicenseRtf" Value="{{ cura_license_file }}" />
+        <WixVariable Id="WixUIDialogBmp" Value="{{ cura_banner_side }}" />
+        <WixVariable Id="WixUIBannerBmp" Value="{{ cura_banner_top }}" />
+
+        <Icon Id="ICO_Cura" SourceFile="{{ cura_icon }}" />
+        <Property Id="ARPPRODUCTICON" Value="ICO_Cura" />
+
+        <!--Directory structure-->
+        <Directory Id="TARGETDIR" Name="SourceDir">
+           <Directory Id="ProgramFiles64Folder">
+               <Directory Id="APPLICATIONFOLDER" Name="{{ app_name }} {{ version }}" />
+               <Directory Id="ProgramMenuFolder">
+                   <Directory Id="ShortCutDir" Name="{{ app_name }}" />
+               </Directory>
+           </Directory>
+        </Directory>
+
+        <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-->
+
+			<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" />
+
+			<!-- 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-->
+        <DirectoryRef Id="ShortCutDir">
+            <Component Id="CMP_Shortcuts" Guid="{{ shortcut_uuid }}">
+                <Shortcut Id="SHRT_Cura"
+                          Name="{{ app_name }} {{ version }}"
+                          Description="{{ app_name }} {{ version }}"
+                          Target="[APPLICATIONFOLDER]\{{ main_app }}"
+                          Icon="ICO_Cura"  />
+                <Shortcut Id="SHRT_UninstallShortcut"
+                          Name="Uninstall {{ app_name }} {{ version }}"
+                          Description= "Uninstalls {{ app_name }} {{ version }}"
+                          Target="[System64Folder]msiexec.exe"
+                          Arguments="/x [ProductCode]" />
+                <RemoveFolder Id="RemoveMyShortcutsDir"
+                              On="uninstall" />
+                <RegistryValue Root="HKCU"
+                               Key="Software\{{ company }}\{{ app_name }}"
+                               Name="installed"
+                               Type="integer"
+                               Value="1"
+                               KeyPath="yes" />
+            </Component>
+        </DirectoryRef>
+
+        <Feature Id="ProductFeature" Title="{{ app_name }}" Level="1">
+            <ComponentRef Id="CMP_UltiMaker_Cura_exe" />
+            <ComponentRef Id="CMP_CuraEngine_exe" />
+            <ComponentGroupRef Id="NewFilesGroup" />
+            <ComponentRef Id="CMP_Shortcuts" />
+        </Feature>
+    </Product>
+</Wix>

BIN
packaging/msi/banner_side.bmp


Some files were not shown because too many files changed in this diff