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

Check InstallDir to see if exists already


4 replies to this topic

andyguest13

andyguest13
  • Full Members
  • 21 posts

Posted 24 February 2009 - 17:22

Hello;

I would like to perform a test to see if the folder the user has chosen already exists (and even better, to see if it is empty or not) when they press 'Next' on the DestinationDialog.

What i do now is a DoAction that calls a CA .exe which i have written that just throws a messagebox up if the folder does exist. This messagebox tells the user that if they want to change their mind, they must press 'Back' on the dialog that will popup once the messagebox is dismissed (SetupType)

This doesn't flow well in practice; is there a cleaner method please? Such that i can maybe stop installer even moving on to that next dialog if the target folder exists. And can i do it all without a CA? I don;t see any Condition or ControlEvent that i can use to see if a folder exists.

thanks
andy


KathyMorey

KathyMorey
  • Full Members
  • 111 posts

Posted 25 February 2009 - 14:47

I haven't done this, but have you looked at System Search to see if you can search for a folder (as opposed to a file)?
Kathy Morey
Synergy Software Engineer
ProfitStars, a Jack Henry Company
kmorey@profitstars.com

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 25 February 2009 - 15:10

QUOTE (KathyMorey @ 2009-02-25 13:47)
I haven't done this, but have you looked at System Search to see if you can search for a folder (as opposed to a file)?

That will only work when the MSI's execution phases run. Andy wants to control what happens when the user clicks 'Next' in the UI BEFORE that phase even starts.

However, that brings up an important point, Andy: have you thought about what to do if the user elects to install silently (i.e. with no UI), as probably every corporate deployment would do?
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 25 February 2009 - 15:18

Just to clarify: AppSearch also runs in the UI sequence - before the UI dialogs are displayed. And that's the problem, because andy needs to test a user selected folder (and probably re-check if the user goes back and selects a different folder). think you need a custom action for the checking in htis case. You can have your CA set a property and based on that decide whether to proceed to the next dialog or not.

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 25 February 2009 - 15:36

Andy, your problem is that the dialog controls only have a sub-set of events available to them and some controls don't have the same events available as others, which is bizarre.

For example, you're probably well used to seeing 'Next' being made clickable (as opposed to greyed-out) when you click a radio button - the "I accept the license agreement" option group is a common example. Well, you can't do anything similar with, say, a check-box, where you might want some extra text or a button (or whatever) to appear if it's selected.
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.