WiX Designer - MergeModules

Add-in Express™ Support Service
That's what is more important than anything else

WiX Designer - MergeModules
WiX Designer is lacking the functionality of adding mergemodules and setting retargetable folder 
Jan Frost




Posts: 24
Joined: 2008-07-01
WiX Designer is lacking the functionality of adding mergemodules and setting retargetable folder.

Adding the mergemodule was easy:

...
<Product ...>
	...
	<Feature Id="MergeModules" Title="MergeModules" Level="1">
		<MergeRef Id="Storage" />
	</Feature>
	...
</Product>
...
<Fragment>
	...
	<Directory Id="TARGETDIR" Name="SourceDir">
		<Directory Id="dir_125D02AA_D4C3_4565_AA7E_8F186C506EF9" Name="MyClient">
			...
			<Merge Id="Storage" SourceFile="..somewhereStorage.msm" DiskId="1" Language="1033" />
			...
		</Directory>
	</Directory>
	...
</Fragment>
...


Setting the retargetable folder is not (easy).
It should be something like modifying the feature node this way:

<Feature Id="MergeModules" Title="MergeModules" Level="1" ConfigurableDirectory="dir_125D02AA_D4C3_4565_AA7E_8F186C506EF9">


The error:

The Feature/@ConfigurableDirectory attribute's value, 'dir_125D02AA_D4C3_4565_AA7E_8F186C506EF9', contains lowercase characters. Since this directory is user-configurable, it needs to be a public property. This means the value must be completely uppercase.
Posted 22 Aug, 2014 02:35:22 Top
Dmitry Kostochko


Add-in Express team


Posts: 2731
Joined: 2004-04-05
Hi Jan,

The current version of WiX Designer does not support adding merge modules via visual editors. Of course, we will add this functionality in one of coming builds.

At the moment you can add merge modules manually. As for the compilation error, please change the folder's ID so that it contains uppercase characters only.
Posted 22 Aug, 2014 05:46:18 Top
JanFrost




Posts: 24
Joined: 2008-07-01
Hi Dmitry,

unfortunately the ConfigurableDirectory parameter is not working as expected. Even if I use a public property (in uppercase) it's not installing the mergemodule in that Directory. Do you have a description of 'retargeting mergemodules'?

Regards,
Jan
Posted 25 Aug, 2014 02:29:05 Top
Dmitry Kostochko


Add-in Express team


Posts: 2731
Joined: 2004-04-05
Hi Jan,

I have never used the ConfigurableDirectory attribute, the Merge and MergeRef elements were enough for me to include a merge module into a WiX setup project and unpack it on a target machine.

The Merge element does the main work, its parent Directory element is used to indicate a parent folder on a target machine that will contain unpacked files. The MergeRef element should be added to a Feature element to include a merge module in a setup project.


...
    <Feature Id="ProductFeature" Title="SetupProjectWithMergeModule" Level="1">
      <ComponentRef Id="comp_617941A5_696D_4A1F_95EB_DFB29214DD2E" />
      <MergeRef Id="MyMergeModule" />
      <ComponentRef Id="comp_DB6DB276_05CA_4E6F_9D96_F4AB9B155383" />
    </Feature>

...

    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="dir_50452EDB_8734_4A89_9C98_96B33A2DABFC" Name="MyFolder">
        <Component Id="comp_617941A5_696D_4A1F_95EB_DFB29214DD2E" Guid="8C2AE017-C25C-4015-A9AF-C4C73B5B670E" Permanent="no" SharedDllRefCount="no" Transitive="no">
          <File Id="_F9ADB9C4_53E5_4DF6_AFFD_94C467703053" DiskId="1" Hidden="no" ReadOnly="no" TrueType="no" System="no" Vital="yes" Name="test.zip" Source="..........	est.zip" KeyPath="yes" />
        </Component>
      </Directory>
      <Directory Id="dir_48DEC414_A8C7_46B5_9926_90F77D725208" Name="MyFolder2">
        <Merge Id="MyMergeModule" DiskId="1" Language="1033" SourceFile="..MergeModule1indebugMergeModule1.msm" />
        <Component Id="comp_DB6DB276_05CA_4E6F_9D96_F4AB9B155383" Guid="07D72B99-E59B-48CD-8A0E-3BE6F6CFB5EF" Permanent="no" SharedDllRefCount="no" Transitive="no">
          <File Id="_5EFB0F23_5E98_47B0_958B_68EDB56376E9" DiskId="1" Hidden="no" ReadOnly="no" TrueType="no" System="no" Vital="yes" Name="MainMenu2.ico" Source="..........MainMenu2.ico" KeyPath="yes" />
        </Component>
      </Directory>
    </Directory>

