0

これは私がやろうとしていることの例です:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="SetupProject1" Language="1033" Version="1.0.0.0" Manufacturer="MySoftware" UpgradeCode="d2192e52-f4f6-461c-9d8e-eb66067df09a">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

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

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

<Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
            <Directory Id="INSTALLFOLDER" Name="[Manufacturer] SetupProject1" />
        </Directory>
    </Directory>
</Fragment>

<Fragment>
    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
        <!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
        <!-- <Component Id="ProductComponent"> -->
            <!-- TODO: Insert files, registry keys, and other resources here. -->
        <!-- </Component> -->
  <Component Id="CMP_NEW">
    <File Id="FILE_NEW" Source="New Text Document.txt" KeyPath="yes" />
  </Component>
    </ComponentGroup>
</Fragment>

ProgramFiles で作成したフォルダは[Manufacturer] SetupProject1ではなくMySoftware SetupProject1です。私はそれを正しくしますか?そうでない場合、どうすればいいですか?

4

2 に答える 2

0

変数 $(var.Manufacturer) を作成し、次のように使用します。

次のように定義します。<?define Manufacturer = "MySoftware"?>

<Product Id="*" Name="SetupProject1" Language="1033" Version="1.0.0.0" Manufacturer="$(var.Manufacturer)" UpgradeCode="d2192e52-f4f6-461c-9d8e-eb66067df09a">

<Directory Id="INSTALLFOLDER" Name="$(var.Manufacturer) SetupProject1" />

それは動作します..:)

于 2012-12-25T13:01:36.387 に答える