cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
lances
Level 3

COM+ application using .NET managed code

I'm trying to create a basic MSI installer for a .NET managed code COM+ application. It seems the COM+ app must be registered (regasm) on the dev system to see it in the IS 2008 'Component 'Services' view.

The install must request the Identity account name and password that the COM+ app will run under, and the account name of a user for one of its predefined Roles.

Is there any documentation on how to do this? Is InstallScript required, or can the Identity and Role information be acquired via dialogs and then the COM+ app configured via the IS property values that have been set?

On a build system with IS 2008 SA Build, does the COM+ app dll need to be registered to build the installer?

Thanks,
-Lance
Labels (1)
0 Kudos
(17) Replies
hidenori
Level 17

You can use Windows Installer properties to accomplish your requirements. Here is what you need to do:

[LIST=1]
  • Navigate to the Component Services view.
  • Select the Identity tab of your COM+ application.
  • Select "This User:" check box
  • Type a custom property enclosed with square brackets in the User filed. i.e.[MYCOMPLUSUSER]
  • Type a custom property enclosed with square brackets in the Password filed. i.e.[MYCOMPLUSPWD]
  • Navigate to the Direct Editor.
  • Select the ISComCatalogAttribute table.
  • Find an entry that has "User" for the ItemName column, and the account name of a user for the specific role that you want to request at runtime for the ItemValue column.
  • Changed the ItemValue column to a custom property enclosed with square brackets. i.e.[MYCOMPLUSROLEUSER]
  • Navigate to the Dialog Editor.
  • Create and sequence a custom dialog that has three edit boxes associated respectively with the properties that you created in the previous steps.


    Also, once you import a COM+ application into your InstallShield project, the COM+ application does not be registered on a SA Build machine in order to build a release. However, COM+ server DLLs need to exist in the same source location.

    Hope that helps.
  • 0 Kudos
    lances
    Level 3

    Thanks for the info. I'll give that a try.
    -Lance
    0 Kudos
    lances
    Level 3

    I have followed the above steps, and the Identity account information is being set correctly by the install. 🙂

    However, I cannot get a User account assigned to a predefined Role by the install. :confused: I've tried entering the user account in the dialog as sAMAccountName, domain\sAMAccountName, UPN, and CN. None of those forms will set the User account for the Role.

    Is there anything specific in the MSI log I can look for to determine the problem. I see my ROLEACCOUNTNAME property in the log several times, but no errors.

    Thanks,
    -Lance
    0 Kudos
    hidenori
    Level 17

    Do you check the "Install user identities with roles" check box in the Installation tab of your COM+ application?
    0 Kudos
    lances
    Level 3

    That did it - thanks!

    In this Basic MSI project, is there a way to check the Identity and Role account names that are entered via the dialogs actually exist in AD, and display an error (and re-enter) if not found?

    Thanks,
    -Lance
    0 Kudos
    lances
    Level 3

    While trying to find documentation on "Install user identities with roles", I found it documented under "Component Services View" - "Installation Tab" in the IS 2008 Express User Guide on pg 497.

    However, it isn't mentioned at all in the IS 2008 User Guide in the "Component Services View" on pg 1518. :confused:

    -Lance
    0 Kudos
    hidenori
    Level 17

    I recommend that you use the LogonInformation dialog that can be added from the "New Dialog" right-click shortcut menu. Note that you need to modify the properties associated with the edit controls on the dialog to match the property names that are used in your COM+ application.

    Also, I submit the work order #IOC-000068176 so that the "Install user identities with roles" setting will be documented in a future version of InstallShield.

    Thank you for reporting it.
    0 Kudos
    lances
    Level 3

    Thanks for the pointer to logonInformation dialog.

    After looking at it and the companion dialogs for browsing and creating accounts, it appears these are connected to the Custom Actions in the ISNetAPI.dll including ISNetValidateLogonName, ISNetValidateNewUserInformation , etc. Aren't the property names (like IS_NET_API_LOGON_USERNAME) 'hardcoded' into the ISNetAPI dll and thus cannot be changed in the dialogs? Thus, I'd need to use the IS_NET_API_LOGON_USERNAME property in the Component Services Identity tab?

    Thanks,
    -Lance
    0 Kudos
    hidenori
    Level 17

    Yes, you are correct. The custom actions behind the LogonInformation dialog and the companion dialogs use the Windows Installer properties associated with those dialogs. You need to use the identical properties in the Component Services Identity tab.
    0 Kudos
    hidenori
    Level 17

    Also, if you would like to use different properties in the Component Services Identity tab, you need to create custom actions that will set the property values on the LogonInformation dialog to the properties specified in the Component Services view.
    0 Kudos
    lances
    Level 3

    I'm not quite sure how to do your last point, re: custom actions to set the property values on the logonInformation dialog. I thought the property names in that dialog had to be IS_NET_API_LOGON_USERNAME, etc., so the ISNetValidateLogonName CA can access them by the standard names. Can a CA run after that dialog to copy the values from the standard property names to the names used in the Component Services view?

    If so, can the first set of LogonInformation dialogs be renamed (eg. IdentityLogonInformation) to acquire the COM+ Identity account, and a second set of LogonInformation dialogs be used to acquire the COM+ Role account?

    In both cases, the values in the standard properties (IS_NET_API_LOGON_USERNAME) would need to be copied to the property names used in the Component Services view.

    Does the logonInformation dialog work correctly with Windows 2000 as of IS 2008? I believe prior versions had problems due to permissions on W2K?

    Thanks,
    -Lance
    0 Kudos
    hidenori
    Level 17

    The property names on the LogonInformation dialog cannot be changed. But you can set the values of those properties to different custom properites using Set Property custom actions as follows:

    [LIST=1]
  • Navigate to Custom Actions and Sequences view
  • Create a new Set Property custom action from right-click shortcut menu
  • In the Property Name filed, type the property name that you are using in the Component Services Identity tab. i.e. MYCOMPLUSUSER
  • In the Property Value field, type the property name that are used on the logonInformation dialog enclosed with square brackets i.e. [IS_NET_API_LOGON_USERNAME]
  • Sequence the custom action to call after the logonInformation dialog is finished.

    Regarding the issue of the LogonInformation dialog on Windows 2000, it is actually a limitation of the Windows API that validates Windows user credentials. Therefore, there is not much we can do for that. As a workaround, we currently do not perform the validation on Windows 2000 if you have insufficient privileges.
  • 0 Kudos
    lances
    Level 3

    I have this working now. Thanks for the help!
    -Lance
    0 Kudos
    lances
    Level 3

    A related question. Is is possible to add a second instance of the LogonInformation dialog (renamed) in a sequence? I tried adding a renamed instance (and all the associated dialogs renamed), but encountered some errors about conflicts.

    I am using LogonInformation to acquire the Identity account for a COM+ server installation. I would also like to acquire an account name for the Role.

    Is there a recommended way to obtain a second account name during an installation?

    Thanks,
    -Lance
    0 Kudos
    hidenori
    Level 17

    I recommend that you only add one LogonInformation dialog to your setup and call it twice. What you need to do is to have a custom property that indicates on which type of account you are working, and set a value before launching the dialog by having one of the following control events as an example:

    For Identity account
    [FORCOMPLUSROLEACCOUNT] 0 1

    For Role account
    [FORCOMPLUSROLEACCOUNT] 1 1

    In order to save the user name on the LogonInformation dialog to a different property appropriately, you need to add the following events to the Next control of the LogonInformation dialog:

    [IS_NET_API_LOGON_USERNAME] [COMPLUSACCOUNTNAME] FORCOMPLUSROLEACCOUNT=0
    [IS_NET_API_LOGON_USERNAME] [COMPLUSROLEACCOUNTNAME] FORCOMPLUSROLEACCOUNT=1

    Hope that helps.
    0 Kudos
    lances
    Level 3

    Thanks. I'll look into this approach.

    Is there any issue with Rollback when using the LoginInformation dialog twice as you've described?

    -Lance
    0 Kudos
    Kelly08
    Level 3

    Are you able to successfully create a new user using the LogonInformation dialogs when installing under Windows 2003? I have been able to use those dialogs to select an existing user, but whenever I try to create a new user it reports back success, but doesn't seem to actually create the user.

    Kelly
    0 Kudos