If <?include ..\..\Setup\Includes\Variables.wxi ?> includes: <?if $(var.Platform) = x64 ?> <?define PlatformProductName = "$(var.ProductName) (64 bit)" ?> <?define Win64 = "yes" ?> <?define DotNetFramework40Folder ="[%SystemRoot]\Microsoft.NET\Framework64\v4.0.30319\" ?> <?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?> <?else ?> <?define PlatformProductName = "$(var.ProductName)" ?> <?define Win64 = "no" ?> <?define DotNetFramework40Folder ="[%SystemRoot]\Microsoft.NET\Framework\v4.0.30319\" ?> <?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?> <?endif ?>
Then I would expect the following to work: <CustomAction Id="SetEALNBService" Property="EALNBService" Value=""[$(var.PlatformProgramFilesFolder)]\MYCOMPANY\MYPRODUCTNAME\Services\EnterpriseAuditLogService\NServiceBus.Host.exe" /installInfrastructure" Execute="immediate" /> <CustomAction Id="EALNBService" Impersonate="no" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="ignore" /> Notice that I have $(var.PlatformProgramFilesFolder) enclosed in []. If you look at the custom action in the merge module using a table editor (orca and instedit come to mind) then it should look like this: For $(var.Platform) = x64: "[ProgramFiles64Folder]\MYCOMPANY\MYPRODUCTNAME\Services\EnterpriseAuditLogService\NServiceBus.Host.exe" /installInfrastructure For $(var.Platform) != x64: "[ProgramFilesFolder]\MYCOMPANY\MYPRODUCTNAME\Services\EnterpriseAuditLogService\NServiceBus.Host.exe" /installInfrastructure You might also need to choose the DllEntry (CAQuietExec or CAQuietExec64) depending on $(var.Platform). I ran into problems where I had to choose depending on the bitness of the program I was running. Edwin G. Castro Software Developer - Staff Digital Channels Fiserv Office: 503-746-0643 Fax: 503-617-0291 www.fiserv.com Please consider the environment before printing this e-mail > -----Original Message----- > From: Peter Shirtcliffe [mailto:pshirtcli...@sdl.com] > Sent: Thursday, September 13, 2012 2:20 AM > To: General discussion for Windows Installer XML toolset. > Subject: Re: [WiX-users] define element for ProgramFilesFolder not working > in include file :( > > Preprocessor variables are case-sensitive. Does using $(var.PLATFORM) fix it > ? > > -----Original Message----- > From: StevenOgilvie [mailto:sogil...@msn.com] > Sent: 13 September 2012 00:05 > To: wix-users@lists.sourceforge.net > Subject: [WiX-users] define element for ProgramFilesFolder not working in > include file :( > > Hi > I have an include file: <?include ..\..\Setup\Includes\Variables.wxi ?> and it > has the following: > <?if $(var.Platform) = x64 ?> > <?define PlatformProductName = "$(var.ProductName) (64 bit)" ?> > <?define Win64 = "yes" ?> > <?define DotNetFramework40Folder > ="[%SystemRoot]\Microsoft.NET\Framework64\v4.0.30319\" ?> > <?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?> > <?else ?> > <?define PlatformProductName = "$(var.ProductName)" ?> > <?define Win64 = "no" ?> > <?define DotNetFramework40Folder > ="[%SystemRoot]\Microsoft.NET\Framework\v4.0.30319\" ?> > <?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?> > <?endif ?> > > I use it in a merge module like this: (I include the include file) BTW I need > the > " around the exe pathname or the custom action fails... > <CustomAction Id="SetEALNBService" Property="EALNBService" > Value=""$(var.PlatformProgramFilesFolder)\MYCOMPANY\MYPRODU > CTNAME\Servic > es\EnterpriseAuditLogService\NServiceBus.Host.exe" > /installInfrastructure" Execute="immediate" /> <CustomAction > Id="EALNBService" Impersonate="no" BinaryKey="WixCA" > DllEntry="CAQuietExec" Execute="deferred" Return="ignore" /> > > it doesn't work, the logfile has this entry: > MSI (s) (70:EC) [18:50:54:003]: PROPERTY CHANGE: Adding > EALNBService.CA23A0DC_B2DE_4F2C_9E74_FD373F99E9D7 property. Its > value is > '"ProgramFilesFolder\MYCOMPANY\MYPRODUCTNAME\Services\Enterprise > AuditLogServi > ce\NServiceBus.Host.exe" > /installInfrastructure'. > > and obviously it doesn't work... (if I hard code the path in the custom action > (i.e. C:\Program Files (x86)) it works... > > What am I doing wrong? > > thanks, > > Steve > > > > -- > View this message in context: > http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/define- > element- > for-ProgramFilesFolder-not-working-in-include-file-tp7580463.html > Sent from the wix-users mailing list archive at Nabble.com. > > ----------------------------------------------------------------------------- > - > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and threat > landscape has changed and how IT managers can respond. Discussions will > include endpoint security, mobile security and the latest in malware threats. > http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > SDL PLC confidential, all rights reserved. > If you are not the intended recipient of this mail SDL requests and requires > that you delete it without acting upon or copying any of its contents, and we > further request that you advise us. > SDL PLC is a public limited company registered in England and Wales. > Registered number: 02675207. > Registered address: Globe House, Clivemont Road, Maidenhead, Berkshire > SL6 7DY, UK. > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and threat > landscape has changed and how IT managers can respond. Discussions will > include endpoint security, mobile security and the latest in malware threats. > http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users