首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >单包创作

单包创作
EN

Stack Overflow用户
提问于 2015-06-10 16:22:54
回答 1查看 538关注 0票数 0

我正在尝试使用下面的教程- http://www.egoroff.spb.ru/blog/62003.html创建单个包创作安装

主要wix文件如下:

代码语言:javascript
复制
<?xml version='1.0' encoding='windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
  <Product Name='Foobar 1.0' Id='GUID' UpgradeCode='GUID'
    Language='1033' Codepage='1252' Version='1.0.0' Manufacturer='Acme Ltd.'>

    <Package Id='*' Keywords='Installer' Description="Acme's Foobar 1.0 Installer"
      Comments='Foobar is a registered trademark of Acme Ltd.' Manufacturer='Acme Ltd.'
      InstallerVersion='100' Languages='1033' Compressed='yes' SummaryCodepage='1252' />

    <Property Id="ALLUSERS" Secure="yes" Value="2" />
    <Property Id="MSIINSTALLPERUSER" Secure="yes" Value="1" />
    <Property Id='ApplicationFolderName' Value="Acme" />
    <Property Id='WixAppFolder' Value="WixPerUserFolder" />

    <Media Id='1' Cabinet='Sample.cab' EmbedCab='yes' DiskPrompt="CD-ROM #1" />
    <Property Id='DiskPrompt' Value="Acme's Foobar 1.0 Installation [1]" />

    <Directory Id='TARGETDIR' Name='SourceDir'>
      <Directory Id='ProgramFilesFolder' Name='PFiles'>
        <Directory Id='Acme' Name='Acme'>
          <Directory Id='INSTALLDIR' Name='Foobar 1.0'>

            <Component Id='MainExecutable' Guid='GUID'>
              <File Id='FoobarEXE' Name='FoobarAppl10.exe' DiskId='1' Source='FoobarAppl10.exe' KeyPath='yes'>
                <Shortcut Id="startmenuFoobar10" Directory="ProgramMenuDir" Name="Foobar 1.0" WorkingDirectory='INSTALLDIR' Icon="Foobar10.exe" IconIndex="0" Advertise="yes" />
              </File>
            </Component>

          </Directory>
        </Directory>
      </Directory>

      <Directory Id="ProgramMenuFolder" Name="Programs">
        <Directory Id="ProgramMenuDir" Name="Foobar 1.0">
          <Component Id="ProgramMenuDir" Guid="GUID">
            <RemoveFolder Id='ProgramMenuDir' On='uninstall' />
            <RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Value='' KeyPath='yes' />
          </Component>
        </Directory>
      </Directory>
    </Directory>

    <Feature Id='Complete' Title='Foobar 1.0' Description='The complete package.'
      Display='expand' Level='1' ConfigurableDirectory='INSTALLDIR'>
      <Feature Id='MainProgram' Title='Program' Description='The main executable.' Level='1'>
        <ComponentRef Id='MainExecutable' />
        <ComponentRef Id='ProgramMenuDir' />
      </Feature>
    </Feature>

    <Icon Id="Foobar10.exe" SourceFile="FoobarAppl10.exe" />

    <UI Id="MyWixUI_Mondo">
      <UIRef Id="WixUI_MySetup" />
    </UI>

  </Product>
</Wix>

根据本教程,如果应用程序将由普通用户安装,则将安装“每个用户”,如果应用程序将由管理员安装,则应安装“每台计算机”。

在我的例子中,如果我以普通用户的身份运行msi文件,那么每个用户都会安装这个测试应用程序。

但是,如果我“以管理员身份”运行cmd.exe,然后运行从该管理员的cmd.exe应用程序创建的msi文件,那么应用程序将再次安装到每个用户,而不是每台机器。

我应该如何在每台机器上安装应用程序?

我应该在wxs代码中更改一些内容吗?

还是应该使用其他方法来安装我的应用程序?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-06-10 16:35:44

尝试在ALLUSERS=1命令行上设置msiexec.exe。这将为所有用户生成具有共享快捷方式的每台计算机安装:

代码语言:javascript
复制
msiexec.exe /i File.msi ALLUSERS=1 

这与"安装上下文“这一更大的问题有关。请参阅链接的MSDN文档。

推荐链接

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30762018

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档