...


The code above installs the content of the merge module into the MyFolder2 folder.
Posted 25 Aug, 2014 04:43:04 Top
JanFrost




Posts: 24
Joined: 2008-07-01
Hi Dmitry,

sorry, further investigations gave me some details.

The mergemodule(s) I try to install were created with VisualStudio 2010. The file system setup in the mergemodule contains 'Module Retargetable Folder' where the files are in. The property 'DefaultLocation' of that folder says '[TARGETDIR]'.

If I create a new mergemodule with the WiX designer in VisualStudio 2013 the properties of the 'Module Retargetable Folder' look different. The '(Name)' Property is grayed and read only and there is a grayed (read only) property called 'Property' that says 'MergeRedirectFolder'. That mergemodule is installed properly even without giving the ConfigurableDirectory parameter in the feature tag.

Unfortunately I would like to use the old mergemodules but they are fixed installing their files to the TAGETDIR.

Regards,
Jan
Posted 25 Aug, 2014 04:53:51 Top
Dmitry Kostochko


Add-in Express team


Posts: 2731
Joined: 2004-04-05
Hi Jan,

Yes, you are right, merge modules created using Visual Studio differ from MSMs created with WiX. But you can use the old merge modules, you need to specify a target folder by using an additional CustomAction:


...

    <CustomAction Id="DIRCA_TARGETDIR" Property="TARGETDIR" Value="C:Temp_123" Execute="firstSequence" />
    <CustomAction Id="MODULE_TARGETDIR" Property="NEWRETARGETABLEPROPERTY1.A8100CE637E5485FAD90AA5AAB9CCED9" Value="[TARGETDIR]MyFolder2" Execute="firstSequence" />

...

    <Feature Id="ProductFeature" Title="SetupProjectWithMergeModule" Level="1">
      <ComponentRef Id="comp_617941A5_696D_4A1F_95EB_DFB29214DD2E" />

      <MergeRef Id="MyMergeModule" />

      <ComponentRef Id="comp_DB6DB276_05CA_4E6F_9D96_F4AB9B155383" />
    </Feature>
    <InstallExecuteSequence>
      <Custom Action="DIRCA_TARGETDIR" Before="CostInitialize"><![CDATA[TARGETDIR=""]]></Custom>
      <Custom Action="MODULE_TARGETDIR" After="DIRCA_TARGETDIR"><![CDATA[MODULE_TARGETDIR=""]]></Custom>
    </InstallExecuteSequence>
    <InstallUISequence>
      <Custom Action="DIRCA_TARGETDIR" Before="CostInitialize"><![CDATA[TARGETDIR=""]]></Custom>
      <Custom Action="MODULE_TARGETDIR" After="DIRCA_TARGETDIR"><![CDATA[MODULE_TARGETDIR=""]]></Custom>
    </InstallUISequence>
    <AdminUISequence>
      <Custom Action="DIRCA_TARGETDIR" Before="CostInitialize"><![CDATA[TARGETDIR=""]]></Custom>
      <Custom Action="MODULE_TARGETDIR" After="DIRCA_TARGETDIR"><![CDATA[MODULE_TARGETDIR=""]]></Custom>
    </AdminUISequence>

...

      <Directory Id="dir_48DEC414_A8C7_46B5_9926_90F77D725208" Name="MyFolder2">
        <!-- 
        <Merge Id="MyMergeModule" DiskId="1" Language="1033" SourceFile="..MergeModule1indebugMergeModule1.msm" />
        -->
        <Merge Id="MyMergeModule" DiskId="1" Language="1033" SourceFile="....VSSetupWithMergeModuleMergeModule1DebugMergeModule1.msm" />



Please pay attention to the NEWRETARGETABLEPROPERTY1.A8100CE637E5485FAD90AA5AAB9CCED9 property. The first part is the ID of an Retargetable Folder contained in your old merge module. It will be NEWRETARGETABLEPROPERTY1 for the first Retargetable Folder, NEWRETARGETABLEPROPERTY2 for the second and so on.

The second part of the property is the ID of your old merge module. You can find its value in the ModuleSignature property of your old merge module project in Visual Studio 2010.


I can send you my test projects if you wish.
Posted 25 Aug, 2014 06:09:06 Top
JanFrost




Posts: 24
Joined: 2008-07-01
Hi Dmitry,

that did the trick! Thank you very much!

Regards,
Jan
Posted 25 Aug, 2014 07:37:00 Top
Dmitry Kostochko


Add-in Express team


Posts: 2731
Joined: 2004-04-05
Hi Jan,

Thank you for keeping us informed. Good luck with your project!
Posted 25 Aug, 2014 07:48:29 Top