Yep, after a number of trials and errors, this was bang on. For the record (and anyone in the future trying to do something similar), here's the snippet I ended up with:
<Component Id='compMyExe' Guid='XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'> <File Id='fileMyExe' Name='my.exe' DiskId='1' Source='my.exe' KeyPath='yes' /> </Component> ... <Component Id='compMyExeConfig' Guid='XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'> <File Id='fileMyExeConfig' Name='MyExeConf.ini' DiskId='1' Source='somePath/'MyExeConf.ini' KeyPath='yes' /> </Component> ... <!-- Sliently install my.exe (with elevated privileges; Execute="deferred", see http://wix.sourceforge.net/manual-wix3/qtexec.htm ) --> <CustomAction Id="Set_cmdInstallMyExe " Property="cmdInstallMyExe" Value=""[#fileMyExe]" -install ]"[#fileMyExeConfig] ]"" /> <CustomAction Id="cmdInstallMyExe" Execute="deferred" BinaryKey="WixCA" DllEntry="CAQuietExec" Return="check" Impersonate="no" /> <InstallExecuteSequence> <Custom Action="Set_cmdInstallMyExe" After="CostFinalize" /> <Custom Action="cmdInstallMyExe" After="InstallServices" /> </InstallExecuteSequence> Thanks, Alain -----Original Message----- From: Hoover, Jacob [mailto:jacob.hoo...@greenheck.com] Sent: March 7, 2013 19:39 To: <afor...@cmu.edu>; General discussion for Windows Installer XML toolset. Cc: wix-users@lists.sourceforge.net Subject: Re: [WiX-users] "Formatted strings" not being formatted Use a CA to set the value of the property at runtime right before scheduling the deferred CA. You might even be able to assign the property the value of itself so it evaluates it at runtime. Deferred CA's are special as they only have access to the limited data you explicitly send to them (and a subset of standard props). Sent from my iPhone On Mar 7, 2013, at 6:22 PM, "Alain Forget" <afor...@cmu.edu> wrote: > Hi all, > > This page ( > http://wix.tramontana.co.hu/tutorial/com-expression-syntax-miscellanea/formatted-strings > ) suggests that [#fileId] can be used in a string to get the path where that file is installed. > > However, when I try using them like this... > > <Component Id='compMyExe' Guid='XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'> > <File Id='fileMyExe' Name='my.exe' DiskId='1' Source='my.exe' > KeyPath='yes' /> </Component> ... > <Component Id='compMyExeConfig' > Guid='XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'> > <File Id='fileMyExeConfig' Name='MyExeConf.ini' DiskId='1' > Source='somePath/'MyExeConf.ini' KeyPath='yes' /> > </Component> > ... > <!-- Sliently install my.exe (with elevated privileges; > Execute="deferred", see > http://wix.sourceforge.net/manual-wix3/qtexec.htm ) > --> > <Property Id="cmdInstallMyExe" Value=""[#fileMyExe]" -install > '[#fileMyExeConfig]'" /> > <CustomAction Id="cmdInstallMyExe" Execute="deferred" BinaryKey="WixCA" > DllEntry="CAQuietExec" Return="check" > Impersonate="no" /> > > <InstallExecuteSequence> > <Custom Action="cmdInstallMyExe" After="InstallServices" /> > </InstallExecuteSequence> > > ...the install fails with the log output showing... > > Action 18:27:14: cmdInstallMyExe. > MSI (s) (B0:6C) [18:27:14:247]: Executing op: > CustomActionSchedule(Action= > cmdInstallMyExe,ActionType=3073,Source=BinaryData,Target=CAQuietExec,C > ustomActionData="[#fileMyExe]" -install '[#fileMyExeConfig]') MSI (s) (B0:E8) > [18:27:14:263]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI59E3.tmp, Entrypoint: CAQuietExec MSI (s) (B0:80) [18:27:14:263]: Generating random cookie. > MSI (s) (B0:80) [18:27:14:263]: Created Custom Action Server with PID 2020 > (0x7E4). > MSI (s) (B0:9C) [18:27:14:294]: Running as a service. > MSI (s) (B0:9C) [18:27:14:294]: Hello, I'm your 32bit Impersonated custom > action server. > CAQuietExec: Error 0x80070002: Command failed to execute. > CAQuietExec: Error 0x80070002: CAQuietExec Failed CustomAction > cmdInstallMyExe returned actual error code 1603 (note this may not be > 100% accurate if translation happened inside > sandbox) > > It appears as though WiX or the installer isn't making the > substitution at all. I've triple-checked that there are no typos, and > that this CustomAction happens after InstallServices, which implicitly comes > after the CostInitialize, FileCost and CostFinalize steps, meaning that the fileIds should be referenceable. > > The install process was working fine before I added the > CustomAction-related tags. Anyone have any idea what might be going wrong, > and how to fix it? > > Alain > > *************************************** > Alain Forget, Ph.D. > Postdoctoral Researcher > CyLab, Carnegie Mellon University > afor...@cmu.edu > http://cups.cs.cmu.edu/~aforget/ > *************************************** > > > > > ---------------------------------------------------------------------- > -------- Symantec Endpoint Protection 12 positioned as A LEADER in The > Forrester > Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in > the endpoint security space. For insight on selecting the right > partner to tackle endpoint security challenges, access the full report. > http://p.sf.net/sfu/symantec-dev2dev > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users ----- No virus found in this message. Checked by AVG - www.avg.com Version: 2012.0.2221 / Virus Database: 2638/5531 - Release Date: 01/13/13 Internal Virus Database is out of date. ------------------------------------------------------------------------------ Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the endpoint security space. For insight on selecting the right partner to tackle endpoint security challenges, access the full report. http://p.sf.net/sfu/symantec-dev2dev _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users