Dialogs - How to tie controls together and also external?

Got a problem you cannot solve? Try here.
Justin Pava
Posts: 13
Joined: Thu Jul 26, 2007 9:22 pm

Dialogs - How to tie controls together and also external?

Postby Justin Pava » Thu Jul 26, 2007 9:39 pm

Hey all,

After some minor familiarization projects, I've been working my way through our first major project using IA7, at this point mostly trying to update a product that previously used IS9. Most things have been straight-forward, but I'm running into some dialog problems.

We require the user to point to a license file during the installation (Yeah, I know, old school) - this gets validated against our license control and then allows the user to proceed in the install if it's valid. I'm running into two issues with this, and some forum searches and referencing the docs haven't been too enlightening.

Since I figure the overall scripting/checking is pretty elaborate, I'm doing this in two stages - in the first (for an upcoming beta) I just want to provide the ability for the user to browse to the license - since the product won't work too well if it's not there at the end. In the end, I'll want to actually validate it too, of course.

1) Dialog Control question - So, I've made a dialog that is using a PTShellTree, so that the user can browse to the location of their license file. I'm not actually validating it in any way against our license control, but I want to make sure they've actually selected a folder (and perhaps at least see if a file of the correct name is contained within). I know how to make the next button disabled based on whether a text box is empty or if a check box is unchecked from looking at other dialogs, but I have no idea what the property for 'selected item in the PTShellTree' is. Ideally, I want the user to have to select a folder, have that selected folder display in the text box underneath it, and only when text is being displayed, let the user click next. But there isn't anything that says which properties I need to be using for this (at least from connecting the PTShellTree to the text box, I can get the other half of that). The dialogs keep making a big deal of 'interactions between controls', so I'm figured there's SOME way to do this... (And no, I don't NEED to use the PTShellTree as the folder browser, but it seemed to be the most modern looking available).

2) At some point in the near-future, I'm going to need to add in the extra element of checking the license content against our license reader (so that once next is selected, it actually performs a bunch of checks before actually letting the user proceed to the next dialog). Ok, license reader included as support file, registered and accessed from there, check. And I've found and played around with the RunDLL function a little bit. The problem is, I need to be able to instantiate an object from that control (based on the provided license file) and call functions on that object to check for various properties and I don't see how I'm supposed to do that in the MSICode. In the past in various applications, I've done this particular operation in VBScript, InstallScript (badly), MSI Custom Actions calling into a C++ library. How should I be approaching this sort of thing for InstallAware?

Looking forward to your responses!

Update: Just had a thought on the second one at least - since I already have a C++ library that we were using for IS custom action definitions, perhaps I can include THAT library as a support file and use the RunDLL command directly on it (which ARE individual methods) and then let it handle all the object manipulation it needs to do. That would have the added benefit that it's all already written, of course (:->). Does that sound like the approach to take or is there a more direct method I haven't come across yet? (And i still need to know what to do about the dialogs)

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Fri Jul 27, 2007 6:46 am

That's a great question. Re-using your existing DLL makes perfect sense, its already there! Why not just call it using Call DLL Function? If you are calling a custom action DLL directly, just be careful since you won't be able to get a MSI handle within MSIcode, but in your case, it seems like your custom action DLL is separate from the actual DLL with the functions to call, so its a no-brainer to re-use that library.

About the dialog question, using the shell tree control makes perfect sense. I can only imagine maybe taking this one step higher and making a full Explorer style file browser, with a list view and a combo box also, so they get to precisely pick the license file itself; but that might be overkill. At any rate, there are step by step instructions on how to bind a shell tree to an edit box using a custom variable - those are in the release notes of InstallAware 6.5 (when this behavior was first implemented), so you can go ahead and take a look at those on this forum and hook up the controls with one another using the procedures described.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 54 guests