cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Changing [INSTALLDIR]

CChong
By Level 11 Flexeran
Level 11 Flexeran
I have an application package that depends on an ini file that is parsed with install script code.
In this ini file the INSTALLDIR is defined.

However I try I don't seem to be able to get the installation to recognise that I have changed this property using a line of the form:

MsiSetProperty ( hMSI , "INSTALLDIR" , "D:\\" ) ;

And I can show that the property has changed succesfully.
I have tried setting the action to run straight away, and at several levels in the order of install with little success.

My installation works fine for all other parts if I define the property in the command line:

msiexec /i ITO.msi INSTALLDIR=D:\

Is there some way of forcing the property early enough in install script?

Kind Regards
Mike Gibson
HP ManagedServices
(3) Replies
Depending on where your InstallScript code is being called, you might try using MsiSetTargetPath instead of MsiSetProperty; in what function does your code appear? When is it being called?
CChong
By Level 11 Flexeran
Level 11 Flexeran
I now have this working alright as I want for a hardwired directory. Say D:\\
Both for silent and non - silent install. (this was what was holding me back originally in the ordering of the actions)

Now my problem is reading from the .ini file.

At the moment I am using the SOURCEDIR property to find out where the .ini file is located (ie the same directory that the installation MSI is running from - by design)

My problem lies in that this property is not defined until CostInitialize, but for the the installation directory (initial issue ) to change, then the action needs to be BEFORE the CostInitialize action.

A catch 22 situation? I need another method to know where to open my .ini file, before CostInitialize.

Any thoughts?

Kind Regards
Mike Gibson
HP Managed Services
CChong
By Level 11 Flexeran
Level 11 Flexeran
Scratch that, I have found the CURRENTDIRECTORY property (found it from a verbose log)

Phew!

Mike Gibson
HP Managed Services