0

I am writing a Powershell script that sets up new computers at my workplace. One of the things I am trying to do is install an Internet Explorer 11 addon that normally installs when a user first visits a particular website. Upon first visit, a popup window asks if they want to install it.

I located the file the website was downloading for the addon. It was named "NAV1251.CAB".

Inside of this .CAB file are two .dll files, two .tlb files, one .inf file, and one .ocx file. I have tried the following things:

  • Using regsvr32 to register the DLL files (got successful messages on both "DllRegisterServer in C:\thefilename.dll succeeded")

  • Using regasm to register the type library (.TLB) files (got an error on both stating it could not load either file because it is not a valid .NET assembly)

  • Installing the .INF (which fails when using the command pnputil -i -a "PathToFile", saying that the INF does not contain digital signature info)

  • Registering the OCX using regsvr32 (which, like the DLL files, gives me a successful message)

  • Tried installing the .CAB file itself using DISM, but am constantly given the error code 2 (Cannot find the file specified) regardless of where I put the file. I am 100% sure there are no typos in the command and that the file is where I am pointing to. I also ensured to try every possible form of capitalization/no caps/quotes/no quotes to no avail. [Also tried using the Add-WindowsPackage cmdlet in Powershell and got the exact same error]

I was thinking my best bet would be either installing the .INF or installing the .CAB itself. But, funnily enough, the .CAB file itself IS digitally signed by the company, but the .INF file INSIDE of the .CAB is NOT.

Outside of these efforts, I have also looked around in the registry to try and find the keys that relate to the addon. I found them and am able to import it into the script, but without the addon actually being installed, it is not working. I can make it so a new addon appears in the list of IE's addons, but it will have no name or functionality. I am fairly sure I need to do something with the .CAB and the files within it, but I am stumped as to what at this point.

This must be done in Powershell or the Command Prompt. Please do not recommend using GPO as this is not the solution I am looking for.

Any ideas?

(If more info is needed, please ask and I can give you whatever you may need)

EDIT:

I got it working (check my own answer). However, I just now realized that it will only work for the user I run the script under. For my implementation, it needs to be applied to the entire machine.

I will continue to look into possible ways to make this happen, but if anyone wants to look at my answer and see if you know any possible ways to make this apply to the entire machine without needing to rerun the script on each user, that would be awesome!

GFC_
  • 11
  • 1
  • 5
  • If you're on Windows 7 or 8 you should be able to install using `Pkgmgr /ip /m:(path to.cab file) /quiet`. On Windows 10 you use Dism, but since you have already tried that: did you run the dism command from an **elevated** (Run as Admin) prompt?. One other thing: Did you Unlock the .cab file after downloading? – Theo Aug 16 '18 at 14:58
  • Yes, I am running elevated. Also, I did not unlock the .cab file. How do I go about doing this? I can freely open/extract the .cab file, so I am not sure it is locked. – GFC_ Aug 16 '18 at 15:07

1 Answers1

0

