/build/static/layout/Breadcrumb_cap_w.png

Registration of .ocx

Hi all,

I have this .ocx file, which needs to be registered, there is a batch file which contains the regsvr32 to register the file, and also a batch file to un register. I can drop those files through deployment tool and run the batch file for registeration. But the client wants me to do this through MSI. I have no idea, how to do the custom actions through MSI installshield to do the registeration.

Can anyone please guide me with this.

Thanks


0 Comments   [ + ] Show comments

Answers (7)

Answer Summary:
Include the file in your MSi and create a VBS that uses regsvr32.exe to register the .ocx.
Posted by: A.Ni 12 years ago
Senior Yellow Belt
3

To register DLL and/or OCX during install process and unregister them during uninstall process:

- create an MSI by capturing file copy on target computer (if needed)
- edit this MSI with your favorite editor
To register:
- create a custom action (vbs stored in custom action) named "registerdll" (or anything else you like ;-)
- In custom action's properties, set "Install Exec Sequence" to "After InstallFinalize" (quotes not needed)
- In custom action's properties, set "Install Exec Condition" to "REMOVE<>"ALL"" (quotes for "ALL" needed)
- use this script to register dll or ocx:
   Option explicit
   Dim Wshshell
   Set WshShell = CreateObject("WScript.Shell")
   Wshshell.run "regsvr32.exe /S " & chr(34) & "path-to-your-file" & chr(34),1,true
   ... add here as many lines as files to register...

To unregister:
- create a custom action (vbs stored in custom action) named "Unregisterdll" (or anything else you like ;-)
- In custom action's properties, set "Install Exec Sequence" to "<First Action>" (files must be unregistered before to be removed)
- In custom action's properties, set "Install Exec Condition" to "REMOVE="ALL"" (quotes for "ALL" needed)
- use this script to unregister dll or ocx:
   Option explicit
   Dim Wshshell
   Set WshShell = CreateObject("WScript.Shell")
   Wshshell.run "regsvr32.exe /U /S " & chr(34) & "path-to-your-file" & chr(34),1,true
   ... add here as many lines as files to unregister..

Enjoy
A.Ni 

Posted by: anonymous_9363 12 years ago
Red Belt
1

>Now create a component in the MSI as <FileName> and include the File.ocx and File.reg and you are good to go.



No, do NOT include the .REG as a file in the project. Import the .REG instead so that the relevant advertising tables get populated.

Do not be tempted to execute RegSvr32 to register the OCX, either. Do the job properly and use the advertising tables.

Posted by: adilrathore 12 years ago
4th Degree Black Belt
0

You can perform a capture during the original .ocx installation. This will ensure that the plugin references are included in the package.


Comments:
  • I think it would not be a good idea to capture a MSI if its a vendor MSI. - akki 12 years ago
Posted by: GAKIS 12 years ago
Fourth Degree Green Belt
0

http://www.symantec.com/connect/blogs/how-manually-register-dll-msi

Here are essentially the steps, they will be almost identicall in installshield.

Posted by: akki 12 years ago
4th Degree Black Belt
0

If you use WISE you can use WiseComCapture.exe present in Wise Install Editor folder.

Pass this command:
 WiseComCapture.exe /r "path to dll" "path to reg file"

ex. WiseComCapture.exe /r "c:\File.ocx" "C:\File.reg"

 

Now create a component in the MSI as <FileName> and include the File.ocx and File.reg and you are good to go.

Im not aware of how to do it using InstallShield though.

Else you can find that OCX file(as a merge module) on net and include it in your package.

Hope it helps.

Posted by: akki 12 years ago
4th Degree Black Belt
0

But if you are looking for Custom Action only, then you could include the file in your MSi and create a VBS that uses regsvr32.exe to register the .OCX. To create a custom action follow these steps:

  1. In an InstallShield Basic MSI project, right-click on the Custom Actions root node and choose Custom Action Wizard. The Custom Action Wizard is displayed
  2. Click Next. The Basic Information Panel is displayed.
  3. Enter the name of your custom action in the Name field. Click Next.
  4. The Action Type panel is displayed. Select Run VBScript code from the Type list.
  5. Select Stored directly in the custom action from the Location list. Click Next. The In-Sequence Scripts panel is displayed.
  6. Copy and paste your VBScript into the field provided.Click Next. The Additional Options panel is displayed.
  7. Select the Deferred execution in System context option from the In-Script Execution list. Click Next. The Insert into Sequence panel is displayed.
  8. Select After InstallFile from the Install UI Sequence list. Click Next. The Summary panel is displayed. Click Finish

Comments:
  • If I have to uninstall or unregister , do I have to follow the similar method.. How do I have to go about with that. - shamu99 12 years ago
Posted by: shamu99 12 years ago
Fifth Degree Brown Belt
0

If I have to uninstall or unregister , do I have to follow the similar method.. How do I have to go about with that.

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