×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

how do i write INSTALLDIR to registry?

how do i write INSTALLDIR to registry?

how do i write INSTALLDIR to registry?

(OP)
Hello,

Newbie question here...  I've seen a few other threads deal with this issue, but no answers I've been able to use or understand.

I'm using Wise for Windows Installer v 5.1 - Standard Edition.

I want to write the application path to a key in the registry I'm creating during installation.  I'd also like the end user to tell me the server name and database and write those to the registry too.  (I will be calling this application from another with a shell command, so I need to know where the user has installed this application.)

Any information will be appreciated.  Thanks!

RE: how do i write INSTALLDIR to registry?

The registry is easy.  In the Installation Expert click Registry, select the key, Add, Key, Op=Create/update key and value,Root=whatever you selected, Key=Example: Software\My App, Value Name=Example: Installation Path, Data Vale=[INSTALLDIR], Data type=String

You can ask for the server/database with a custom action or a Windows Installer dialog box.  The values received can be written to the registry using brackets (as in the example above).  The data entry must occur before the WriteRegistryValues action.

If possible you should pull these values from the registry using the System Search function rather than prompting the user.  If you do prompt the user then you may want to use a drop-down list or radio buttons to avoid data entry problems.  A drop-down list is very easy to set up.

If you are running the MSI with /qb (for example) or have the LIMITUI property set then Windows Installer dialog boxes won't be displayed.

HtH,

Rob
robschultz@yahoo.com
-Focus on the solution to the problem, not the obstacles in the way.-

RE: how do i write INSTALLDIR to registry?

(OP)
Hi Rob,

Thank you!  That helped very much, and was exactly the information I needed for the application path.

I set up a dialog box for the server and DB, and gave them property names of RR_SERVER and RR_DATABASE.  I then created registry keys the same as above and put RR_SERVER and RR_DATABASE in brackets like I did INSTALLDIR.  However, when I ran the installation, the values never made it into the registry (only my application path).  What am I missing?

Thanks again!

RE: how do i write INSTALLDIR to registry?

One of two things...

1) You have your dialog happening after WriteRegistryValues.  Go into tables then look at InstallExecuteSequence for WriteRegistryValues and InstallUISequence for your dialog.  The sequence number of your dialog should be lower than the number for the write action.
2) You aren't using the same case for your variables RR_DATABASE is different than rr_database

You should add a registry system search (use the Installation Expert) to pre-populate the two variables.  This way when a repair occurs or a new version is installed the two fields already have values in them.  

You may also want to create a new component that will be left installed on uninstall and house the two registry keys there.  This way the server/database values will remain behind so a user won't have to re-enter them on an upgrade.

HtH,

Rob
robschultz@yahoo.com
-Focus on the solution to the problem, not the obstacles in the way.-

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close