Uninstallation using Setup Factory

Add-in Express™ Support Service
That's what is more important than anything else

Uninstallation using Setup Factory
DllUnregister adxloader.dll when using Setup Factory 
Jacob Vestergaard




Posts: 68
Joined: 2008-06-08
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
Posted 19 Oct, 2008 06:50:43 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hello Jacob,

Unfortunately we don't use the Setup Factory.
.NET, Extended MAPI, Windows Phone & RT
Posted 19 Oct, 2008 13:31:15 Top
Jacob Vestergaard




Posts: 68
Joined: 2008-06-08
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
Posted 19 Oct, 2008 14:24:16 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Jacob,

You are on the right way. You just need to wait a bit for completing the unregistration process.

.NET, Extended MAPI, Windows Phone & RT
Posted 19 Oct, 2008 14:36:06 Top
Jacob Vestergaard




Posts: 68
Joined: 2008-06-08
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
Posted 19 Oct, 2008 17:32:26 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Jacob,

Good news! Thank you for sharing the solution.
.NET, Extended MAPI, Windows Phone & RT
Posted 20 Oct, 2008 04:18:14 Top