Jacob Vestergaard
Guest
|
Hello,
Have anyone tried to setup an ADX installation using Setup Factory? The installation part works out fine for me, calling the DllRegister on Post Install-event:
Dllresult = DLL.CallFunction(SessionVar.Expand("%AppFolder%\adxloader.dll"), "DllRegister", "", DLL_RETURN_TYPE_INTEGER, DLL_CALL_CDECL);
However, when trying to do the equivalent on uninstall
dllResult = DLL.CallFunction(SessionVar.Expand("%AppFolder%\adxloader.dll"), "DllUnregister", "", DLL_RETURN_TYPE_INTEGER, DLL_CALL_CDECL);
- I get a dialog box for each of the other DLL-files included in the project (extensibility.dll etc.), saying "This file is in use and cannot be deleted". When looking in adxloader.log it seems the Unregistration has completed succesfully, and if I choose to interrupt the uninstallation and run it again, it completes without the warnings/errors.
To me it seems, that the DllUnregister completes fine, but doesn't "release" the DLL-files it unregisters. Therefore it seems to Setup Factory that they are in use..
Does anybody have any suggestions?
Thanks in advance |
|
Eugene Astafiev
Guest
|
Hello Jacob,
Unfortunately we don't use the Setup Factory. |
|
Jacob Vestergaard
Guest
|
Hi,
But maybe you can help me figuring this out anyway, by clearing up some stuff for me; when the DllUnregister entry point is called on the adxloader.dll, then all the DLLs utilized by the AddIn still need to be present, for the adxloader.dll unregistration process to complete successfully, right?
Or maybe you know when the MSI executes the custom actions more specific, when using the default setup project in Visual Studio? Is it before removing files, after, while, or when?
I hope you can give some pointers.
Once again thank you,
Jacob |
|
Eugene Astafiev
Guest
|
Hi Jacob,
You are on the right way. You just need to wait a bit for completing the unregistration process.
|
|
Jacob Vestergaard
Guest
|
Hi Eugene,
Heureka! After a lot of trial-and-error, this is what I came up with for uninstalling using Setup Factory.
In the Pre Uninstall-actions:
RegSvr = SessionVar.Expand("%SystemFolder%\regsvr32.exe");
F_Name = String.Char(34)..SessionVar.Expand("%AppFolder%\adxloader.dll")..String.Char(34);
result = Shell.Execute(RegSvr, "open", "/u /s "..F_Name, "", SW_SHOWNORMAL, true);
Shell.Execute allows to choose the Wait for complete to true, which the DLL.CallFunction does not. Or maybe it is some threading-stuff - anyway, this seems to work.
- and while we're at it, I might as well post what I use for registering the add-in.
In the Post Install-actions:
Dllresult = DLL.CallFunction(SessionVar.Expand("%AppFolder%\adxloader.dll"), "DllRegister", "", DLL_RETURN_TYPE_INTEGER, DLL_CALL_CDECL);
I hope someone else can make use of this.
-Jacob |
|
Eugene Astafiev
Guest
|
Hi Jacob,
Good news! Thank you for sharing the solution. |
|