WiX 创建 setup.exe wxs 文件

问题描述 投票:0回答:1

我已经构建了程序,它存储在 build_artifacts 文件夹中。这是我到目前为止的 wxs 脚本:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="*" Name="BIGProject" Language="1033" Version="1.0.0.0" Manufacturer="Siemens Healthineers AG" UpgradeCode="{65413516516}">
        <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

        <MajorUpgrade DowngradeErrorMessage="A newer version of BIGProject is already installed." />

        <MediaTemplate EmbedCab="yes" />

        <Feature Id="MainExecutable" Title="BIG Project" Level="1">
            <ComponentRef Id="MainExecutable" />
        </Feature>
    </Product>

    <Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder">
                <Directory Id="INSTALLFOLDER" Name="BIGProject" />
            </Directory>
        </Directory>
    </Fragment>

    <Fragment>
        <ComponentGroup Id="MainComponentGroup">
            <Component Id="MainExecutable" Guid="65413517894" Directory="INSTALLFOLDER">
                <File Source="build_artifacts\" KeyPath="yes" />
            </Component>
        </ComponentGroup>
    </Fragment>

    <Fragment>
        <ComponentGroup Id="SigningGroup">
            <Component Id="SignBIGProjectSetup" Guid="PUT-GUID-HERE">
                <File Source="path\to\my\signed\BIGProjectSetup.exe" />
            </Component>
        </ComponentGroup>
    </Fragment>
</Wix>

唯一没有产生错误的工作部分是没有此部分的相同脚本

    <Fragment>
        <ComponentGroup Id="SigningGroup">
            <Component Id="SignBIGProjectSetup" Guid="PUT-GUID-HERE">
                <File Source="path\to\my\signed\BIGProjectSetup.exe" />
            </Component>
        </ComponentGroup>
    </Fragment>

我得到的结果是

BIGProjectSetup.exe
,但是执行这个exe后它说“这个应用程序无法在这台电脑上执行”或类似的东西。我以为是因为缺少标志。

我应该怎么做才能让它发挥作用?

wix digital-signature setup.exe
1个回答
0
投票

Product
的输出应该是 Windows Installer 数据库,又名:MSI 文件。将过滤器扩展从
.exe
更改为
.msi
,我希望它会工作得更好。

© www.soinside.com 2019 - 2024. All rights reserved.