I have run into two problems, right now the program is a very elaborate .bat file converted into .exe (I am working on converting it into VB.net but am not a programer by trade and barely know how to get by lol) because of this I am calling turbo activate from inno setup. my first problem is after uninstalling the product and the key being deactivated by the uninstaller the computer still thinks it is activated bypassing the the pkey page even if I revoke or delete the key. this brings me to my second problem I want setup to run IsGenuine() first but it does not seem to be checking it as it keeps bypassing the pkey page. Below is my Inno Setup Script
#define MyAppName "Pistone Computer LLC"#define MyAppVersion "0.3.1"#define MyAppPublisher "Pistone Computer LLC"#define MyAppURL "http://www.PistoneComputers.com/Repairs"#define MyAppExeName "ComputerRepair.exe"
[Setup]; NOTE: The value of AppId uniquely identifies this application.; Do not use the same AppId value in installers for other applications.; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)AppId={{13DC3E52-0888-4732-A8A1-FC55E87D9AE9}AppName={#MyAppName}AppVersion={#MyAppVersion};AppVerName={#MyAppName} {#MyAppVersion}AppPublisher={#MyAppPublisher}AppPublisherURL={#MyAppURL}AppSupportURL={#MyAppURL}AppUpdatesURL={#MyAppURL}DefaultDirName={pf}\{#MyAppName}DefaultGroupName={#MyAppName}DisableProgramGroupPage=yesOutputDir=C:\Users\bpistone\Desktop\Remote Repair Script\0.3.1\InstallerOutputBaseFilename=setupSetupIconFile=C:\Users\bpistone\Desktop\Remote Repair Script\0.3.1\Files\ComputerRepair.icoCompression=lzmaSolidCompression=yesPrivilegesRequired=adminAlwaysRestart=yesLicenseFile=C:\Users\bpistone\Desktop\Remote Repair Script\0.3.1\Files\EULA.txt
[Icons] Name: "{commonstartup}\Computer Repair Unistall"; Filename: "{uninstallexe}"
[Files]; Install TurboActivate to {app} so we can access it at uninstall time; Also, notice we're putting the TurboActivate files at the top of the file; list. This is so that if you're using "SolidCompression=yes" your installer; can still start relatively quickly.Source: "C:\Users\bpistone\Desktop\Remote Repair Script\0.3.1\Files\TurboActivate.dll"; DestDir: "{app}"; Flags: ignoreversionSource: "C:\Users\bpistone\Desktop\Remote Repair Script\0.3.1\Files\TurboActivate.dat"; DestDir: "{app}"; Flags: ignoreversion
;TODO: add your files that you'll be installing Source: "C:\Users\bpistone\Desktop\Remote Repair Script\0.3.1\Files\ComputerRepair.exe"; DestDir: "{app}"; Flags: ignoreversionSource: "C:\Users\bpistone\Desktop\Remote Repair Script\0.3.1\Files\EULA.txt"; DestDir: "{app}"; Flags: ignoreversionSource: "C:\Users\bpistone\Desktop\Remote Repair Script\0.3.1\Files\ComputerRepair.ico"; DestDir: "{app}"; Flags: ignoreversionSource: "C:\Users\bpistone\Desktop\Remote Repair Script\0.3.1\Files\WizApp.exe"; DestDir: "{app}"; Flags: ignoreversionSource: "C:\Users\bpistone\Desktop\Remote Repair Script\0.3.1\Files\images\*"; DestDir: "{app}\images"; Flags: ignoreversion recursesubdirs createallsubdirsSource: "C:\Users\bpistone\Desktop\Remote Repair Script\0.3.1\Files\reg\*"; DestDir: "{app}\reg"; Flags: ignoreversion recursesubdirs createallsubdirs
//TODO: go to the version page in your LimeLM account and paste this GUID hereconst VERSION_GUID = '191736692850459de55065e0.22107638';
// functions for activationfunction IsGenuine(versionGUID: WideString): longint; external 'IsGenuine@files:TurboActivate.dll,TurboActivate.dat cdecl setuponly';
function IsActivated(versionGUID: WideString): longint;external 'IsActivated@files:TurboActivate.dll,TurboActivate.dat cdecl setuponly';
function CheckAndSavePKey(productKey: WideString; flags: UINT): longint;external 'CheckAndSavePKey@files:TurboActivate.dll,TurboActivate.dat cdecl setuponly';
function Activate(): longint;external 'Activate@files:TurboActivate.dll,TurboActivate.dat cdecl setuponly';
// functions for the uninstallerfunction IsActivatedUninstall(versionGUID: WideString): longint;external 'IsActivated@{app}\TurboActivate.dll cdecl uninstallonly';
function Deactivate(erasePkey: boolean): longint;external 'Deactivate@{app}\TurboActivate.dll cdecl uninstallonly';
var PkeyPage: TInputQueryWizardPage; activated: Boolean;
procedure InitializeWizard;begin // create the product key page PkeyPage := CreateInputQueryPage(wpWelcome, 'Type your product key', '', 'You can find the {#SetupSetting("AppName")} product key in the email we sent you. Activation will register the product key to this computer.'); PkeyPage.Add('Product Key:', False);end;
function NextButtonClick(CurPage: Integer): Boolean;var ret: LongInt;begin if CurPage = wpWelcome then begin
// after the welcome page, check if we're activated ret := IsActivated(VERSION_GUID);
if ret = 0 then begin activated := true; end; Result := True; end else if CurPage = PkeyPage.ID then begin
// check if the product key is valid ret := CheckAndSavePKey(PkeyPage.Values[0], 1); if ret = 0 then begin
// try to activate, show a specific error if it fails ret := Activate();
case ret of 2: // TA_E_PKEY MsgBox('The product key is invalid or there''s no product key.', mbError, MB_OK); 4: // TA_E_INET MsgBox('Connection to the server failed.', mbError, MB_OK); 5: // TA_E_INUSE MsgBox('The product key has already been activated with the maximum number of computers.', mbError, MB_OK); 6: // TA_E_REVOKED MsgBox('The product key has been revoked.', mbError, MB_OK); 8: // TA_E_PDETS MsgBox('The product details file "TurboActivate.dat" failed to load. It''s either missing or corrupt.', mbError, MB_OK); 11: // TA_E_COM MsgBox('CoInitializeEx failed.', mbError, MB_OK); 13: // TA_E_EXPIRED MsgBox('Failed because your system date and time settings are incorrect. Fix your date and time settings, restart your computer, and try to activate again.', mbError, MB_OK); 0: // successful begin activated := true; Result := True exit; end else MsgBox('Failed to activate.', mbError, MB_OK); end; Result := False end else begin MsgBox('You must enter a valid product key.', mbError, MB_OK); Result := False; end; end else Result := True;end;
function ShouldSkipPage(PageID: Integer): Boolean;begin // skip the "Pkey" page if were already activated if (PageID = PkeyPage.ID) and activated then Result := True else Result := False;end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);var ret: LongInt;begin // Call our function just before the actual uninstall process begins if CurUninstallStep = usUninstall then begin
// check if activated ret := IsActivatedUninstall(VERSION_GUID); // deactivate if activated if ret = 0 then begin ret := Deactivate(True); end;
// Now that we're finished with it, unload TurboActivate.dll from memory. // We have to do this so that the uninstaller will be able to remove the DLL and the {app} directory. UnloadDLL(ExpandConstant('{app}\TurboActivate.dll')); end;end;
Please let me know if you have any suggestions as I can not move forward with making it work as one time use software until I fix this