TechKnow

Author Topic: [ISS] Check for a registry value and ask what to do  (Read 1383 times)

0 Members and 1 Guest are viewing this topic.

Offline HcH

  • TechKnow Owner, Ethical Hacker
  • Administrator
  • Uber Member
  • *****
  • Posts: 9936
  • Karma: +2284/-111
[ISS] Check for a registry value and ask what to do
« on: November 22, 2011, 10:47:54 PM »

This shows how to use to react on a Yes / No question after some registry value is looked up. This stuff is useful when you want to update something:

Code: [Select]
function regcheck(): String;
begin
 if RegKeyExists(HKEY_CURRENT_USER, 'Software\{#xAppName}') then
 begin
  if MsgBox('SmartQ Mod Tools already installed, overwrite existing installation?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDNO then
  begin
  Abort();
  end;
end;
end;

This function should be called from procedure CurStepChanged(CurStep: TSetupStep); CurStep = ssInstall), so the check get's done before installing the package! Also you can check after the installation is done, call this function from ssPostInstall then.
[/color]