Thanks! im entirely new to inno script
I know the code provided in the tutorial is missing data. it seems that that was not the only identifier missing under Var and I cant find an example of what the identifiers shoul be. any chance you can help a newbie out, it would be a huge heres my script starting at the error
var
PkeyPage: TInputQueryWizardPage;
activated: Boolean;
taHandle: longint;
TA_OK: longint;
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
// get the handle for your version GUID
taHandle := TA_GetHandle(VERSION_GUID);
// error handling code
if taHandle = 0 then begin
MsgBox('Failed to get the TurboActivate handle. Make sure the TurboActivate.dat file is included with your installer and you''re using the correct VersionGUID.', mbError, MB_OK);
Result := False;
exit;
end;
// after the welcome page, check if we're activated
ret := TA_IsActivated(taHandle);
if ret = TA_OK then begin
activated := true;
end;
Result := True;
end else if CurPage = PkeyPage.ID then begin
// check if the product key is valid
ret := TA_CheckAndSavePKey(taHandle, PkeyPage.Values[0], TA_SYSTEM);
if ret = TA_OK then begin
// try to activate, show a specific error if it fails
ret := TA_Activate(taHandle, 0);
case ret of
TA_E_PKEY:
MsgBox('The product key is invalid or there''s no product key.', mbError, MB_OK);
TA_E_INET:
MsgBox('Connection to the servers failed.', mbError, MB_OK);
TA_E_INUSE:
MsgBox('The product key has already been activated with the maximum number of computers.', mbError, MB_OK);
TA_E_REVOKED:
MsgBox('The product key has been revoked.', mbError, MB_OK);
TA_E_INVALID_HANDLE:
MsgBox('The handle is not valid. You must set the VersionGUID property.', mbError, MB_OK);
TA_E_COM:
MsgBox('CoInitializeEx failed. Re-enable Windows Management Instrumentation (WMI) service. Contact your system admin for more information.', mbError, MB_OK);
TA_E_ENABLE_NETWORK_ADAPTERS:
MsgBox('There are network adapters on the system that are disabled and TurboActivate couldn''t read their hardware properties (even after trying and failing to enable the adapters automatically).' + ' Enable the network adapters, re-run the function, and TurboActivate will be able to "remember" the adapters even if the adapters are disabled in the future.', mbError, MB_OK);
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);
TA_E_IN_VM:
MsgBox('Failed to activate because this instance of your program if running inside a virtual machine or hypervisor.', mbError, MB_OK);
TA_E_INVALID_ARGS:
MsgBox('The arguments passed to the function are invalid. Double check your logic.', mbError, MB_OK);
TA_E_KEY_FOR_TURBOFLOAT:
MsgBox('The product key used is for TurboFloat, not TurboActivate.', mbError, MB_OK);
TA_E_ACCOUNT_CANCELED:
MsgBox('Can''t activate because the LimeLM account is cancelled.', mbError, MB_OK);
TA_OK: // successful
begin
activated := true;
Result := True
exit;
end
else
MsgBox('Failed to activate. Error code: ' + IntToStr(ret), mbError, MB_OK);
end;
Result := False
end else begin
MsgBox('You must enter a valid product key. Error code: ' + IntToStr(ret), mbError, MB_OK);
Result := False;
end;
end else
Result := True;
end;