English 中文(简体)
在WIX Install,根据指挥线安装文件
原标题:Conditionally install files based on Command Line Argument during WIX Install

我想要在轮椅安装期间安装文件,条件是是否确定了指挥线参数。

例如,我有以下档案,只有悬挂德国航天中心国旗时才安装。

    <Component Id="file.pdb" Guid="SOME-GUID">
       <Condition>DEBUG</Condition>
       <File Id="file.pdb" Source="file.pdb" KeyPath="yes" Vital="no" />
    </Component>

我增加了DEBUG的财产,并从指挥线读取。 尽管档案从未安装,但我很抱歉为什么安装?

最佳回答

解决这个问题。 下面是解释我做了什么错误,以及我是如何解决的。

我创建了一台安装器(msi),并使用以下三重线动力启动安装机。

msiexec -i prog.msi DEBUGPROPERTY=True

我有几套单元与组件合并,这些单元将视这些财产是否被设定而安装,这些单元正像这样注入它们的财产。

<Merge
    Id="SomeID"
    Language="1033"
    SourceFile="Module.msm"
    DiskId="1">
    <ConfigurationData
      Name="debugProperty"
      Value="[DEBUGPROPERTY]" />

What I was missing was in the merge modules (.msm) i needed the following code

    <Configuration Name= debugProperty  Format= Text  DefaultValue= [DEBUGPROPERTY] />
    <Substitution Table= CustomAction  Row= setDebugProperty  Column= Target  Value= [=debugProperty] />
    <CustomAction Id= setDebugProperty  Property= DEBUGPROPERTY  Value= [DEBUGPROPERTY] />

    <InstallExecuteSequence>
            <Custom Action= setDebugProperty  Before="LaunchConditions">1</Custom>
    </InstallExecuteSequence>

这使我能够进入该单元内的DEBUGPROPERTY,从而限制在安装时间上是否安装了档案。

<Component Id="File.pdb" Guid="SOME-GUID">
    <Condition>DEBUGPROPERTY</Condition>
    <File Id="File.pdb" Source="File.pdb" KeyPath="yes" Vital="no" />
</Component>

This now works, and allows me to install .pdb files during an install if i include this argument.

问题回答

暂无回答




相关问题
Correct place to install demostration projects?

With the new Windows 7 restrictions (well, new to Windows Vista anyways), we can no longer install demo projects to %ProgramFilesFolder%OurApplicationdemo since restricted users will not be able to ...

.deb package conffiles problem

I am distributing one of my applications using a .deb package, but have a problem relating to one of the files. The distribution includes a database file which is constantly updated by the app, on a ...

Closing an application using WiX

In creating my WiX installer I have run into an issue when trying to close an application before installing the upgrade. Below is an example of how I am attempting to do this. <util:...

VS 2005 Setup - HKCU

I am trying to fix an existing application that uses a Visual Studio 2005 setup project. We are requiring it to work on limited user accounts for XP, our app is written in C# for .Net 2.0. It writes ...

Do I want Publish or Release Build in VB.net?

I wrote a little (like 40 lines little) Winforms application with VB.net in Visual Studio 2010. Now I ve released the code as a Google Code project. It s easy for a developer to get the source but I d ...

configsource and installer

I have an project csproj, with app.config file, and logging Ent.Library section using configsource attribute. The logging section is in ahother file Configloggingconfiguration.config. I have a ...

热门标签