Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

INSTALLDIR Maintenance run


4 replies to this topic

Christoph

Christoph
  • Full Members
  • 81 posts

Posted 06 January 2005 - 13:53

Hello.

I've a problem to install an extra feature during maintenance install to the same location where I installed another feature during first time install.

This is my situation:
Default, the INSTALLDIR has the value 'C:\Program Files\<Company Name>\'.(Defined within product properties).
When I run a first time install, I select only featureA and set the installationlocation to 'D:\Program Files\<Company Name>\'.

When I rerun my installer afterwards, I enter maintenance mode. When I select the 'Modify' option, I come into the custom selection dialogbox.
The difference here is that I cannot browse to another path(this is what I expected) but I see that the targetlocation is again the default one and not the one where I installed the first feature.

Via an installscript custom action(MSIGetProductInfo) I'm able to retrieve the installlocation of the first install but how do I set the Installlocation during the maintenance run to this location??

I already tried to use MSISetProperty within the same installscript custom action, to give INSTALLDIR the value of the retrieved installlocation, but this won't work. For some reason, INSTALLDIR still gets the default value. Is this because I call the installscript custom action to early within the sequence? I placed this Custom Action After CostFinalize within the UI Sequence.

So, the two things I want to achieve:
  • See the INSTALLLOCATION of the first install run within the customsetuptype dialog of the maintenance run.
  • Make extra features selected during maintenance install, install within the same folder that was selected during the first installrun.

Thanks for any kind of information.

Christoph

Christoph

Christoph
  • Full Members
  • 81 posts

Posted 06 January 2005 - 16:54

when looking furthur into the problem, I found a solution myself but I am not sure whether it is a correct way (read Windows MSI way) to solve this. Therefore I would like to hear from you if there are maybe better solutions.

What I did:
as already mentioned within my previous post, INSTALLDIR has following value: '{AGFA}[ProgramFilesFolder]Agfa'. This is defined within the General Information - Product Properties section.

I was able to retrieve the installlocation of the previous installation run by writing some installscript code:

'MsiGetProductInfo("{ProductCode}", INSTALLPROPERTY_INSTALLLOCATION, svInstallDir, nBufferSize)'

Then I use 'MsiSetProperty(hMsi, "AGFA", svInstallDir)'

I add this installscript function to a custom action with the condition 'Installed' and INSTALLDIR gets the installlocation that I want.

When I uses straight 'MsiSetProperty(hMsi, "INSTALLDIR", svInstallDir)' it won't work because it seems that the AGFA-property overwrites the INSTALLDIR-property again to the default value.


So, this solution seems to work for me but when there is another possible solution(without using installscript?!), I would appreciate to hear this from you.



Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 07 January 2005 - 10:04

If you want to set a directory property using a custom action you must do this before CostFinalize, or better even before CostInitialize.

Christoph

Christoph
  • Full Members
  • 81 posts

Posted 07 January 2005 - 11:40

Stefan,

I know how to set a directory property using a custom action but is there a way to retrieve the installocation of a previous installed feature without using any installscript or any other scripting languages?

If I know how to replace the installscript code
'MsiGetProductInfo("{ProductCode}", INSTALLPROPERTY_INSTALLLOCATION, svInstallDir, nBufferSize)' by use of another custom action, I can replace the complete installscript custom action I have now.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 07 January 2005 - 12:17

You could use a DLL instead of script smile.gif
Or you can use AppSearch to read the install location from registry.