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

New to Installshield: How to use properties to create custom INSTALLDI


Best Answer deramor , 18 February 2015 - 17:43

The reason the files end up in c:\CMEQDB is because the [DBDrive] property is undefined.  Windows installer catches these undefined values and assigns them a value of the c:\ drive or another root drive on your pc.  Its better than causing an exception or error.  It also provides a hint as to what is going on.  Your property value isn't getting set to a directory value. 

 

First I would use a public property to receive the data from your dialog.  A public property is one that is all in CAPS. 

Next I would author a CA (setdirectory) that takes the property and set a directory to that value after the dialog has finished.

Go to the full post


6 replies to this topic

AlexPilon

AlexPilon
  • Full Members
  • 17 posts

Posted 18 February 2015 - 15:26

Hi community,

I've just been handed the task of customizing our software's installation using InstallShield 2012 Premier, and I'm having some difficulties settings properties in dialogs and using them elsewhere.

Here's the situation:

In a Basic MSI Project, I have a dialog with a DriveSelection control so the user can select in which drive the software's databases will be installed. The control's "Indirect Property" is set to "True" and the property name is "DBDrive".

I tried a bunch of things, to no avail. How would I go about configuring the dialog and/or property and/or the INSTALLDIR to reflect my choice ? In the end, the databases files from the components should be installed in [DBDrive]\CMEQDB. 

If I put that exact command in INSTALLDIR, it removes the "\" and always installs in C:\CMEQDB.

Thanks in advance for the help everyone! smile.gif



deramor

deramor
  • Full Members
  • 187 posts

Posted 18 February 2015 - 17:43   Best Answer

The reason the files end up in c:\CMEQDB is because the [DBDrive] property is undefined.  Windows installer catches these undefined values and assigns them a value of the c:\ drive or another root drive on your pc.  Its better than causing an exception or error.  It also provides a hint as to what is going on.  Your property value isn't getting set to a directory value. 

 

First I would use a public property to receive the data from your dialog.  A public property is one that is all in CAPS. 

Next I would author a CA (setdirectory) that takes the property and set a directory to that value after the dialog has finished.



Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 19 February 2015 - 18:57

Why are you setting the property to "indirect"?



AlexPilon

AlexPilon
  • Full Members
  • 17 posts

Posted 20 February 2015 - 14:52

Hi guys,

 

Thanks a lot for the answers. I'll be trying that out later today and let you know what's the outcome.

 

Stefan, when I read the tooltip for "indirect property", I probably misread what it meant, thus setting it to Indirect instead of direct.



AlexPilon

AlexPilon
  • Full Members
  • 17 posts

Posted 20 February 2015 - 17:55

YES! Just did so, works like a goddamn charm! (sorry for the language, too happy it actually works hehe)

 

Now, I just have one little problem with this: On install, it works perfectly, no problem.

 

If I use the "Change" button to modify the installation type, and let's say I want my databases to go from F:\ to C:\. I either relaunch the MSI or use the "Change" option in "Programs and Features", I select my features and use the "Drive Selection" to select C:\ and proceed to the modification, BUT, the databases stay in F:\CMEQDB instead of C:\CMEQDB. 

 

If I remove the installation and reinstall it, then it works, but otherwise it doesn't. Would it have anything to do with the fact that the components are set as Permanent ? I don't think so, but still worth mentioning just in case.

 

Thanks again for the help! :)



Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 23 February 2015 - 16:59

Windows Installer doesn't support moving componernts after they have been installed.



AlexPilon

AlexPilon
  • Full Members
  • 17 posts

Posted 25 February 2015 - 15:24

Well that's good to know, thanks! :)