Issues with NSIS exampleSolved

Having issues with the NSIS installer example.

It seems to have issues calling the TurboActivate.dll if it is not in the same dir as setup.exe.

code: ; check if the product key is valid System::Call "TurboActivate::CheckAndSavePKey(wr0, i1) i.r2 ? c"$2 returns "error"

If I have "SetOutPath $PLUGINSDIR" before calling the dll, $2 returns "1"Perhaps this error means it cannot locate the dat file.

I am using NSIS 2.46.5 Unicode, tried it on several other machines. Same results.

The temp folder created by setup.exe contains all both "TurboActivate" files and other dlls. I would like to distribute just the setup.exe file to users. Is there a way around this?

Well, you're asking a bunch of different questions and I'm not sure where you're stuck.

If I have "SetOutPath $PLUGINSDIR" before calling the dll, $2 returns "1"Perhaps this error means it cannot locate the dat file.

A return code of 1 means a general error (On TurboActivate.h in the "API\C" folder to see all the errors and what they mean). It's almost certainly that the product key you're passing in is invalid.

The temp folder created by setup.exe contains all both "TurboActivate" files and other dlls. I would like to distribute just the setup.exe file to users. Is there a way around this?

The design of NSIS is to include any dlls that will be called, then, when the installer is first run, extract these dlls to a temporary folder so they can be accessed. This is the design of NSIS, there's no way around that.

The temp files are deleted when your installer closes.

Thanks for the response.

The main goal for me is to give a user a single setup.exe file to install and activate product key through the NSIS installer.

The issues I am having are that the TurboActivate.* files are requiring to be present in the same dir as the setup.exe file otherwise the activation system fails. I realize CheckAndSavePKey returns 1 means the product key is invalid. But when I copy the TurboActivate.dat file to the same dir as the setup.exe it doesn't give me this error.

It doesn't seem like TurboActivate.dll call is locating TurboActivate.dat file correctly.

The issues I am having are that the TurboActivate.* files are requiring to be present in the same dir as the setup.exe file otherwise the activation system fails.

No, that's not true. If you build the example NSIS installer you'll see that that's not true.

It doesn't seem like TurboActivate.dll call is locating TurboActivate.dat file correctly.

That's a different error code (it's not 1, it's 8 -- TA_E_PDETS, see TurboActivate.h).

It sounds like you have another problem. If I were you I'd start with our example NSIS project, and slowly modify it (and test it along the way) to be more like how you want everything set up. This way you can track where you did something wrong.

I am usingTurboActivate\API\Installers\NSIS\Example.nsiNo edits, except for the GUID line.

TurboActivate\API\Installers\NSIS\..TurboActivate\API\Installers\NSIS\Example.nsiTurboActivate\API\Installers\NSIS\TurboActivate.datTurboActivate\API\Installers\NSIS\TurboActivate.dllcompiled output:TurboActivate\API\Installers\NSIS\setup.exe

copy setup.exe to Desktop location and execute

Scenario 1:Desktop\..Desktop\setup.exe

Error: You must enter a valid product key.

Scenario 2:Desktop\..Desktop\setup.exeDesktop\TurboActivate.dllDesktop\TurboActivate.dat

No errors, activation successful.

Please confirm error with the example.

I'll look into this, to make sure nothing has changed in our example. But if you read the code you'll see that the installer is supposed to skip the product key prompt page if it's already activated.

Thanks for looking into this.

Yes it does skip if already activated. To ensure its not my setup, I have tested this on multiple workstations and VMs.

You're right, our example script is faulty. We'll include a fixed script in the next release. Sorry for the trouble (and not believing you 😳 )

Edit:

The solution is to use "SetOutPath $PLUGINSDIR" before any TurboActivate calls. So the installer script would be modified like so:

Function PagePKey	; TurboActivate is in the plugins directory.	; Setting the output path ensures we can call it.	SetOutPath $PLUGINSDIR


;.... etc.

and

Function PagePKeyLeave	; TurboActivate is in the plugins directory.	; Setting the output path ensures we can call it.	SetOutPath $PLUGINSDIR


;.... etc.

No problem Sam! That is what I end up having to do with my project. However I found out that by doing it this way, the TurboActivate.dll does not remove automatically when installer quits. I had to change the calls from "? c" to "? cu". I have played with adding "SetPluginsUnload" to my code but it doesn't have any effect.

Hope this will help anyone else having the same issues in the future.

I am using NSIS 3.01 and Turboactivate 4.0.9.6The included example script is failing at the DLL calls. I have put my VersionGUID in the script.Turboactivate.DLL and turboactivate.dat are in the same folder as the nsis script and the setup.exe made by the script.Is there anything else I need to do to get it to work?

System::Call "TurboActivate::IsActivated(w'${VersionGUID}') i.r2 ? c"According to messagebox mb_ok "$2", this sets $2 to "error"It should be detecting already activated.