Using MsiSetTargetPath(hInstall, "INSTALLDIR", szLocalPath); has worked perfectly.
Thanks Peter -----Original Message----- From: Peter Shirtcliffe [mailto:pshirtcli...@sdl.com] Sent: 27 July 2012 16:12 To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] Custom Action C++ Function / MsiSetProperty No, that's just another way of achieving what you're trying to do. See http://msdn.microsoft.com/en-us/library/windows/desktop/aa367852%28v=vs.85%2 9 .aspx -----Original Message----- From: Natalie Carr [mailto:natalie.c...@measuresoft.com] Sent: 27 July 2012 15:12 To: 'General discussion for Windows Installer XML toolset.' Subject: Re: [WiX-users] Custom Action C++ Function / MsiSetProperty I did that and it seems the location is getting changed but the EXE that I am installing is still going to the default location. Do I need to call a type 35 custom action for changing a registry value? -----Original Message----- From: Peter Shirtcliffe [mailto:pshirtcli...@sdl.com] Sent: 27 July 2012 14:32 To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] Custom Action C++ Function / MsiSetProperty Generate a verbose log. -----Original Message----- From: Natalie Carr [mailto:natalie.c...@measuresoft.com] Sent: 27 July 2012 14:21 To: 'General discussion for Windows Installer XML toolset.' Subject: Re: [WiX-users] Custom Action C++ Function / MsiSetProperty Hi, Yes thank you that solved the error and it is now installing without failing however the exe I'm installing is not anywhere to be seen. -----Original Message----- From: Peter Shirtcliffe [mailto:pshirtcli...@sdl.com] Sent: 27 July 2012 12:55 To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] Custom Action C++ Function / MsiSetProperty You might need MsiSetTargetPath, as a directory property is slightly different to a normal property. I'm not sure where you'd schedule it. MsiSetTargetPath(hInstall, "INSTALLDIR", szLocalPath); Assuming your directory layout looks something like this... <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="ProgramFilesFolder"> <Directory Id="INSTALLDIR" Name="My application" /> Also, don't forget to include WcaInitialize() and the rest if you're using Wca* functions. http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/What-can-cause - WcaInitialize-to-fail-td5213865.html -----Original Message----- From: Natalie Carr [mailto:natalie.c...@measuresoft.com] Sent: 27 July 2012 12:10 To: 'General discussion for Windows Installer XML toolset.' Subject: Re: [WiX-users] Custom Action C++ Function / MsiSetProperty No because I do not know what my customer has installed the main application to. The DLL function checks all the possibilities and retrieves the correct one, my function works perfectly. I just am struggling on how to retrieve that variable and place it back into my MSI so that I can use it for my install location. -----Original Message----- From: Neil Sleightholm [mailto:n...@x2systems.com] Sent: 27 July 2012 12:02 To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] Custom Action C++ Function / MsiSetProperty Can't you do that with a RegistrySearch? Neil -----Original Message----- From: Natalie Carr [mailto:natalie.c...@measuresoft.com] Sent: 27 July 2012 11:47 AM To: 'General discussion for Windows Installer XML toolset.' Subject: Re: [WiX-users] Custom Action C++ Function / MsiSetProperty Hi, Yes that's exactly what I need to do. Thanks -----Original Message----- From: Peter Shirtcliffe [mailto:pshirtcli...@sdl.com] Sent: 27 July 2012 11:39 To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] Custom Action C++ Function / MsiSetProperty What are you trying to achieve ? Are you trying to install your MSI to a path that is already stored in the registry ? -----Original Message----- From: Natalie Carr [mailto:natalie.c...@measuresoft.com] Sent: 27 July 2012 11:30 To: wix-users@lists.sourceforge.net Subject: [WiX-users] Custom Action C++ Function / MsiSetProperty Hello, Having some problems with my DLL custom action C++ function. I have the function working properly it grasps the registry that I need to install to. Somehow I need to extract the variable szLocalPath to my msi so that it can then replace the install location. After research I think it's a case of using MsiSetProperty but I have no idea how to implement this. Any help would be greatly appreciated. extern "C" UINT __stdcall GetOrchDir(MSIHANDLE hInstall) { HRESULT hr = S_OK; UINT er = ERROR_SUCCESS; char szLocalPath[MAX_PATH]; strcpy(szLocalPath, Orc_Get_Dir(".", "ORC_BIN")); LExit: er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; return WcaFinalize(er); } Thanks ---------------------------------------------------------------------------- - - 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 ---------------------------------------------------------------------------- -- 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 ---------------------------------------------------------------------------- -- 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 ---------------------------------------------------------------------------- -- 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 ---------------------------------------------------------------------------- -- 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