On 27 Sep 2007, at 20:03, Kelly Leahy wrote: >
Sorry for resurrecting an *old* old thread... > I think you want something like: > > <CustomAction Id="setJVMpath1" Property="JVMPATH" > Value="[JDKHOME15]" Execute="firstSequence">JDKHOME15 AND NOT > JVMPATH</CustomAction> > <CustomAction Id="setJVMpath2" Property="JVMPATH" > Value="[JREHOME15]" Execute="firstSequence">JREHOME15 AND NOT > JVMPATH</CustomAction> > > <InstallUISequence> > <Custom Action="setJVMpath1" After="AppSearch"/> > <Custom Action="setJVMpath2" After="setJVMpath1"/> > </InstallUISequence> > > <InstallExecuteSequence> > <Custom Action="setJVMpath1" After="AppSearch"/> > <Custom Action="setJVMpath2" After="setJVMpath1"/> > </InstallExecuteSequence> > > of course, with more than just the two actions. > > However, I'm by no means an expert and haven't even tried compiling > this, so it's very possible I'm heading you down the wrong path. To refresh everyone's memory, my installer's trying to set up shortcuts with a target pointing to an installed copy of Java. Multiple instances of Java could be installed simultaneously, so the shortcut needs to be conditional on a series of different registry keys using some search order. Unfortunately MSI doesn't support those sorts of conditions. Kelly's solution basically didn't work for me. As far as I can work out, the text inside a <CustomAction> is only valid if Script="vbscript" or "jscript", which is a different syntax from MSI's normal conditional incantations. After googling a little, I see that folks are being warned off using vbscript or jscript from CustomActions, and as writing a custom action in C or C# *really* felt like overkill for a simple (ha!) problem I figured out another technique. Basically what I've done is to set my 4 properties, one for each registry key to search, and then instead of declaring my shortcuts when I install the files, I create 4 conditional components for each shortcut, making the condition on each one a logical expression like Kelly used above. Each shortcut then uses the appropriate property. On install, only one of the components will get installed depending on which JDK/JRE is present. Ta dah! This works pretty well *except* that if I upgrade Java after installing my package, attempting to repair my package will leave the old components installed and will not install the components referencing the updated Java packages. Is there any way to get a repair to re-evaluate what components are installed? Cheers, Chris ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users