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

Loosing PROPERTY value during install - Basic MSI Project

Hi,

I have a CA that I run in InstallWellcome dialog where I set a property:
function FindPaths(hWND)
..
begin
appPath = RegDBGetInstallPath("My Aplication");
MsiSetProperty(hWND,"APPPATH",appPath);
end;

Here the property is set with the correct value.
Also during other custom dialog I set some other Property based on the existence of APPPATH property.

But I have another CA which regulates my ini file, set in exec UI sequence after WriteIni, Deffered Exec in Syst Context and there:
function RegulateIniFile(hWND)
...
begin
MsiGetProperty(hWND,"APPPATH",appPath2, size);
end;
Here appPath2 variable is empty.

Why and where does my PROPERTY looses its value ?

Thanks,
Bianca
Labels (1)
0 Kudos
(8) Replies
Christoph
Level 8

You can read this document for in-depth information: http://www.macrovision.com/webdocuments/PDF/CustomActionData.pdf?link_id=productsTipsTricks

The idea is to define your property(APPPATH) in the customactiondata property in the property table. Your property will be accessible during deferred execution...
0 Kudos
rootme
Level 4

Christoph wrote:
You can read this document for in-depth information: http://www.macrovision.com/webdocuments/PDF/CustomActionData.pdf?link_id=productsTipsTricks

The idea is to define your property(APPPATH) in the customactiondata property in the property table. Your property will be accessible during deferred execution...


Hi Christopf,

In the property table i have APPPATH with empty value. Isn't that enough ?

I mention that this is an IS11.5 basic msi project upgraded to IS2008. I didn't had this issue before.
In the IS11.5 project I was using ISMSI_HANDLE instead of hWND but I read that ISMSI_HANDLE is not supported in Basic MSI projects, and is not supported in InstallScript custom actions so I changed it to hWND.


Bianca
0 Kudos
Christoph
Level 8

Hi Bianca,

no... adding the APPPATH property in the property table is not enough.
You need to add it to the 'CustomActionData' property.

Open the installshield help library and click on the search tab, do a search for 'customactiondata'. You will find all the information and examples there.

Good luck...

Christoph.
0 Kudos
rootme
Level 4

I guess you wished me good luck because you knew I would be back with questions 🙂

I added Custom Action - New Set Property - APPPATH
Property Name: RegulateIniFile
Property Value: [APPPATH]
Install Exec Sequence: After WriteIniValues

As a reminder RegulateIniFile() is my deffered CA. I set my APPPATH at the beging of the installation (I read the InstallPath from the registry through a CA immediat execution named FindPath() ), and I need to use its value in this deffered CA.

What more must I do ? In the forum we keep getting to some pdfs but there is no real example (with a custom property, not just INSTALLDIR and SUPPORTDIR).

Please advise.
Thanks
Bianca
0 Kudos
Christoph
Level 8

Hi Bianca,

no problem 🙂

As I understand you correctly, your APPPATH property gets a value out of the registry in the beginning of the installation. Correct? If so, why do you use a seperate custom action to achieve this. Why not just define a systemsearch that fills your property APPPATH.

The next thing to do is defining your custom action(type 51) as described in the PDF and as you already described in your previous post. Schedule this CA in the UISequence.

Now you should be able to read out your property in your deferred custom action. To test this... you can write a little installscript custom action that you schedule as deferred and where you print the APPPATH property...

Regards,
Christoph
0 Kudos
rootme
Level 4

Christoph wrote:
Hi Bianca,

no problem 🙂

As I understand you correctly, your APPPATH property gets a value out of the registry in the beginning of the installation. Correct? If so, why do you use a seperate custom action to achieve this. Why not just define a systemsearch that fills your property APPPATH.

The next thing to do is defining your custom action(type 51) as described in the PDF and as you already described in your previous post. Schedule this CA in the UISequence.

Now you should be able to read out your property in your deferred custom action. To test this... you can write a little installscript custom action that you schedule as deferred and where you print the APPPATH property...

Regards,
Christoph


Hi Christoph,

1. My APPPATH property is set in a CA (Immediate Execution) run at the begining of the installation. - This is ok ?

2. I added a custom action deffered in syst context: RegulateIniFile () in which I need to use the APPPATH property. Install Exec Seq After GetAPPPATH (set below)

3. I added Custom Action - New Set Property - GetAPPPATH
Property Name: RegulateIniFile
Property Value: [APPPATH]
Install Exec Sequence: After WriteIniValues


In the RegulateIniFile() I do:
MsiGetProperty(hMSI, "CustomAction", appPath2, size);
MessageBox(appPath2,INFORMATION);

appPath2 is empty 😞

Is there something else ?

Bianca
0 Kudos
rootme
Level 4

Hi Christoph,

Some how I managed to get a correct value 🙂
I Changed the size = MAX_PATH in MsiGetProperty(hMSI, "CustomAction", appPath2, size);

No I will move on ... and dig a little because in my deffered CA I need about 5 property's.

Thanks a lot for your pacience.
Bianca
0 Kudos
Christoph
Level 8

Glad to hear that you found it... 😉

Also... like I told you... to initially fill the APPPATH property, there is no need to define a seperate custom action. Just define a systemsearch...

Christoph.
0 Kudos