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

Setting TARGETDIR from launch condition


1 reply to this topic

Lister

Lister
  • Members
  • 2 posts

Posted 09 March 2005 - 11:04

Hi all,

Very new to this Window's installer lark, so have been using VS.Net
installer project to build my install. All good so far.

Now I have to add support for upgrading, rather than just a clean
install. To do this I need to search for an existing installation and
set the TARGETDIR to that folder if found.

There is a registry key where this is kept so I have a Launch Condition
that searches for the key which I have called EXISTINGINSTALL.

The only problem I have now is setting TARGETDIR to EXISTINGINSTALL
*only* if EXISTINGINSTALL exists. There is a "Default location"
property on that application folder that can be used to set the
default, but I need to keep the usual [ProgramFilesFolder][blah blah]
setting if EXISTINGINSTALL is empty.

I tried creating another custom folder called "Existing Application"
and using the conditions field to enable the correct one based on
EXISTINGINSTALL's contents. The problem with this (other than being a
massive hack!) is that VS won't then compile, as it has two folders
with the same property name (TARGETDIR).

Can anyone push me in the right direction as I am at a loss how to do
this now.

Many Thanks,
Lister

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 09 March 2005 - 15:31

Your search/launch condition could directly set TARGETDIR.
Or add a custom action type 51 that will set TARGETDIR to the value of EXISTINGINSTALL only if it's not empty. (I'm not sure if VS supports this type of custom action. If not you will have to post process your msi file)