PDA

View Full Version : unable to assign INSTALLDIR=<system folders> in vista OS



mt16in
07-17-2008, 04:30 AM
Hi,

I am facing this problem on Vista OS. This project is developed in IS 2009 Basci MSI project.

Problem is i have a custom action written in installscirpt which that has the following code

INSTALLDIR="C:\\Test1\\";
MessageBox(INSTALLDIR,INFORMATION)
INSTALLDIR="C:\\Program Files\\";
MessageBox(INSTALLDIR,INFORMATION)
INSTALLDIR="C:\\Windows\\";
MessageBox(INSTALLDIR,INFORMATION)
INSTALLDIR="C:\\Test2\\";
MessageBox(INSTALLDIR,INFORMATION)

Output of this function is -
first messagebox is displaying C:\Test1
Second messagebox is displaying C:\Test1
Third messagebox is displaying C:\Test1
Fourth messagebox is displaying C:\Test2

Why INSTALLDIR is not getting updated with C:\Program Files or C:\windows or any windows system folder?

This custom action is included after Cost Finalize standard action in execute sequence.

On vista OS, when i launch this installer, UAC is coming before this custom action is getting exectued. So, i am assuming this custom action has enough privileges.

Appreciate your help...

-Thanks

DevinEllingson
07-17-2008, 04:56 AM
INSTALLDIR is actually set/stored as an MSI property, trying setting the MSI property "INSTALLDIR" directly to the values in question using InstallScript, if this fails you may be able to get additional error information.

Devin Ellingson
Software Developer
Acresso Software

mt16in
07-17-2008, 05:47 AM
Thanks for your prompt reply...

I am not getting any error. Its just not getting updated with the new path. I didnt understand why it is happening only system folders only. Is this the intended behaviour?

I tried MSISetTargetPath also. But no luck.

DevinEllingson
07-18-2008, 12:10 PM
If MsiSetTargetPath fails then this is behavior of the Windows Installer engine, I'm not really sure if this is expected, I would consult the Windows Installer documentation to see if it mentions anythinga about this.

Devin Ellingson
Software Developer
Acresso Software

shontu
08-05-2008, 11:49 PM
You cant change INSTALLDIR variable. You can put its value in another vaiable and then use it like
STRING str;

str = INSTALLDIR ^ MYString