Deactivation from Installer/WiX

Hello,

I want to deactivate my product within a custom action or inside of my installer (using SharpSetup) when the uninstallation program begins. I am however unable to accomplish this due to needing the TurboActivate.exe and TurboActivate.dat files, because I can not add them as references to my SharpSetup or WiX custom action project. Is there anyway to accomplish this through a command line prompt or some other way that I may not know of? Thanks.

You can call the TurboActivate function Deactivate() in your installer. Or you can create a small app that does this for you, and before you remove any files in the uninstaller, run the app and have it deactivate the user.

Does that make sense?

But if I try to call TurboActivate.Deactivate I get an error saying that it could not locate a file. I understand why this is happening since the msi is in a different location than that of the support files (TurboActivate exectuable and dat). Is there some way to target a working directory?

Are you using the TurboActivate C# bindings?

Yes but this is from a custom action inside of an msi not from within my program. So making the call fails with a FileNotFoundException. The DLL is packaged within the Custom Action project but the exe and dat aren't because they can not be added as references to the project.

Edit: Or is the DLL the only thing needed?

The DLL is needed, then you can reference the TurboActivate.dat file from disk using the PDetsFromPath() function (and passing in the location to your install folder)/

Thanks that's what I needed to know.

Another question: Is it possible to do that for the DLL as well?

Yes, but you have to use LoadLibrary to dynamicaly load TurboActivate, then you have to rewrite the function definitions.

It's easier just to embed another copy of TurboActivate.dll in your uninstaller (if that's possible).