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

How I can change INSTALLDIR using Custom Action??


5 replies to this topic

gloom

gloom
  • Full Members
  • 50 posts

Posted 22 June 2004 - 11:44

I have one program. And for this program I must install a new utility. It's a different setup.
The utility must install to the same folder that main program installed.
I look for the path in registry using script file.
After this I have the destination path, but I can't change INSTALLDIR!! Where? How? Please help me anybody!



Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 22 June 2004 - 11:54

You could have your second setup look for the previous setup using the AppSearch table:
http://support.micro...kb;EN-US;307369

Or do a search here: http://helpnet.installshield.com

If a match is found you could assign the result of the search to the INSTALLDIR property. This should be done at least in the execute sequence. You might also want to insert it in the user interface sequence to show the path you want to install to in the custom installation dialog.

Edited by Glytzhkof, 22 June 2004 - 11:56.

Regards
-Stein Åsmul

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 22 June 2004 - 11:55

You should assign the value of the search property to the value of INSTALLDIR before InstallInitialize.
Regards
-Stein Åsmul

gloom

gloom
  • Full Members
  • 50 posts

Posted 23 June 2004 - 08:10

Thanks Glytzhkof for your reply!
I don't need for AppSearch, because I'm looking for my path in the registry. The problem was to change INSTALLDIR during the installation process.

I created Custom Action 32
Source: INSTALLDIR
Target: [NEWINSTALLDIR]

NEWINSTALLDIR is Property in Property Manager where I put my new path.
(function MsiSetProperty(hInstall, "NEWINSTALLDIR", sPath) in the script)
And included this CA immediately after CostFinalize
It's working.

Helpful link:
"How do I change the target location for a directory?"
http://msdn.microsof...a_directory.asp


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 23 June 2004 - 12:18

Using AppSearch and populating the regLocator table you can read registry entries.

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 29 June 2004 - 11:40

When hard coding the change of properties this way you should always make sure the value you expect is assigned when running a silent setup.
Regards
-Stein Åsmul