Alternative to using gacutil.exe with libraries - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

leapingdog
Posts: 6
Joined: Fri Apr 09, 2010 5:39 am

Alternative to using gacutil.exe with libraries

My company hired a consulting firm to create an installation package using Advanced Installer for our software product, and I am now discovering that it was not done properly. If you could provide recommendations it would be very much appreciated.

1.) For the installer, custom script (a batch file) was used to register the included libraries (regsvr32 /s "C:\WINDOWS\system32\sapi.dll").

Next, they run the custom script to install the type libraries into the assembly ("gacutil.exe" /i sapi.dll /silent).

I found a Microsoft link which states that the gacutil should only be used for development purposes, and the Windows Installer should be used for production assemblies.

QUESTION: Is there built in functionality within Advanced Installer to register and install libraries without using custom script or gacutil? I have included the batch file’s text below. If you could be very specific it would be very much appreciated.

Code: Select all

@ECHO OFF

:: Patch Internet Explorer 7 for the VB6 application browser
ECHO Registering IE components...
regsvr32 /s "C:\WINDOWS\system32\shdocvw.dll"
regedit /s "explorerPatch.reg"

:: Register the included libraries
ECHO Registering necessary libraries...
regsvr32 /s "C:\WINDOWS\system32\FM20.dll"
regsvr32 /s "C:\WINDOWS\system32\ccrpTmr6.dll"
regsvr32 /s "C:\WINDOWS\system32\Xvoice.dll"
regsvr32 /s "C:\WINDOWS\system32\Toolbar2.ocx"
regsvr32 /s "C:\WINDOWS\system32\Activelock3.6.dll"
regsvr32 /s "C:\WINDOWS\system32\sapi.dll"

:: Use the VSTA tools to generate an application Registry Hive
FOR /F "usebackq tokens=2* Skip=2" %%I IN (`reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VSTA\9.0" /v InstallDir`) do SET VstaPath=%%J

ECHO Registering VSTA host components (this might take up to 5 minutes)...

call "%VstaPath%\vsta.exe" /HostID Hiatronics /setup

SETLOCAL

:: Install the type libraries into the Assembly (/silent)
ECHO Registering assemblies...
"gacutil.exe" /i sapi.dll /silent
"gacutil.exe" /i ccrpTmr6.dll /silent
"gacutil.exe" /i VSTA2_Integration.dll
"gacutil.exe" /i MyProgram.dll

ECHO Done!
2.) For the uninstall, custom script (batch file) was used, in conjunction with the gacutil to uninstall the assemblies. I would imagine that this should also be done another way. Again, if you could be very specific with your recommendations it would be appreciated. I have included the script for the uninstall file below.

Code: Select all

::@ ECHO OFF

call "Utilities\gacutil.exe"  /u VSTA2_Integration.dll /silent
call "Utilities\gacutil.exe" /u MyProgram /silent
call "Utilities\gacutil.exe" /u ccrptmr6 /silent
call "Utilities\gacutil.exe" /u sapi /silent

reg delete "HKLM\Software\Microsoft\VSTAHost\MyProgram" /f

rmdir /s /q "%HOMEPATH%\My Documents\MyProgram"
rmdir /s /q "%PROGRAMFILES%\My Program Development
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Alternative to using gacutil.exe with libraries

Hi,
For the installer, custom script (a batch file) was used to register the included libraries (regsvr32 /s "C:\WINDOWS\system32\sapi.dll").
This can be done through Auto register option from "Edit File" dialog.
Next, they run the custom script to install the type libraries into the assembly ("gacutil.exe" /i sapi.dll /silent).
You can install assemblies into GAC by using the Assemblies page.
For the uninstall, custom script (batch file) was used, in conjunction with the gacutil to uninstall the assemblies.
If you use the above features to register your files, an uninstall process will unregister them automatically. So no custom action or script is required.

If you have other questions, don't hesitate to ask.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”