[I just realized that this is only going to work for the current user. Now I need to somehow translate this to work on the entire machine...somehow. :( ]

I actually just got it working via Powershell. Needless to say, I jumped out of my chair and let out a little cheer when this worked. Quite frankly, I'm very surprised it did.

For those wondering what I did, here is the exact Powershell script I used:

Copy-Item -Path "E:\Script\Resources\NAV\NAV1251.ocx" -Destination "C:\Windows\SysWOW64"
Copy-Item -Path "E:\Script\Resources\NAV\NAV1251.ocx" -Destination "C:\Windows\System32"
Start-Process -FilePath "C:\Windows\System32\regsvr32.exe" 'C:\Windows\SysWOW64\NAV1251.ocx'
Start-Process -FilePath "C:\Windows\System32\regsvr32.exe" 'C:\Windows\System32\NAV1251.ocx'
reg import "E:\TheStuff.reg"

The registry file is where the magic happened here.

I used a free tool that allows you to take and compare snapshots of the registry. I went to the webpage where the addon is needed, and the little popup came up asking if I want to install the addon. Before clicking install, I made a registry snapshot. Once that was made, I clicked install and immediately took another snapshot.

Using the program, I was able to see all changes that were made to the registry. I know the class ID of the addon, so I was looking for anything that contained that or pertained to Internet Explorer. There were a few different keys there. I added all of those keys to a .reg file named "TheStuff.reg". I then threw together the rest of the script and figured it would be worth a try.

I went to a brand new PC, ran the script, and went to the webpage. No install prompts. The addon was installed, enabled, and allowed to run on the website all from the script. This is EXACTLY what I needed.

For anyone interested in the REG file contents (maybe you want to install an Internet Explorer addon yourself), this is how the file looks:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{CEBFF5CD-ACE2-4F4F-9178-9926F41749EA}\Count]
"Zvpebfbsg.VagreargRkcybere.Qrsnhyg"=hex(3):00,00,00,00,0D,00,00,00,0D,00,\
00,00,12,67,08,00,00,00,80,BF,00,00,80,BF,00,00,80,BF,00,00,80,BF,00,00,80,\
BF,00,00,80,BF,00,00,80,BF,00,00,80,BF,00,00,80,BF,00,00,80,BF,FF,FF,FF,FF,\
F0,80,22,24,6F,35,D4,01,00,00,00,00
"P:\Hfref\hfre\Qrfxgbc\ertvfgelpunatrfivrj-k64\ErtvfgelPunatrfIvrj.rkr"=hex(3):\
00,00,00,00,01,00,00,00,02,00,00,00,D0,7F,00,00,00,00,80,BF,00,00,80,BF,00,\
00,80,BF,00,00,80,BF,00,00,80,BF,00,00,80,BF,00,00,80,BF,00,00,80,BF,00,00,\
80,BF,00,00,80,BF,FF,FF,FF,FF,D0,19,64,32,6F,35,D4,01,00,00,00,00
"HRZR_PGYFRFFVBA"=hex(3):00,00,00,00,63,00,00,00,DD,00,00,00,4B,A4,63,00,13,\
00,00,00,3A,00,00,00,E8,FE,16,00,4D,00,69,00,63,00,72,00,6F,00,73,00,6F,00,\
66,00,74,00,2E,00,57,00,69,00,6E,00,64,00,6F,00,77,00,73,00,2E,00,45,00,78,\
00,70,00,6C,00,6F,00,72,00,65,00,72,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,13,00,00,00,3A,00,00,00,E8,FE,16,00,4D,00,69,00,63,00,72,\
00,6F,00,73,00,6F,00,66,00,74,00,2E,00,57,00,69,00,6E,00,64,00,6F,00,77,00,\
73,00,2E,00,45,00,78,00,70,00,6C,00,6F,00,72,00,65,00,72,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,13,00,00,00,3A,00,00,00,E8,FE,16,00,\
4D,00,69,00,63,00,72,00,6F,00,73,00,6F,00,66,00,74,00,2E,00,57,00,69,00,6E,\
00,64,00,6F,00,77,00,73,00,2E,00,45,00,78,00,70,00,6C,00,6F,00,72,00,65,00,\
72,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{A00C0AFC-E004-4024-9D25-52952AC99A6A}]
"VerCache"=hex(3):D7,6F,C4,71,5E,35,D4,01,00,8F,56,10,A0,E8,CA,01,00,00,00,\
00,00,40,02,00,33,00,13,00,07,00,00,00,33,00,13,00,07,00,00,00,09,04,00,00
"Flags"=-
"Version"=-

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Ext\Stats\{A00C0AFC-E004-4024-9D25-52952AC99A6A}\iexplore]
"Time"=hex(3):E2,07,08,00,04,00,10,00,0E,00,29,00,33,00,DD,02
"Blocked"=dword:00000007
"Count"=dword:00000010

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Ext\Stats\{A00C0AFC-E004-4024-9D25-52952AC99A6A}\iexplore\AllowedDomains\fiservse.net]

Keep in mind, the "A00C0AFC-E004-4024-9D25-52952AC99A6A" part of the registry key names are the class ID for the addon I want.

If you want to do what I did and you have the .OCX file (which is probably rare but hey), just move the OCX file to SysWOW64 and System32 (if on 64-bit machine), register them using regsvr32, and then make the registry edits.

You COULD just make the exact registry edits I made (editing the class ID and the "AllowedDomains" domain), but I honestly do not know how much else of the registry file I posted is individualized to my own needs.

If you want to be 100% sure, I would personally Google for a free tool that can compare the registry (I used RegistryChangesView v1.07) and compare the registry before and after installing the addon manually, and then export the keys it added/changed.

Thank you all for the help I am sure you would had provided!

GFC_
  • 11
  • 1
  • 5