Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread Display Modes
Old 19th January 2022, 16:46   #1
Junior Member
Join Date: Mar 2015
Posts: 2
Launching Excel From NSIS Finish Page Gives Class not registered Error For Admin User


I am experiencing a strange occurrence when installing for a Standard user versus Admin.

My installer requests "Highest" authentication level then proceeds to register COM dlls using a registry file import to HKCU (instead of using regasm.exe directly). The COM is for use in VBA in Excel. This allows me to install on a per-user basis.

After installation I have the "Run app" checkbox checked on the Finish page. The process is:

1. The user clicks "Finish" and NSIS launches a VB.net exe I wrote
2. The VB.net exe writes some additional registry entries to HKCU (that don't have anything to do with COM) then launches Microsoft Excel
3. Excel opens and attempts to instantiate the COM object in VBA.

Here is the strange difference:

1. For the "Standard" user this all works perfectly.

2. For the "Admin" user I get:

Run-time error '-2147221164 (80040154':

Class not registered

Curiously, if I then close Excel and double-click the desktop shortcut Excel opens and instantiates the object for the Admin user with no problem.

So, effectively, this error only occurs for the Admin user during the initial installation process (e.g. when it is NSIS that launches the VB.net exe which then launches Excel).

This problem occurs both on Windows 10 64-bit with Office 365 64-bit as well as Window 10 32-bit with Office 365 32-bit. So, the bitness of the applications has nothing to do with it.

It's almost like the registry isn't "refreshing" for the Admin user during the initial installation.

Any ideas as to what is going on and what the code is to fix it?

paulbnyc is offline   Reply With Quote
Old 19th January 2022, 20:44   #2
Anders's Avatar
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,505
Please don't ask the same question on multiple sites at the same time.

UAC elevated COM does not read HKCU.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump