Hello
Just tryng out InstallAware 2005 and I am wondering about DLL registration. There is a dialog that lists a file's properties. I am looking for clarification as to the "File is Self-Registering" option. Am I to assume that if I check this option, the DLL is NOT a COM dll and regsvr32 will NOT be called, or is it the opposite?
Thanks and great interface BTW!
Andrew
DLL registration
Andrew
Thanks for the enthusiastic post
If you check the selfreg option, file will be self regged by Windows Installer, but it has to be a self registering file.
If you need more flexible behavior, like specifying the order/timing of self registration, then I recommend you use the Register Library command, instead of the Install Files command's option which is rather limited (by design in Windows Installer).
Sinan
Thanks for the enthusiastic post

If you check the selfreg option, file will be self regged by Windows Installer, but it has to be a self registering file.
If you need more flexible behavior, like specifying the order/timing of self registration, then I recommend you use the Register Library command, instead of the Install Files command's option which is rather limited (by design in Windows Installer).
Sinan
I'm also just trying out InstallAware 2005. I have a similar problem, I have an assembly that I must put in the GAC which also needs to be registered.
When I add the file to the assemblies tab and specify to add it to the GAC I can no longer have the option to declare it as self-registering in the Edit dialog.
I've looked at the code and cannot find a way to RegisterLibrary where the library is in the GAC.
In my VS 2003 installer project I solved this by writing my own Installer class and having that called OnCommit, OnUninstall, OnCommit. Using self-reg was actually not registering it correctly. Is there a way to use the Installer class I wrote with InstallAware?
When I add the file to the assemblies tab and specify to add it to the GAC I can no longer have the option to declare it as self-registering in the Edit dialog.
I've looked at the code and cannot find a way to RegisterLibrary where the library is in the GAC.
In my VS 2003 installer project I solved this by writing my own Installer class and having that called OnCommit, OnUninstall, OnCommit. Using self-reg was actually not registering it correctly. Is there a way to use the Installer class I wrote with InstallAware?
The way I got around this was to call regasm.exe directly through the "Run Program". Since regasm is not located in the path, you need to explicitly set it. In my case I didn't want to copy it to the GAC but instead leave it in the $TARGETDIR$ install dir.
Here is the settings I used:
Run Program: $WINDIR$\\Microsoft.NET\\Framework\\v1.1.4322\\regasm.exe
Check "Hide Program Window"
Command Line: "$TARGETDIR$\\mycode.dll" /silent /codebase
Check "Wait for Program to Finish"
That works. Before removing the file, on uninstall I call the same regasm.exe but use the command line of:
"$TARGETDIR$\\mycode.dll" /silent /unregister
Hope thats helpful. Good luck.
Here is the settings I used:
Run Program: $WINDIR$\\Microsoft.NET\\Framework\\v1.1.4322\\regasm.exe
Check "Hide Program Window"
Command Line: "$TARGETDIR$\\mycode.dll" /silent /codebase
Check "Wait for Program to Finish"
That works. Before removing the file, on uninstall I call the same regasm.exe but use the command line of:
"$TARGETDIR$\\mycode.dll" /silent /unregister
Hope thats helpful. Good luck.
---
Regards,
Dana Epp
Regards,
Dana Epp
The installer class, which is derived from System.Configuration.Install.Installer basically does the regasm steps but loads the dll from the GAC.
The workaround that Dana posted will essentially do what I need except I need to be able to do the registration on the dll installed in the GAC not the targetdir. I could copy the dll in question to the targetdir as well and do a regasm on it but that is not very clean.
The OnCommitted() call code is below:
----------------------------------------------------
Assembly deskBarAssembly
{
get
{
return AppDomain.CurrentDomain.Load(.....);
}
}
protected override void OnCommitted(System.Collections.IDictionary savedState)
{
try
{
base.OnCommitted(savedState);
RegistrationServices rs = new RegistrationServices();
rs.RegisterAssembly(
deskBarAssembly,
AssemblyRegistrationFlags.None
);
InvalidateExplorerBarsList();
}
catch(Exception e)
{
#if DEBUG
MessageBox.Show(e.ToString());
#endif
throw;
}
}
The workaround that Dana posted will essentially do what I need except I need to be able to do the registration on the dll installed in the GAC not the targetdir. I could copy the dll in question to the targetdir as well and do a regasm on it but that is not very clean.
The OnCommitted() call code is below:
----------------------------------------------------
Assembly deskBarAssembly
{
get
{
return AppDomain.CurrentDomain.Load(.....);
}
}
protected override void OnCommitted(System.Collections.IDictionary savedState)
{
try
{
base.OnCommitted(savedState);
RegistrationServices rs = new RegistrationServices();
rs.RegisterAssembly(
deskBarAssembly,
AssemblyRegistrationFlags.None
);
InvalidateExplorerBarsList();
}
catch(Exception e)
{
#if DEBUG
MessageBox.Show(e.ToString());
#endif
throw;
}
}
Who is online
Users browsing this forum: Google [Bot] and 161 guests