Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] MSI bundling fails if package.productName contains a period. #9488

Closed
danferns opened this issue Apr 17, 2024 · 5 comments
Closed

[bug] MSI bundling fails if package.productName contains a period. #9488

danferns opened this issue Apr 17, 2024 · 5 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@danferns
Copy link

Describe the bug

If the package.productName value contains a period (eg. app.name), the MSI bundling fails with this error:

Finished release [optimized] target(s) in 16.39s
        Info Target: x64
     Running candle for "main.wxs"
     Running light to produce D:\path\to\project\src-tauri\target\release\bundle\msi\app.name_0.0.0_x64_en-US.msi
       Error failed to bundle project: error running light.exe

(BTW, since it's my first interaction here, I wanna say I really love the Tauri project. Thanks to all the contributors and maintainers who work on it!)

Reproduction

I'm using Windows 10.

  1. Set the package.productName field to contain a period. eg "app.name".
  2. Set tauri.bundle.active to true.
  3. Set tauri.bundle.targets to "all"
  4. Run npm run tauri build in the terminal.

Expected behavior

The build should not throw any errors even at the bundling stage, and the MSI file should be created successfully.

Full tauri info output

[✔] Environment
    - OS: Windows 10.0.19045 X64
    ✔ WebView2: 123.0.2420.97
    ✔ MSVC:
        - Visual Studio Community 2019
        - Visual Studio Community 2022
    ✔ rustc: 1.70.0 (90c541806 2023-05-31)
    ✔ cargo: 1.70.0 (ec8a8a0ca 2023-04-25)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 21.6.1
    - pnpm: 8.6.6
    - npm: 10.2.4

[-] Packages
    - tauri [RUST]: 1.5.4
    - tauri-build [RUST]: 1.5.1
    - wry [RUST]: 0.24.7
    - tao [RUST]: 0.16.6
    - @tauri-apps/api [NPM]: 1.5.3
    - @tauri-apps/cli [NPM]: 1.5.9 (outdated, latest: 1.5.11)

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - framework: React
    - bundler: Vite

Stack trace

No response

Additional context

No response

@danferns danferns added status: needs triage This issue needs to triage, applied to new issues type: bug labels Apr 17, 2024
@FabianLars
Copy link
Member

While i prefer your write up, i will still close it as a duplicate of #8848. Thanks for the report!

@FabianLars FabianLars closed this as not planned Won't fix, can't repro, duplicate, stale Apr 17, 2024
@FabianLars
Copy link
Member

Actually, can you post the logs you get via

npm run tauri build -- --verbose

And if it complains about a .wxs file, ideally include that file too.

@danferns
Copy link
Author

Sorry, somehow missed the first issue. Here is the log:

D:\code\rust\tauri\Clergy-Catalog>npm run tauri build -- --verbose

> clergy-catalog@0.0.0 tauri
> tauri build --verbose     

       Debug [globset] built glob set; 0 literals, 2 basenames, 0 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 0 regexes
       Debug [globset] glob converted to regex: Glob { glob: "**/npm-debug.log*", re: "(?-u)^(?:/?|.*/)npm\\-debug\\.log[^/]*$", opts: GlobOptions { case_insensitive: false, literal_separator: true, backslash_escape: true, empty_alternates: false }, tokens: Tokens([RecursivePrefix, Literal('n'), Literal('p'), Literal('m'), Literal('-'), Literal('d'), Literal('e'), Literal('b'), Literal('u'), Literal('g'), Literal('.'), Literal('l'), Literal('o'), Literal('g'), ZeroOrMore]) }
       Debug [globset] glob converted to regex: Glob { glob: "**/yarn-debug.log*", re: "(?-u)^(?:/?|.*/)yarn\\-debug\\.log[^/]*$", opts: GlobOptions { case_insensitive: false, literal_separator: true, backslash_escape: true, empty_alternates: false }, tokens: Tokens([RecursivePrefix, Literal('y'), Literal('a'), Literal('r'), Literal('n'), Literal('-'), Literal('d'), Literal('e'), Literal('b'), Literal('u'), Literal('g'), Literal('.'), Literal('l'), Literal('o'), Literal('g'), ZeroOrMore]) }
       Debug [globset] glob converted to regex: Glob { glob: "**/yarn-error.log*", re: "(?-u)^(?:/?|.*/)yarn\\-error\\.log[^/]*$", opts: GlobOptions { case_insensitive: false, literal_separator: true, backslash_escape: true, empty_alternates: false }, tokens: Tokens([RecursivePrefix, Literal('y'), Literal('a'), Literal('r'), Literal('n'), Literal('-'), Literal('e'), Literal('r'), Literal('r'), Literal('o'), Literal('r'), Literal('.'), Literal('l'), Literal('o'), Literal('g'), ZeroOrMore]) }
       Debug [globset] glob converted to regex: Glob { glob: "**/pnpm-debug.log*", re: "(?-u)^(?:/?|.*/)pnpm\\-debug\\.log[^/]*$", opts: GlobOptions { case_insensitive: false, literal_separator: true, backslash_escape: true, empty_alternates: false }, tokens: Tokens([RecursivePrefix, Literal('p'), Literal('n'), Literal('p'), Literal('m'), Literal('-'), Literal('d'), Literal('e'), Literal('b'), Literal('u'), Literal('g'), Literal('.'), Literal('l'), Literal('o'), Literal('g'), ZeroOrMore]) }
       Debug [globset] glob converted to regex: Glob { glob: "**/lerna-debug.log*", re: "(?-u)^(?:/?|.*/)lerna\\-debug\\.log[^/]*$", opts: GlobOptions { case_insensitive: false, literal_separator: 
true, backslash_escape: true, empty_alternates: false }, tokens: Tokens([RecursivePrefix, Literal('l'), Literal('e'), Literal('r'), Literal('n'), Literal('a'), Literal('-'), Literal('d'), Literal('e'), Literal('b'), Literal('u'), Literal('g'), Literal('.'), Literal('l'), Literal('o'), Literal('g'), ZeroOrMore]) }
       Debug [globset] glob converted to regex: Glob { glob: ".vscode/*", re: "(?-u)^\\.vscode/[^/]*$", opts: GlobOptions { case_insensitive: false, literal_separator: true, backslash_escape: true, empty_alternates: false }, tokens: Tokens([Literal('.'), Literal('v'), Literal('s'), Literal('c'), Literal('o'), Literal('d'), Literal('e'), Literal('/'), ZeroOrMore]) }
       Debug [globset] glob converted to regex: Glob { glob: "**/*.ntvs*", re: "(?-u)^(?:/?|.*/)[^/]*\\.ntvs[^/]*$", opts: GlobOptions { case_insensitive: false, literal_separator: true, backslash_escape: true, empty_alternates: false }, tokens: Tokens([RecursivePrefix, ZeroOrMore, Literal('.'), Literal('n'), Literal('t'), Literal('v'), Literal('s'), ZeroOrMore]) }
       Debug [globset] glob converted to regex: Glob { glob: "**/*.sw?", re: "(?-u)^(?:/?|.*/)[^/]*\\.sw[^/]$", opts: GlobOptions { case_insensitive: false, literal_separator: true, backslash_escape: true, empty_alternates: false }, tokens: Tokens([RecursivePrefix, ZeroOrMore, Literal('.'), Literal('s'), Literal('w'), Any]) }
       Debug [globset] built glob set; 1 literals, 6 basenames, 5 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 8 regexes
       Debug [globset] built glob set; 1 literals, 0 basenames, 0 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 0 regexes
       Debug [ignore::walk] ignoring D:\code\rust\tauri\Clergy-Catalog\src-tauri\.gitignore: Ignore(IgnoreMatch(Hidden))
       Debug [ignore::walk] ignoring D:\code\rust\tauri\Clergy-Catalog\src-tauri\target: Ignore(IgnoreMatch(Gitignore(Glob { from: Some("D:\\code\\rust\\tauri\\Clergy-Catalog\\src-tauri\\.gitignore"), original: "/target/", actual: "target", is_whitelist: false, is_only_dir: true })))
     Running [tauri_cli::build] beforeBuildCommand `npm run build`
       Debug [tauri_cli::build] Setting environment for hook {"TAURI_PLATFORM_TYPE": "Windows_NT", "TAURI_FAMILY": "windows", "TAURI_PLATFORM_VERSION": "10.0.19045", "TAURI_TARGET_TRIPLE": "x86_64-pc-windows-msvc", "TAURI_ARCH": "x86_64", "TAURI_PLATFORM": "windows"}
     Running [tauri_cli] Command `cmd  /S /C npm run build`

> clergy-catalog@0.0.0 build
> vite build

vite v5.0.12 building for production...
✓ 1234 modules transformed.
dist/index.html                  0.40 kB │ gzip:   0.28 kB
dist/assets/index-L7E5RiIx.js  585.13 kB │ gzip: 182.44 kB

(!) Some chunks are larger than 500 kB after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
✓ built in 5.19s
     Running [tauri_cli] Command `cargo  build --features custom-protocol --release`
   Compiling clergy-catalog v0.0.0 (D:\code\rust\tauri\Clergy-Catalog\src-tauri)
    Finished release [optimized] target(s) in 17.26s
        Info [tauri_bundler::bundle::windows::msi::wix] Target: x64
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("product_name")], "product_name")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("upgrade_code")], "upgrade_code")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("manufacturer")], "manufacturer")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("version")], "version")))
       Debug [handlebars::render] Rendering helper: "if", params: [PathAndJson { relative_path: Some("allow_downgrades"), value: Context(Bool(true), ["allow_downgrades"]) }], hash: {}
       Debug [handlebars::render] Rendering helper: "if", params: [PathAndJson { relative_path: Some("banner_path"), value: Missing }], hash: {}
       Debug [handlebars::render] Rendering helper: "if", params: [PathAndJson { relative_path: Some("dialog_image_path"), value: Missing }], hash: {}
       Debug [handlebars::render] Rendering helper: "if", params: [PathAndJson { relative_path: Some("license"), value: Missing }], hash: {}
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("icon_path")], "icon_path")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("manufacturer")], "manufacturer")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("product_name")], "product_name")))
       Debug [handlebars::render] Rendering helper: "unless", params: [PathAndJson { relative_path: Some("license"), value: Missing }], hash: {}
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("product_name")], "product_name")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("product_name")], "product_name")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("manufacturer")], "manufacturer")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("product_name")], "product_name")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("product_name")], "product_name")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("product_name")], "product_name")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("manufacturer")], "manufacturer")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("product_name")], "product_name")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("path_component_guid")], "path_component_guid")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("app_exe_source")], "app_exe_source")))
       Debug [handlebars::render] Rendering helper: "each", params: [PathAndJson { relative_path: Some("binaries"), value: Context(Array [], ["binaries"]) }], hash: {}
       Debug [handlebars::render] Rendering helper: "if", params: [PathAndJson { relative_path: Some("enable_elevated_update_task"), value: Missing }], hash: {}
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("resources")], "resources")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("product_name")], "product_name")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("product_name")], "product_name")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("manufacturer")], "manufacturer")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("product_name")], "product_name")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("product_name")], "product_name")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("product_name")], "product_name")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("bundle_id")], "bundle_id")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("manufacturer")], "manufacturer")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("product_name")], "product_name")))
       Debug [handlebars::render] Rendering helper: "each", params: [PathAndJson { relative_path: Some("merge_modules"), value: Context(Array [], ["merge_modules"]) }], hash: {}
       Debug [handlebars::render] Rendering helper: "each", params: [PathAndJson { relative_path: Some("resource_file_ids"), value: Context(Array [], ["resource_file_ids"]) }], hash: {}
       Debug [handlebars::render] Rendering helper: "if", params: [PathAndJson { relative_path: Some("enable_elevated_update_task"), value: Missing }], hash: {}
       Debug [handlebars::render] Rendering helper: "each", params: [PathAndJson { relative_path: Some("binaries"), value: Context(Array [], ["binaries"]) }], hash: {}
       Debug [handlebars::render] Rendering helper: "each", params: [PathAndJson { relative_path: Some("component_group_refs"), value: Missing }], hash: {}
       Debug [handlebars::render] Rendering helper: "each", params: [PathAndJson { relative_path: Some("component_refs"), value: Missing }], hash: {}
       Debug [handlebars::render] Rendering helper: "each", params: [PathAndJson { relative_path: Some("feature_group_refs"), value: Missing }], hash: {}
       Debug [handlebars::render] Rendering helper: "each", params: [PathAndJson { relative_path: Some("feature_refs"), value: Missing }], hash: {}
       Debug [handlebars::render] Rendering helper: "each", params: [PathAndJson { relative_path: Some("merge_refs"), value: Missing }], hash: {}
       Debug [handlebars::render] Rendering helper: "if", params: [PathAndJson { relative_path: Some("install_webview"), value: Context(Bool(true), ["install_webview"]) }], hash: {}
       Debug [handlebars::render] Rendering helper: "if", params: [PathAndJson { relative_path: Some("download_bootstrapper"), value: Context(Bool(true), ["download_bootstrapper"]) }], hash: {}    
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("webview_installer_args")], "webview_installer_args")))
       Debug [handlebars::render] Rendering helper: "if", params: [PathAndJson { relative_path: Some("webview2_bootstrapper_path"), value: Missing }], hash: {}
       Debug [handlebars::render] Rendering helper: "if", params: [PathAndJson { relative_path: Some("webview2_installer_path"), value: Missing }], hash: {}
       Debug [handlebars::render] Rendering helper: "if", params: [PathAndJson { relative_path: Some("enable_elevated_update_task"), value: Missing }], hash: {}
     Running [tauri_bundler::bundle::windows::msi::wix] candle for "main.wxs"
     Running [tauri_bundler::bundle::common] Command `C:\Users\Daniel\AppData\Local\tauri/WixTools\candle.exe  -arch x64 main.wxs -dSourceDir=D:\code\rust\tauri\Clergy-Catalog\src-tauri\target\release\clergy.catalog.exe`
