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

Vilius Šumskas v.sumskas at advantes.tech
Sun Apr 25 12:33:30 PDT 2021


Thank you. Then my next question would be how this GUID auto-generation behave exactly? Let's say I have the same component target path for two different files, one in case MSI is installed on 32bit OS, another - for 64bit OSes. Will these files have the same GUID? Or maybe this is not a problem?

-- 
   Vilius

-----Original Message-----
From: Rob Mensching <rob at firegiant.com> 
Sent: Sunday, April 25, 2021 10:27 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Vilius Šumskas <v.sumskas at advantes.tech>
Subject: RE: harvesting two folders for the same Wix project - duplicate id issue

Sorry, yes, I meant the "-gg" switch (Good Game!) not "-cg".  

The "-ag" switch uses auto-GUIDs which are a special feature of the WiX Toolset where it generates stable GUIDs for Components. Two different builds with the same inputs will generate the same GUID. The "-gg" switch generates new GUIDs each run of heat.

In WiX v4 (and recent WiX v3) builds you can actually leave the Guid attribute off completely, which is the same as "*"... WiX will take care of it for you.

-----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 12:21 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Vilius Šumskas <v.sumskas at advantes.tech>
Subject: Re: [wix-users] harvesting two folders for the same Wix project - duplicate id issue

Thanks. I will check Wix Expansion Pack probably some time next week.

I suppose you have ment "-gg"? I have tried "-ag" option but it just generates "*" for GUIDs. I'm not sure if I understand how this works. Won't this still generate new GUIDs every time the MSI is built?

-- 
   Vilius

-----Original Message-----
From: Rob Mensching <rob at firegiant.com> 
Sent: Sunday, April 25, 2021 10:07 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Vilius Šumskas <v.sumskas at advantes.tech>
Subject: RE: harvesting two folders for the same Wix project - duplicate id issue

> 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/

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


More information about the wix-users mailing list