Another solution could be to call a custom action that then runs a process to do that work, passing an explicit PATH environment varable to the process. The CreateProcess API will let you fire off a process with an explicit environment block (in lpEnvironment) containing the path variables you need. Then you're not fiddling with the system path either. Yes, right now you're inheriting the calling process's environment picked up when it started.
Phil Wilson -----Original Message----- From: Castro, Edwin G. (Hillsboro) [mailto:edwin.cas...@fiserv.com] Sent: Monday, August 08, 2011 12:10 PM To: Brown Boiler; General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] Need foolproof way to change system path in WIX The process executing the custom action needs to be restarted after the environment variable is modified and before the custom action executes for the new environment variable value to be visible to that process. What process is executing the custom action? My gut says it's either the client side or server side Windows Installer process and they are both busy installing your MSI package. Sounds like such a change would need require a pre-install "installer" to modify the environment variable... Perhaps a better solution would be to statically link the code to the custom action so that you don't need to load the library? 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: Brown Boiler [mailto:brown_boi...@yahoo.com] > Sent: Monday, August 08, 2011 11:54 AM > To: wix-users@lists.sourceforge.net > Subject: [WiX-users] Need foolproof way to change system path in WIX > > I am using Wix 4.5 and installing on Windows 7 64 Bit and Windows Server > 2008 R2 64 bit. > > > I am trying to do a LoadLibrary and lineAddProvider from a custom action that > initiates a C++ method. Everything works correctly as long as I manually add > two directories to the system path environment variable and reboot before > running my MSI. I manually update the system path using the Environment > Variables dialog in System...Advanced System Settings. Obviously this is an > unacceptable solution for deployment, so I tried to find a way to have WIX > update the system path for me. > > > I have tried numerous ways to get my installer to change the system path so > that the LoadLibrary and lineAddProvider are successful, but I have not had > success. I have tried unsuccessfully in the following ways: > - Using <Environment Id="EnvAppendToPath1" Action="set" > Permanent="no" Name="Path" Part="last" System="yes" > Value="[INSTALLDIR64];[INSTALLDIR]"/> > - Using a custom routine we have that modifies the path in the registry > - Using CAQuietExec (running a setx command to modify the path) > > Using the first two methods, I see that the system path indeed was updated > in the Environment Variable Dialog, but the LoadLibrary still fails. I even > created a new feature in my install in which I had the installer update the > system path, rebooted, and then did a change install on the correct feature > to try to do the LoadLibrary and lineAddProvider, but I still get the errors. > > So basically I need to find a foolproof way to permanently change the system > path in an install, even if it requires a reboot in the system. Anyone have > any > ideas? > > Thanks. > > Adam > ------------------------------------------------------------------------------ > BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA The must- > attend event for mobile developers. Connect with experts. > Get tools for creating Super Apps. See the latest technologies. > Sessions, hands-on labs, demos & much more. Register early & save! > http://p.sf.net/sfu/rim-blackberry-1 > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA The must-attend event for mobile developers. Connect with experts. Get tools for creating Super Apps. See the latest technologies. Sessions, hands-on labs, demos & much more. Register early & save! http://p.sf.net/sfu/rim-blackberry-1 _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users *** Confidentiality Notice: This e-mail, including any associated or attached files, is intended solely for the individual or entity to which it is addressed. This e-mail is confidential and may well also be legally privileged. If you have received it in error, you are on notice of its status. Please notify the sender immediately by reply e-mail and then delete this message from your system. Please do not copy it or use it for any purposes, or disclose its contents to any other person. This email comes from a division of the Invensys Group, owned by Invensys plc, which is a company registered in England and Wales with its registered office at 3rd Floor, 40 Grosvenor Place, London, SW1X 7AW (Registered number 166023). For a list of European legal entities within the Invensys Group, please go to http://www.invensys.com/legal/default.asp?top_nav_id=77&nav_id=80&prev_id=77. You may contact Invensys plc on +44 (0)20 3155 1200 or e-mail recept...@invensys.com. This e-mail and any attachments thereto may be subject to the terms of any agreements between Invensys (and/or its subsidiaries and affiliates) and the recipient (and/or its subsidiaries and affiliates). ------------------------------------------------------------------------------ uberSVN's rich system and user administration capabilities and model configuration take the hassle out of deploying and managing Subversion and the tools developers use with it. Learn more about uberSVN and get a free download at: http://p.sf.net/sfu/wandisco-dev2dev _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users