MSI nested installation: Sharing data through registry

Got a problem you cannot solve? Try here.
Post Reply
Doorman
Posts: 3
Joined: Mon Dec 03, 2012 4:52 am

MSI nested installation: Sharing data through registry

Post by Doorman »

Hi,

I am creating a nested msi installation using the (Un)Install MSI Package plugin in InstallaWare Studio. In the main installer I write a variable into the registry. In the nested child msi installer I want to read this variable from the registry. This does not seem to work. However if I run the child msi installer independently by double clicking it in explorer it successfully reads the registry.

Is it not possible to read registry values when the msi file is nested inside a parent msi file?
If not is there anyway to pass a custom variable from the parent msi to the nested msi?

Thanks!
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: MSI nested installation: Sharing data through registry

Post by FrancescoT »

Dear User,
Is it not possible to read registry values when the msi file is nested inside a parent msi file?
Yes, it is possible to share a registry key with as many nested package you want.

I can only say that probably exist a problem somewhere ... but without having your code it is not so easy to help you.

Which is the REG KEY are you using with your packages?

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Doorman
Posts: 3
Joined: Mon Dec 03, 2012 4:52 am

Re: MSI nested installation: Sharing data through registry

Post by Doorman »

Hi,

I think I found the problem.
In the parent installer when the Write Registry Key command is executed the registry does not appear until the parent installer has finished execution. Therefore the nested child installer does not find the registry during setup time.
In which section of the parent MSIcode should I locate the Write Registry Key command such that the registry will already be written before the child installer executes?

This is how I am writing to the registry in the parent installaer:
Write Registry Key HKCU\InstallAware\MyPath, c:\myfolder

In the nested child msi installer:
Read Registry Key HKCU\InstallAware\MyPath into TARGETDIR

This works if I run the nested child msi installer manually from explorer since the registry already exists. But it does not work when running inside the parent MSI installer.

Thanks
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: MSI nested installation: Sharing data through registry

Post by FrancescoT »

Dear User,

ok ... now it is clear.

This happens because "Write Registry" is a Windows Installer command and the effective Registry creation it is deferred to Apply Install command.

In other words you have two way to solve your problem;

1- if it is possible, call you nested package only after excution of Apply Install Command.
2- Alternatively, you can force the Immediate Registry creation taking advantage of InstallAware NATIVE ENGINE feature. To proceed in this way, call the Write Registry command inside a NATIVE ENGINE ON/OFF sequence as below;

Code: Select all

Set Variable NATIVE_ENGINE to TRUE
Write Registry Key HKLM\\, 
Set Variable NATIVE_ENGINE to FALSE
Using the above code, the registry key will be stored immediatelly.

Hope this helps you.

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Doorman
Posts: 3
Joined: Mon Dec 03, 2012 4:52 am

Re: MSI nested installation: Sharing data through registry

Post by Doorman »

Thanks! That worked :)
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: MSI nested installation: Sharing data through registry

Post by FrancescoT »

:D :D :D
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Post Reply