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

SourceDir/SRCDIR for Minor Upgrades


3 replies to this topic

Matthias1967

Matthias1967
  • Full Members
  • 92 posts

Posted 04 September 2009 - 11:32

Hello,

I just had to learn that in a minor upgrade - for whatever reason - the MSI property SourceDir is not set before RegisterProduct, which is at a late stage of genertaing the installation script, and every InstallScript custom action sets the InstallScript system variable SRCDIR to the temporary location where the InstallScript engine is copied to.

What is then a feasible way to access my real source directory, i.e. the base directory of my installation media where the .msi, setup.exe, and the .cab files reside? I do not think SETUPEXEDIR is a good alternative because the user may start the installation without using setup.exe (directly starting msiexec).

Regards,

Matthias

Matthias1967

Matthias1967
  • Full Members
  • 92 posts

Posted 07 September 2009 - 06:46

My current solution:

I replace SourceDir by a new property, say MySourceDir, in the MSI package and put two new CAs at the beginning of both the UI and the Execute sequences:

One CA sets MySourceDir=SourceDir if SourceDir has been set (e.g. for first-time installations)
One CA, with the condition NOT SourceDir, parses the OriginalDatabase property, returning the directory path as MySourceDir.

However, I am not sure whether this is a "good" solution, especially as Acresso recommends SETUPEXEDIR...

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 07 September 2009 - 16:44

SourceDir is populated by the ResolveSource action. This action is not called by default in maintenance mode because it *requires* the user to insert the CD (if install was form CD), which is typically unwanted at uninstall or update. So make sure you condition ResolveSource appropriately.

Matthias1967

Matthias1967
  • Full Members
  • 92 posts

Posted 08 September 2009 - 06:39

Yes, that's why I have created a new property for this purpose and basically use the OriginalDatabase property in case SourceDir is not available.

BTW: My InstallShield Basic MSI Installation sets SourceDir at the very beginning, before the first action (says the logfile).