Advertisement

04.03.2008 at 10:23PM PDT, ID: 23295095
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Register and unregister the DLL, After running an EXE or MSI file

Tags: Microsoft, Visual Studio,.Net 2.0,C#, 2005,, Setup and deployment, c#
Hi all,

I am creating a setup " <M_BHO>.exe" for my BHO plugin. the EXE or MSI file will be shared across to my web application users.

User will run the <M_BHO>.exe and then run the commands  present in my register.bat for communicating with the scanner (connected to COM)

My requirement: I have to run the commands present in my register.bat automatically, when user run my single MSI or EXE file on single click.

Please help me and kindly revert back, if anything not clear

Note: commands present in my register.bat are
@echo off
%Windir%\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe /unregister M_BHO.dll
%Windir%\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe /codebase M_BHO.dll
pause

Regards,
Kannan

Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: kannantechno
Solution Provided By: vadimrapp1
Participating Experts: 1
Solution Grade: A
Views: 85
Translate:
Loading Advertisement...
04.04.2008 at 01:48PM PDT, ID: 21285546

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.06.2008 at 08:24PM PDT, ID: 21294157

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.06.2008 at 08:40PM PDT, ID: 21294204

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.06.2008 at 09:50PM PDT, ID: 21294407

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.06.2008 at 10:42PM PDT, ID: 21294554

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 02:45AM PDT, ID: 21295390

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 05:30AM PDT, ID: 21296150

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 05:46AM PDT, ID: 21296287

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 07:44AM PDT, ID: 21297380

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 09:27AM PDT, ID: 21298411

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 09:29AM PDT, ID: 21298421

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 10:56AM PDT, ID: 21299087

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.09.2008 at 03:45AM PDT, ID: 21313429

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.09.2008 at 08:21PM PDT, ID: 21321436

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.09.2008 at 11:30PM PDT, ID: 21322161

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.10.2008 at 04:41AM PDT, ID: 21323583

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.10.2008 at 11:30PM PDT, ID: 21331724

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.11.2008 at 07:22AM PDT, ID: 21334516

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.11.2008 at 07:42AM PDT, ID: 21334694

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.11.2008 at 08:12AM PDT, ID: 21335000

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.11.2008 at 10:31AM PDT, ID: 21336327

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.11.2008 at 10:33AM PDT, ID: 21336344

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.14.2008 at 09:42PM PDT, ID: 21355997

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.14.2008 at 10:00PM PDT, ID: 21356049

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.15.2008 at 05:42AM PDT, ID: 21358057

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.15.2008 at 06:42AM PDT, ID: 21358583

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.15.2008 at 08:35PM PDT, ID: 21364590

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.16.2008 at 01:54PM PDT, ID: 21371857

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.16.2008 at 09:36PM PDT, ID: 21374213

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.16.2008 at 10:35PM PDT, ID: 21374400

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.16.2008 at 11:35PM PDT, ID: 21374656

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • Automotive
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Displays / Monitors
  • Handhelds / PDAs
  • Components
  • Peripherals
  • Laptops/Notebooks
  • Servers
  • Misc
  • Apple
  • Embedded Hardware
  • Networking Hardware
  • Storage
  • Desktops
  • New Users
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMware
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Virtualization
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • Web Computing
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Consulting
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMware
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Automation
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Web Services
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Web Computing
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Lounge
  • Business Travel
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
  • Automotive
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
04.04.2008 at 01:48PM PDT, ID: 21285546

Rank: Guru

use menu view/editor/custom actions; add new custom action and specify your register.bat.
 
04.06.2008 at 08:24PM PDT, ID: 21294157
Hi

I have tried with the custom action in that Register.bat is  not able to specify.And
tried with VBS, then build the setup. While running the latest MSI file, facing error "Their is a problem with this windows installer package. A script required for this install could not be run"
 
04.06.2008 at 08:40PM PDT, ID: 21294204

Rank: Guru

insert debugging commands in your .vbs file - for example, msgbox after each line. Then you will see if the script is even starting to run, and what fails.
 
04.06.2008 at 09:50PM PDT, ID: 21294407
Please help me how to insert the debug commands and what are that commands for the same to debug or is it possible for me to set break points

i have wrote VBS , please look the attachment to find the same  
1:
2:
3:
4:
5:
6:
 
dim shell
set shell=createobject("wscript.shell")
shell.run "Register.bat"
set shell=nothing
Open in New Window
 
04.06.2008 at 10:42PM PDT, ID: 21294554

Rank: Guru

msgbox "hello, vbscript is entered"
dim shell
set shell=createobject("wscript.shell")
msgbox "shell created"
shell.run "Register.bat",,true  ' ,,true will make the window wait until the command has finished.
msgbox "launched the bat"
set shell=nothing

I think you may need to specify the path to your register.bat.

Alternatively, you might run your two commands directly from the script, without .bat. If you search registry for v2.0.50727 , you will find some key where the script can regread the value of the path of the framework. For example,

