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&reg; 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&reg; 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

Reply via email to