Trying to get multiple instance to work, it's not putting each instance in own folder

66 views Asked by At

Trying to get multiple instance to work, how do I get the variable of ProductName to be the name of the directory based on the instance? The following snippet appears below in the complete code.

<Directory Id="ProductName">

I'm using the following link as a guide:
https://sklyarenko.net/posts/revisited-multiple-instance-and-patches

I've tried the following:

msiexec /i MultiInstance.msi MSINEWINSTANCE=1 TRANSFORMS=":I02"
msiexec /i MultiInstance.msi MSINEWINSTANCE=1 TRANSFORMS=":I03"

And it just gets copied to same folder structure.

    <?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <?define ConsoleApp1_TargetDir=$(var.ConsoleApp1.TargetDir)?>
    <Product Id="*" Name="SetupProject1" Language="1033" Version="1.0.0.0" Manufacturer="Tester" UpgradeCode="4ca5374e-c85c-4d75-8ca3-bfdcc63a6605">
        <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

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

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

        <Property Id="INSTANCEID" Value="WhereDoesValueShowUp" Admin="yes" />

        <InstanceTransforms Property="INSTANCEID">
            <Instance Id="I01" ProductCode="{3E3B77E8-B74A-4BD0-A426-DF48C47AF188}" ProductName="My Product 01"/>
            <Instance Id="I02" ProductCode="{17D21A60-4DAF-4640-8271-52FAF88435C7}" ProductName="My Product 02"/>
            <Instance Id="I03" ProductCode="{2240F420-9892-45EF-9809-326095D6AFE4}" ProductName="My Product 03"/>
        </InstanceTransforms>
    </Product>


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

    <Fragment>
        <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
            <Component Id="ConsoleApp1.runtimeconfig.json" Guid="7933cc56-e6ee-42be-9022-ec4eee3b2ad7" MultiInstance="yes">
                <File Id="ConsoleApp1.runtimeconfig.json" Name="ConsoleApp1.runtimeconfig.json" Source="$(var.ConsoleApp1_TargetDir)ConsoleApp1.runtimeconfig.json" KeyPath="yes" />
            </Component>
            <Component Id="ConsoleApp1.dll" Guid="75ed96b5-a187-46aa-9def-69e475f06bd7" MultiInstance="yes">
                <File Id="ConsoleApp1.dll" Name="ConsoleApp1.dll" Source="$(var.ConsoleApp1_TargetDir)ConsoleApp1.dll" KeyPath="yes" />
            </Component>
            <Component Id="ConsoleApp1.exe" Guid="{F4665DAB-DD96-4A06-9E0E-D58765F4A3B9}" MultiInstance="yes">
                <File Id="ConsoleApp1.exe" Name="ConsoleApp1.exe" Source="$(var.ConsoleApp1_TargetDir)ConsoleApp1.exe" KeyPath="yes" />
            </Component>
        </ComponentGroup>
    </Fragment>
</Wix>
0

There are 0 answers