Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
wix 3.8静默安装-ui级别2_Wix_Silent_Wix3.8_Silent Installer - Fatal编程技术网

wix 3.8静默安装-ui级别2

wix 3.8静默安装-ui级别2,wix,silent,wix3.8,silent-installer,Wix,Silent,Wix3.8,Silent Installer,我想创建一个WIX安装程序(3.8),它只进行静默安装 我正在使用随附的Wix文件来演示我的问题 在 UILevel=2 UILevel=2 我正在将UI级别设置为2 根据: msdn.microsoft.com/en-us/library/aa372096%28v=vs.85%29.aspx 然后是: " INSTALLUILEVEL_NONE 2完全静默安装。 " 到目前为止还不错。我可以安装“产品”,它只是一个空目录。 当我将产品的版本设置为:version=“1.1.0.0”并希

我想创建一个WIX安装程序(3.8),它只进行静默安装

我正在使用随附的Wix文件来演示我的问题


UILevel=2


UILevel=2
我正在将UI级别设置为2 根据: msdn.microsoft.com/en-us/library/aa372096%28v=vs.85%29.aspx 然后是: " INSTALLUILEVEL_NONE 2完全静默安装。 "

到目前为止还不错。我可以安装“产品”,它只是一个空目录。 当我将产品的版本设置为:version=“1.1.0.0”并希望进行重大升级时,一切正常。 当我看这个程序时,一个来自微软的功能“工具” 如图所示:

我看到了两个版本(版本1.0.0.0和1.1.0.0),这不是我所期望的Wix安装程序应该做的

当我移除

<InstallUISequence>      
  <FindRelatedProducts Before="LaunchConditions">UILevel=2</FindRelatedProducts>                   
</InstallUISequence>

<InstallExecuteSequence>      
    <FindRelatedProducts Before="LaunchConditions">UILevel=2</FindRelatedProducts>      
</InstallExecuteSequence>

UILevel=2
UILevel=2
将Wix脚本更改为1.1.0.0后,从Wix脚本安装版本1.0.0及更高版本 再次进行重大升级,, 我在程序中只看到1个版本(1.1.0.0),这是Microsoft提供的功能“工具” (windows.microsoft.com/en-us/windows/uninstall change program#uninstall change program=windows-7) 这就是我希望windows安装程序应该做的

所以我的问题是: 脚本中有什么遗漏或错误 (微软提供的程序功能“工具”在主要升级后显示2个版本) Wix脚本:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="SetupProject1" Language="1033" Version="1.1.0.0" Manufacturer="asdf" UpgradeCode="BE170BF6-0C06-4A50-B81B-CDF6609FAD5A">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perUser" InstallPrivileges="limited" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." Schedule="afterInstallInitialize" />
    <MediaTemplate />

    <InstallUISequence>      
        <FindRelatedProducts Before="LaunchConditions">UILevel=2</FindRelatedProducts>                   
    </InstallUISequence>

    <InstallExecuteSequence>      
        <FindRelatedProducts Before="LaunchConditions">UILevel=2</FindRelatedProducts>      
    </InstallExecuteSequence>       

    <Feature Id="ProductFeature" Title="SetupProject1" Level="1">
        <ComponentGroupRef Id="ProductComponents" />
    </Feature>
</Product>

<Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="LocalAppDataFolder">
            <Directory Id="INSTALLFOLDER" Name="SetupProject1" />
        </Directory>
    </Directory>
</Fragment>

<Fragment>
    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
    <Component Id="test" Guid="D6527568-4C76-493B-AF1F-9E973723E773"
      SharedDllRefCount="no" KeyPath="no" NeverOverwrite="no" Permanent="no" Transitive="no"
      Win64="no" Location="either">
      <CreateFolder/>
      <RemoveFolder Id="ProductComponents" On="uninstall"/>
      <RegistryValue Root="HKCU" Key="Software\MyFantasyCompany\MyApplicationName" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
    </Component>
    </ComponentGroup>
</Fragment>
</Wix>

UILevel=2
UILevel=2

首先,没有WiX脚本这样的东西。WiX不是命令式编程语言,它是一种声明式语言

您的主要升级失败,因为FindRelatedProducts上的条件评估为false,这意味着它永远无法检测到以前MSI的产品代码,并将其作为升级的一部分删除


如果您真的只想静默安装,为什么不从安装程序中省略UI呢?就我个人而言,我不知道你为什么要这么做,而且它没有遵循既定的最佳实践。

你好,克里斯托弗,谢谢你的回答。我只想像这里所描述的那样部署一个msi包:我将尝试使用以下命令,而不是“UILevel=2 UILevel=2”:。
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="SetupProject1" Language="1033" Version="1.1.0.0" Manufacturer="asdf" UpgradeCode="BE170BF6-0C06-4A50-B81B-CDF6609FAD5A">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perUser" InstallPrivileges="limited" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." Schedule="afterInstallInitialize" />
    <MediaTemplate />

    <InstallUISequence>      
        <FindRelatedProducts Before="LaunchConditions">UILevel=2</FindRelatedProducts>                   
    </InstallUISequence>

    <InstallExecuteSequence>      
        <FindRelatedProducts Before="LaunchConditions">UILevel=2</FindRelatedProducts>      
    </InstallExecuteSequence>       

    <Feature Id="ProductFeature" Title="SetupProject1" Level="1">
        <ComponentGroupRef Id="ProductComponents" />
    </Feature>
</Product>

<Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="LocalAppDataFolder">
            <Directory Id="INSTALLFOLDER" Name="SetupProject1" />
        </Directory>
    </Directory>
</Fragment>

<Fragment>
    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
    <Component Id="test" Guid="D6527568-4C76-493B-AF1F-9E973723E773"
      SharedDllRefCount="no" KeyPath="no" NeverOverwrite="no" Permanent="no" Transitive="no"
      Win64="no" Location="either">
      <CreateFolder/>
      <RemoveFolder Id="ProductComponents" On="uninstall"/>
      <RegistryValue Root="HKCU" Key="Software\MyFantasyCompany\MyApplicationName" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
    </Component>
    </ComponentGroup>
</Fragment>
</Wix>