wix - Wix 中的 InstallScope ="perMachine"没有区别

标签 wix windows-installer installation

您好,我需要我的应用程序在管理员模式和所有用户模式下工作。(即)它应该在所有模式下工作。 我已经在 WIX 中创建了设置,经过大量浏览后我开始知道在包中设置 InstallScope="perMachine" 可以使我们的应用程序在所有模式下工作。但我发现只有它在所有登录(管理员或其他用户)的添加\删除程序下显示我们的应用程序。

(ie):我可以在管理员模式下运行我的应用程序,如果我以任何用户身份登录,那么我的应用程序将无法正常运行。它只会出现在添加\删除程序

我的要求是我需要我的应用程序在所有模式下工作,包括管理员、登录和所有用户。

 <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" ></Package>

即使我尝试了 InstallScopeDlg 中的 allUser 选项。 我需要我的应用程序也适用于所有用户,包括管理员

最佳答案

在 Setup.wxs 文件中添加以下行

<Property Id="ALLUSERS" Value="1"></Property>

文件应该是这样的:

<?xml version="1.0"?>  
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*"
         Name="programName"
         Language="1033"
         Version="1.0.0.0"
         UpgradeCode="183CC369-D86F-43B3-99E7-A82A16335E52"
         Manufacturer="CompanyName">
    <Package Description="#Description"
             Comments="Comments"
             InstallerVersion="200"
             Compressed="yes"/>
    <!--
        Source media for the installation. 
        Specifies a single cab file to be embedded in the installer's .msi. 
    -->
    <Media Id="1" Cabinet="contents.cab" EmbedCab="yes" CompressionLevel="high"/>

    <!-- Installation directory and files are defined in Files.wxs -->
    <Directory Id="TARGETDIR" Name="SourceDir"/>

    <Feature Id="Complete"
             Title="programName"
             Description="programName"
             Level="1">
        <ComponentRef Id="programNameFiles"/>
        <ComponentRef Id="programNameRegEntries"/>
    </Feature>

    <!--
        Using the Wix UI library

        WixUI_InstallDir does not allow the user to choose 
        features but adds a dialog to let the user choose a 
        directory where the product will be installed
    -->
    <Property Id="WIXUI_INSTALLDIR">INSTALLDIR</Property>
    <Property Id="ALLUSERS" Value="1"></Property>
    <UIRef Id="WixUI_InstallDir"/>
</Product>

关于wix - Wix 中的 InstallScope ="perMachine"没有区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30484217/

相关文章:

visual-studio-2008 - 我是否应该在每次构建时更改我的 .vdproj 文件中的 ProductCode?

python - 如何在 Ubuntu 12.10 上安装 Google App 引擎?

Android 使用 busybox 命令行安装 apk

wix - 如何为Wix Burn Bootstrapper exepackage添加从属文件夹

xml - WIX 安装程序 : Cannot set more than one appSettings node

c# - 如何安装多个版本的MyProgram(同一台PC,VS2008)?

uwp - UWP 应用安装程序文件中存在本地文件的 URI

c# - 文件计数保存在哪里?

wix - 使用 Burn 有条件卸载包

windows-services - WIX ServiceInstall - 将服务设置为在 NetworkService 帐户下运行