0
votes

I have an issue with an installation. The installation runs a command line option to regasm.exe a .net com dll with the /codebase option.

When I run the installation (built by installshield) from the Setup.exe then everything works fine.

When I run the installation from the .msi instead then the regasm call does not succeed, nothing is registered and the program does not run.

This problem only seems to affect x64 based systems, and on x86 systems either method works.

Any ideas what the problem might be?

EDIT

The problem seems to be that even when logged in as an administrator the msi is not executed as an administrator. I still get a UAC dialog, but only mid way through the wizard. When launched from the setup.exe I get the UAC panel before the wizard appears. If I run the .msi from and an administrative command prompt then I get no UAC panel and everything works as expected.

So I imagine that everything is working as expected is it? And that to have the custom install actions work correctly the msi must be run with administrative privileges?

1
perhaps naive, but are you sure both methods have the same privileges for access/modify/etc. operations on you computer?tchrikch
@tchrikch, no I am not sure, but I would not expect them to be different, as the setup just launches the msi (or thats the way I understood it). I am running both logged in as an administrator.Sam Holder

1 Answers

1
votes

This blog post discusses the need to run an executable with administrator priveleges from the context of an installer. The executable in question is different (appcmd.exe, versus regasm.exe in your case), but the problem sounds similar.

The piece of that post that I think is relevant to you is this:

It turns out that by default, custom actions impersonate the user that started the install, without the administrator elevation that the installer itself runs under. This can be changed by setting the CustomAction’s Impersonate attribute to “no”. That also required adding Execute=”deferred”, and as a result, having the custom action run before InstallFinalize rather than after.

I'm not familiar with InstallShield, but see if there is a way to mark the custom action that runs regasm.exe. You want to look for option(s) that you can set that are phrased similarly to one of the following (these are all different ways of saying the same thing):

  • Set the msidbCustomActionTypeNoImpersonate bit
  • Set the custom action for "deferred execution in system context"
  • Set the custom action for "deferred execution with no impersonation"