Thursday, July 31, 2008

InstallShield and User Logon Information

I started working on a post that describes how to create a custom dialog in InstallShield. It will be a big post, so rather than wait for it to be done, I thought I would post some of the smaller items that I wanted to.

If you want to collect user information, InstallShield provides a standard dialog for this. It is called SdLogonUserInformation. It is a great dialog because it is tied into the system's users and the domain. So, you can use it to select a domain user or create one (if you have privileges). I have used it twice to create a user for special purposes. Once was for an identity for a COM+ object and the other for a user to run a Windows Service. This way, the person running the InstallShield can select or create a user during installation for these purposes.

In older versions of InstallShield (pre 2008), this dialog had a flaw. If it was run in an environment that had a lot of active directory entries (15k+) on the active directory server and the user clicked the browse button for the domain, the InstallShield would crash. I had the opportunity to work with Macrovision (now Acresso) on this to get it fixed for 2008. So these days it handles this situation just fine.

If you use that dialog, do not forget to call OnLogonUserSetMsiProperties() in your script after you show the dialog. Otherwise your information doesn't get propagated to the system. If you don't use this, your service install will fail because of invalid credentials or something like that.

Another item about users. Don't use the above dialog for simple users like SQL users. If you install a database and want to use SQL authentication (common for webserver connections to the database), then you need a non-system user. Unfortunately, InstallShield does not have a simple username/password dialog with the password box obscured. So, in a later post I will use that as an example of how to create a custom dialog.

No comments: