[wix-users] harvesting two folders for the same Wix project - duplicate id issue
Vilius Šumskas
v.sumskas at advantes.tech
Sun Apr 25 10:39:05 PDT 2021
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
More information about the wix-users
mailing list