Windows Installer XML Toolset Compiler version 3.11.2.4516
Copyright (c) .NET Foundation and contributors. All rights reserved.

main.wxs
     Running [tauri_bundler::bundle::windows::msi::wix] light to produce D:\code\rust\tauri\Clergy-Catalog\src-tauri\target\release\bundle\msi\clergy.catalog_0.0.0_x64_en-US.msi
     Running [tauri_bundler::bundle::common] Command `C:\Users\Daniel\AppData\Local\tauri/WixTools\light.exe  -ext C:\Users\Daniel\AppData\Local\tauri/WixTools\WixUIExtension.dll -ext C:\Users\Daniel\AppData\Local\tauri/WixTools\WixUtilExtension.dll -o D:\code\rust\tauri\Clergy-Catalog\src-tauri\target\release\wix\x64\output.msi -cultures:en-us -loc D:\code\rust\tauri\Clergy-Catalog\src-tauri\target\release\wix\x64\locale.wxl *.wixobj`
Windows Installer XML Toolset Linker version 3.11.2.4516
Copyright (c) .NET Foundation and contributors. All rights reserved.

D:\code\rust\tauri\Clergy-Catalog\src-tauri\target\release\wix\x64\main.wxs(101) : error LGHT0103 : The system cannot find the file 'D:\code\rust\tauri\Clergy-Catalog\src-tauri\target\release\clergy.catalog.exe'.
       Error [tauri_cli_node] failed to bundle project: error running light.exe