set s = createobject("wscript.shell")
path = s.regread("HKEY_CLASSES_ROOT\TypeLib\{D3295D87-D604-11D4-A704-00C04FA137E4}\8.0\HELPDIR\")
s.run path & "\regasm.exe /unregister M_BHO.dll"

Accepted Solution
 
04.07.2008 at 02:45AM PDT, ID: 21295390
Hi

Thanks a lot,

I have tried with the following code from your inputs,now the DLL has been successfully register and unregister

msgbox "vbscript is started"
dim shell
set s = createobject("wscript.shell")
'msgbox "shell created"
s.run  "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe /unregister meditrackbho.dll",,true
s.run  "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe /codebase meditrackbho.dll",,true
msgbox "Sucessfully Registered the COM"
set shell=nothing

When i tried with your path mentioned in last comment not worked, but the script is executing. then i tried with  the value present in the path of the registry "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\"
now the dll is registered.

I will update you the final result. after when i successfully implemented in my latest deployed environment

reg,
kannan

 
04.07.2008 at 05:30AM PDT, ID: 21296150
Hi vadimrapp1,

Please help me, how to implement this concept without hard code of "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727" but when i  use to run the script below in my local machine manually, its working fine but i don't know why it is not working while install.



msgbox "vbscript is started to register the COM"
dim shell
set s = createobject("wscript.shell")
'msgbox "shell created"
path = s.regread("HKEY_CLASSES_ROOT\TypeLib\{215D64D2-031C-33C7-96E3-61794CD1EE61}\2.0\HELPDIR\")

's.run  "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe /unregister meditrackbho.dll",,true
's.run  "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe /codebase meditrackbho.dll",,true
s.run path&"\RegAsm.exe /unregister M_bho.dll"
s.run path&"\RegAsm.exe /codebase M_bho.dll"
msgbox "Sucessfully Registered the COM"
set shell=nothing

Thanks in advance

reg,
kannan
 
04.07.2008 at 05:46AM PDT, ID: 21296287

Rank: Guru

does it show the first message "vbscript is started to register the COM" during installation?
 
04.07.2008 at 07:44AM PDT, ID: 21297380
Yes it shows the message "vbscript is started to register the COM" during installation and end of the installation shows" Successfully Registered the COM "
but the scanner which i connected to the COM is not working

Also i had tried the same vbs file in my local machine, the script executes and my scanner communicates now...

But, i don't know why it is not possible while running my msi or exe file
 
04.07.2008 at 09:27AM PDT, ID: 21298411

Rank: Guru

It may be related to security, if installer runs the vbs as different user, or as machine account. Insert in the vbs command that would show username, for example

set WshShell = WScript.CreateObject("WScript.Shell")
msgbox wshshell.expandenvironmentstrings("%username%")

Also you can try to redirect the output of regasm to a file, to see what it says. See http://support.microsoft.com/kb/278411

Assisted Solution
 
04.07.2008 at 09:29AM PDT, ID: 21298421

Rank: Guru

add ,,true to uncommented lines of the script, then it will hopefully wait for you to look at the result of regasm before closing the window.
 
04.07.2008 at 10:56AM PDT, ID: 21299087

Rank: Guru

here's another thought...

If in your visual stuidio.net project check the checkbox "make assembly COM-visible", then rebuild everything (maybe even recreate the setup project), wouldn't this take care of registering without any custom actions and bat files?
 
 
 
04.09.2008 at 03:45AM PDT, ID: 21313429
Hi ,

I have tried with "Make assembly COM-visible" but still my M_BHO.dll is not registering
and tried with msgbox wshshell.expandenvironmentstrings("%username%") , the script takes the name of the user who currently installing the msi .

Thanks a lot for your valuable inputs, also expecting your coordination to fix this issue as soon as possible

 
 
04.09.2008 at 08:21PM PDT, ID: 21321436

Rank: Guru

in setup project, in the properties of the "primary output", which is your dll, specify Register = vsdrpCOM

The attached file (rename .txt to .zip) has a trivial project creating an assembly, and its setup. Once you run setup, you can successfully createobject("mylibrary.myclass1"). Note that setup does not have any custom action.
Assisted Solution
 
04.09.2008 at 11:30PM PDT, ID: 21322161
Hi

I think vsdrpCOM will not register the dll , please check the link http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2382760&SiteID=1

i am new to .net, so kindly guide me to do this.

 
04.10.2008 at 04:41AM PDT, ID: 21323583

Rank: Guru

I think it will work, as it works in the sample project that I attached. Did you try?
 
04.10.2008 at 11:30PM PDT, ID: 21331724
I have tried by specifying Register = vsdrpCOM in my properties of the "primary output"  but not working

Also i have install your setup1.msi but couldn't find any add-on(BHO) in my internet option and herewith i have attached a picture which will show my add-on(BHO) present in internet option after successful register of my dll

Please let me know if you require any clarifications or my requirement is not clear to you.
 
Add-on present in my iternet option after register of my dll
Add-on present in my iternet option after register of my dll
 
 
04.11.2008 at 07:22AM PDT, ID: 21334516
Hi vadimrapp1,

Thanks a lot for your continuous support and coordination , please find the link below that helps me to fix the issue that we both are doing for the past days.

http://leon.mvps.org/DotNet/RegasmInstaller.html

If require, Will reach you for any assistance in future

reg,kannan
 
04.11.2008 at 07:42AM PDT, ID: 21334694

Rank: Guru

I have no experience in creating BHO's; so what follows is actually a speculation.

The sample project that I created included not a BHO, but rather a regular assembly that became visible in th