gallyjh
Posts: 27
Joined: Tue Dec 20, 2011 5:01 pm

Trying to register a COM dll. What's best practice for this?

Mon Dec 09, 2013 11:55 pm

So I'm attempting to register a COM dll, and having no success at this. I've tried a few different combinations:
A) Attempted to use a vbscript:

Code: Select all

regasm64 = Session.Property("REGASM_40_PATH_X64")
regasm32 = Session.Property("REGASM_40_PATH_X86")
dllFile = Session.Property("ClientShellDllLocation")
bits = GetObject("winmgmts:root\cimv2:Win32_Processor='cpu0'").AddressWidth

'MsgBox (bits)
'MsgBox (regasm64)
'MsgBox (dllFile)
Set UAC = CreateObject("Shell.Application")

if bits = 64 then
	UAC.ShellExecute regasm64, "/codebase " & dllFile, "", "runas", 0
else
	UAC.ShellExecute regasm32, "/codebase " & dllFile, "", "runas", 0
end if
I can see it has the right values in place, however its failing, and I'm guessing that is because of UAC/admin privileges (keep in mind that I require the installer to be ran with administrative privileges).

B) I attempt to use a custom action "Launch File or open URL"(for x86) and "Launch File or open URL using 64-bit launcher" (for x64) with the following:

Code: Select all

[REGASM_40_PATH_X64] /codebase "[#Client.Shell.dll]"
and I get the following log:

Code: Select all

MSI (s) (D0:30) [15:53:46:789]: Doing action: RegisterCOM_x64
Action 15:53:46: RegisterCOM_x64. 
Action start 15:53:46: RegisterCOM_x64.
CustomAction RegisterCOM_x64 returned actual error code 100 (note this may not be 100% accurate if translation happened inside sandbox)
MSI (s) (D0:30) [15:53:46:867]: Note: 1: 1722 2: RegisterCOM_x64 3: C:\Windows\Installer\MSIE972.tmp 4: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\regasm.exe /codebase "C:\Users\testuser\AppData\Roaming\MyProduct\MyProduct Client 1.0.0.0\bin\Client.Shell.dll" 
Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor.  Action RegisterCOM_x64, location: C:\Windows\Installer\MSIE972.tmp, command: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\regasm.exe /codebase "C:\Users\testuser\AppData\Roaming\MyProduct\MyProduct Client 1.0.0.0\bin\Client.Shell.dll" 
Once again, I'm guessing it's a permissions issue.

C) I then attempted to use COM+ registration on the dll but I get the following error:

Code: Select all

MSI (s) (D0:64) [16:40:56:360]: Doing action: RegisterComPlus
Action 16:40:56: RegisterComPlus. Registering COM+ Applications and Components
Action start 16:40:56: RegisterComPlus.
MSI (s) (D0:64) [16:40:56:360]: Note: 1: 1324 2: Client~1.dll|Client.Shell.dll 3: 1 
Error 1324. The folder path 'Client~1.dll|Client.Shell.dll' contains an invalid character.
MSI (s) (D0:64) [16:40:57:667]: Product: MyProduct Client -- Error 1324. The folder path 'Client~1.dll|Client.Shell.dll' contains an invalid character.

Action ended 16:40:57: RegisterComPlus. Return value 3.
Any idea how registering a dll is suppose to work?

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Trying to register a COM dll. What's best practice for t

Tue Dec 10, 2013 2:51 pm

Hi,

A similar problem was discussed in the COM+ registration: the folder path ... contains an invalid thread. Can you try to set an 8.3 name format for the DLL that you want to register, as it is described there, and see if it works?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

gallyjh
Posts: 27
Joined: Tue Dec 20, 2011 5:01 pm

Re: Trying to register a COM dll. What's best practice for t

Tue Dec 10, 2013 4:42 pm

I will try that, and report back. However, according to Cosmin this should have been fixed long ago correct?
Hi,

Please note that the COM page can register only files which have an 8.3 name format. Currently this is not specified in the User Guide, but it will be starting with the next version.

Regards,
Cosmin

gallyjh
Posts: 27
Joined: Tue Dec 20, 2011 5:01 pm

Re: Trying to register a COM dll. What's best practice for t

Tue Dec 10, 2013 4:55 pm

Reporting back. This hasn't fixed my issue unfortunately. Here is my error log message:

Code: Select all

Action 9:51:54: RegisterComPlus. Registering COM+ Applications and Components
MSI (s) (D0:4C) [09:51:54:578]: Executing op: ComPlusRegister(AppID={E3DB335A-46EA-4268-A4CD-6180962814D9},AplFileName=C:\Users\testuser\AppData\Roaming\MyProduct\MyProduct Client 1.0.0.0\bin\Shell.dll,AppDir=C:\Users\testuser\AppData\Roaming\MyProduct\MyProduct Client 1.0.0.0\bin\,AppType=65,,)
RegisterComPlus: AppId: {E3DB335A-46EA-4268-A4CD-6180962814D9}, AppType: 65, Users: , RSN: 
Info 2945. Installation of ComPlus App C:\Users\testuser\AppData\Roaming\MyProduct\MyProduct Client 1.0.0.0\bin\Shell.dll failed with error -2146368504.
MSI (s) (D0:4C) [09:51:56:750]: Note: 1: 1928 
Error 1928. Error registering COM+ Application.  Contact your support personnel for more information.
MSI (s) (D0:4C) [09:51:57:862]: Product: SeedFolder Client -- Error 1928. Error registering COM+ Application.  Contact your support personnel for more information.

Action ended 9:51:57: InstallExecute. Return value 3.

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Trying to register a COM dll. What's best practice for t

Tue Dec 10, 2013 5:05 pm

Hi,

I'm not sure why this problem is encountered. Can you please send me the DLL file to support at advancedinstaller dot com so I can test it and try to find the problem?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

gallyjh
Posts: 27
Joined: Tue Dec 20, 2011 5:01 pm

Re: Trying to register a COM dll. What's best practice for t

Tue Dec 10, 2013 5:48 pm

Hi Eusebiu,

So I was able resolve my issue reverting back to my first method (using vbscript). I moved the custom action to the 'Final Dialog Stage', and fixed my script to accomodate whitespace in my paths:

Code: Select all

regasm64 = Session.Property("REGASM_40_PATH_X64")
regasm32 = Session.Property("REGASM_40_PATH_X86")
dllFile = Session.Property("ClientShellDllLocation")
bits = GetObject("winmgmts:root\cimv2:Win32_Processor='cpu0'").AddressWidth

MsgBox (bits)
MsgBox (regasm64)
MsgBox (dllFile)
Set UAC = CreateObject("Shell.Application")

if bits = 64 then
	UAC.ShellExecute """" & regasm64 & """", " /codebase """ & dllFile & """", "", "runas", 0
else
	UAC.ShellExecute """" & regasm32 & """", " /codebase """ & dllFile & """", "", "runas", 0
end if

Thank you for set of extra eyes on this though!

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Trying to register a COM dll. What's best practice for t

Wed Dec 11, 2013 7:12 am

You're welcome. I'm glad you got this working.

Just let us know anytime you need help.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”