main.wxs

<?if $(sys.BUILDARCH)="x86"?>
    <?define Win64 = "no" ?>
    <?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
<?elseif $(sys.BUILDARCH)="x64"?>
    <?define Win64 = "yes" ?>
    <?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?else?>
    <?error Unsupported value of sys.BUILDARCH=$(sys.BUILDARCH)?>
<?endif?>

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product
            Id="*"
            Name="clergy.catalog"
            UpgradeCode="9ecb4cca-950e-5b24-90fa-6eef5fa16644"
            Language="!(loc.TauriLanguage)"
            Manufacturer="clergycatalog"
            Version="0.0.0">

        <Package Id="*"
                 Keywords="Installer"
                 InstallerVersion="450"
                 Languages="0"
                 Compressed="yes"
                 InstallScope="perMachine"
                 SummaryCodepage="!(loc.TauriCodepage)"/>

        <!-- https://docs.microsoft.com/en-us/windows/win32/msi/reinstallmode -->
        <!-- reinstall all files; rewrite all registry entries; reinstall all shortcuts -->
        <Property Id="REINSTALLMODE" Value="amus" />

            <MajorUpgrade Schedule="afterInstallInitialize" AllowDowngrades="yes" />

        <InstallExecuteSequence>
            <RemoveShortcuts>Installed AND NOT UPGRADINGPRODUCTCODE</RemoveShortcuts>
        </InstallExecuteSequence>

        <Media Id="1" Cabinet="app.cab" EmbedCab="yes" />


        <Icon Id="ProductIcon" SourceFile="D:\code\rust\tauri\Clergy-Catalog\src-tauri\target\release\resources\icon.ico"/>
        <Property Id="ARPPRODUCTICON" Value="ProductIcon" />
        <Property Id="ARPNOREPAIR" Value="yes" Secure="yes" />      <!-- Remove repair -->
        <SetProperty Id="ARPNOMODIFY" Value="1" After="InstallValidate" Sequence="execute"/>

        <!-- initialize with previous InstallDir -->
        <Property Id="INSTALLDIR">
            <RegistrySearch Id="PrevInstallDirReg" Root="HKCU" Key="Software\clergycatalog\clergy.catalog" Name="InstallDir" Type="raw"/>
        </Property>

        <!-- launch app checkbox -->
        <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="!(loc.LaunchApp)" />
        <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/>
        <Property Id="WixShellExecTarget" Value="[!Path]" />
        <CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />

        <UI>
            <!-- launch app checkbox -->
            <Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>

            <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />

            <!-- Skip license dialog -->
            <Publish Dialog="WelcomeDlg"
                     Control="Next"
                     Event="NewDialog"
                     Value="InstallDirDlg"
                     Order="2">1</Publish>
            <Publish Dialog="InstallDirDlg"
                     Control="Back"
                     Event="NewDialog"
                     Value="WelcomeDlg"
                     Order="2">1</Publish>
        </UI>

        <UIRef Id="WixUI_InstallDir" />

        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="DesktopFolder" Name="Desktop">
                <Component Id="ApplicationShortcutDesktop" Guid="*">
                    <Shortcut Id="ApplicationDesktopShortcut" Name="clergy.catalog" Description="Runs clergy.catalog" Target="[!Path]" WorkingDirectory="INSTALLDIR" />
                    <RemoveFolder Id="DesktopFolder" On="uninstall" />
                    <RegistryValue Root="HKCU" Key="Software\clergycatalog\clergy.catalog" Name="Desktop Shortcut" Type="integer" Value="1" KeyPath="yes" />
                </Component>
            </Directory>
            <Directory Id="$(var.PlatformProgramFilesFolder)" Name="PFiles">
                <Directory Id="INSTALLDIR" Name="clergy.catalog"/>
            </Directory>
            <Directory Id="ProgramMenuFolder">
                <Directory Id="ApplicationProgramsFolder" Name="clergy.catalog"/>
            </Directory>
        </Directory>

        <DirectoryRef Id="INSTALLDIR">
            <Component Id="RegistryEntries" Guid="*">
                <RegistryKey Root="HKCU" Key="Software\clergycatalog\clergy.catalog">
                    <RegistryValue Name="InstallDir" Type="string" Value="[INSTALLDIR]" KeyPath="yes" />
                </RegistryKey>
            </Component>
            <Component Id="Path" Guid="48407956-7ce5-5446-a03b-519a5b54c96e" Win64="$(var.Win64)">
                <File Id="Path" Source="D:\code\rust\tauri\Clergy-Catalog\src-tauri\target\release\clergy.catalog.exe" KeyPath="yes" Checksum="yes"/>
            </Component>
            
            <Component Id="CMP_UninstallShortcut" Guid="*">

                <Shortcut Id="UninstallShortcut"
						  Name="Uninstall clergy.catalog"
						  Description="Uninstalls clergy.catalog"
						  Target="[System64Folder]msiexec.exe"
						  Arguments="/x [ProductCode]" />

				<RemoveFolder Id="INSTALLDIR"
							  On="uninstall" />

				<RegistryValue Root="HKCU"
							   Key="Software\clergycatalog\clergy.catalog"
							   Name="Uninstaller Shortcut"
							   Type="integer"
							   Value="1"
							   KeyPath="yes" />
            </Component>
        </DirectoryRef>

        <DirectoryRef Id="ApplicationProgramsFolder">
            <Component Id="ApplicationShortcut" Guid="*">
                <Shortcut Id="ApplicationStartMenuShortcut"
                    Name="clergy.catalog"
                    Description="Runs clergy.catalog"
                    Target="[!Path]"
                    Icon="ProductIcon"
                    WorkingDirectory="INSTALLDIR">
                    <ShortcutProperty Key="System.AppUserModel.ID" Value="com.clergycatalog.dev"/>
                </Shortcut>
                <RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
                <RegistryValue Root="HKCU" Key="Software\clergycatalog\clergy.catalog" Name="Start Menu Shortcut" Type="integer" Value="1" KeyPath="yes"/>
           </Component>
        </DirectoryRef>

<Feature
                Id="MainProgram"
                Title="Application"
                Description="!(loc.InstallAppFeature)"
                Level="1"
                ConfigurableDirectory="INSTALLDIR"
                AllowAdvertise="no"
                Display="expand"
                Absent="disallow">

            <ComponentRef Id="RegistryEntries"/>


            <Feature Id="ShortcutsFeature"
                Title="Shortcuts"
                Level="1">
                <ComponentRef Id="Path"/>
                <ComponentRef Id="CMP_UninstallShortcut" />
                <ComponentRef Id="ApplicationShortcut" />
                <ComponentRef Id="ApplicationShortcutDesktop" />
            </Feature>

            <Feature
                Id="Environment"
                Title="PATH Environment Variable"
                Description="!(loc.PathEnvVarFeature)"
                Level="1"
                Absent="allow">
            <ComponentRef Id="Path"/>
</Feature>
        </Feature>

        <Feature Id="External" AllowAdvertise="no" Absent="disallow">
</Feature>

        <!-- WebView2 -->
        <Property Id="WVRTINSTALLED">
            <RegistrySearch Id="WVRTInstalledSystem" Root="HKLM" Key="SOFTWARE\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" Name="pv" Type="raw" Win64="no" />
            <RegistrySearch Id="WVRTInstalledUser" Root="HKCU" Key="SOFTWARE\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" Name="pv" Type="raw"/>
        </Property>

        <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 (&apos;/silent&apos;, &apos;/install&apos;) -Wait' Return='check'/>
        <InstallExecuteSequence>
            <Custom Action='DownloadAndInvokeBootstrapper' Before='InstallFinalize'>
                <![CDATA[NOT(REMOVE OR WVRTINSTALLED)]]>
            </Custom>
        </InstallExecuteSequence>

        <!-- Embedded webview bootstrapper mode -->

        <!-- Embedded offline installer -->



        <SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLDIR]" After="CostFinalize"/>
    </Product>
</Wix>

@FabianLars
Copy link
Member

Thank you. I opened a PR for v1. v2 will be fixed by #9375.

@danferns
Copy link
Author

Thank you too! That was really fast. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

2 participants