[wix-users] harvesting two folders for the same Wix project - duplicate id issue

Rob Mensching rob at firegiant.com
Sun Apr 25 12:07:10 PDT 2021


> What would be the correct way to handle this situation?

Not an answer but while you can probably fight with heat enough to get it eventually work but we (FireGiant) created our advanced harvesting solution to be much easier to use: https://www.firegiant.com/wix/wep-documentation/harvesting/

Free trial link here: https://www.firegiant.com/products/wix-expansion-pack/


>  Won’t there be any problems when upgrading software with the next version?

Yes, lots of problems. "-cg" should only be used for one off runs of heat. The "-ag" switch should be used for repeatable builds.



-----Original Message-----
From: wix-users <wix-users-bounces at lists.wixtoolset.org> On Behalf Of Vilius Šumskas via wix-users
Sent: Sunday, April 25, 2021 10:39 AM
To: wix-users at lists.wixtoolset.org
Cc: Vilius Šumskas <v.sumskas at advantes.tech>
Subject: [wix-users] harvesting two folders for the same Wix project - duplicate id issue

Hi,

I have a Java project which is built by Java tools into a simple folder which contains 1) stripped down Java JRE, 2) JAR executable (application itself) and 3) couple of config/dll files. Now I want to use Visual Studio 2019 to add this compiled folder to Wix project and generate MSI to make application installation easy.

Since my application is universal and 32 bit version vs 64 bit version differs only in bundled JRE version I would like to include both JRE versions in single MSI and use Condition rules to install them according to VersionNT64 property.

The issue I’m having is how do I harvest both JRE versions for my Wix project? I have tried to just add both JRE folders to VS WIX project as Content but as far as I understood this doesn’t kick in automatic harvesting. The next thing I have tried is to use these pre-build events:

"$(WIX)bin\heat.exe" dir "$(ProjectDir)src\openjdk\jre-32" -gg -sfrag -srd -sw 126 -cg JREComponents -dr JREDIR -out "$(ProjectDir)JRE32.wxs"
"$(WIX)bin\heat.exe" dir "$(ProjectDir)src\openjdk\jre-64" -gg -sfrag -srd -sw 126 -cg JREComponents64 -dr JREDIR -out "$(ProjectDir)JRE64.wxs"

This did generate correct structure for wxs files but unfortunately content IDs for all files and folders are duplicated in both files. When I run these two commands manually in Windows CMD they generate different IDs, so I assume duplicate ID issue is because VS runs both commands at the same time. Unfortunately VS doesn’t support running pre-build events one by one ☹

What would be the correct way to handle this situation? Is unified MSI even possible for both JREs and my application?

Also, I have noticed that component GUIDs change every time I run heat.exe. Is this OK? Won’t there be any problems when upgrading software with the next version? I mean if Component GUID is changed on every compilation, won’t these files/folders be removed and re-added on next MSI upgrade, even if file/folder itself doesn’t change?

Thank you for your answers in advance.

--
   Best Regards,

   Vilius Šumskas


____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/


More information about the wix-users mailing list