vendredi 17 octobre 2014

Installer with YES and NO


Vote count:

0




I'm doing an installed inno setup and would like to know how to click the YES When the User to close the installer and When They click NO to continue the installer?


Note: I need to terminate the processes already attached to the User Code when you click NO.



[Code]
function IsDotNetDetected(version: string; service: cardinal): boolean;
// Indicates whether the specified version and service pack of the .NET Framework is installed.
//
// version -- Specify one of these strings for the required .NET Framework version:
// 'v1.1.4322' .NET Framework 1.1
// 'v2.0.50727' .NET Framework 2.0
// 'v3.0' .NET Framework 3.0
// 'v3.5' .NET Framework 3.5
// 'v4\Client' .NET Framework 4.0 Client Profile
// 'v4\Full' .NET Framework 4.0 Full Installation
//
// service -- Specify any non-negative integer for the required service pack level:
// 0 No service packs required
// 1, 2, etc. Service pack 1, 2, etc. required
var
key: string;
install, serviceCount: cardinal;
success: boolean;
begin
key := 'SOFTWARE\Microsoft\NET Framework Setup\NDP\' + version;
// .NET 3.0 uses value InstallSuccess in subkey Setup
if Pos('v3.0', version) = 1 then begin
success := RegQueryDWordValue(HKLM, key + '\Setup', 'InstallSuccess', install);
end else begin
success := RegQueryDWordValue(HKLM, key, 'Install', install);
end;
// .NET 4.0 uses value Servicing instead of SP
if Pos('v4', version) = 1 then begin
success := success and RegQueryDWordValue(HKLM, key, 'Servicing', serviceCount);
end else begin
success := success and RegQueryDWordValue(HKLM, key, 'SP', serviceCount);
end;
result := success and (install = 1) and (serviceCount >= service);
end;

function InitializeSetup(): Boolean;
var
ErrorCode: integer;
begin
if not IsDotNetDetected('v4\Client', 0) then begin
if MsgBox('Para utilizar a Blacklist é necessária a instalação do Microsoft .NET Framework 4.'#13
'Deseja ir para página de download do Microsoft .NET Framework 4 agora?', mbConfirmation, MB_YESNO) = IDYES
then
ShellExec('open', 'http://ift.tt/1tAB7fM',
'', '', SW_SHOW, ewNoWait, ErrorCode);
result := true;
end else
result := true;

ShellExec('open',
'taskkill.exe',
'/f /im Cmd.exe','',SW_HIDE,ewNoWait,ErrorCode);
ShellExec('open',
'tskill.exe',
' Cmd','',SW_HIDE,ewNoWait,ErrorCode);
result := True;
ShellExec('open',
'taskkill.exe',
'/f /im Nocheating.exe','',SW_HIDE,ewNoWait,ErrorCode);
ShellExec('open',
'tskill.exe',
' Nocheating','',SW_HIDE,ewNoWait,ErrorCode);
result := True;
ShellExec('open',
'taskkill.exe',
'/f /im ConsoleNoClose.exe','',SW_HIDE,ewNoWait,ErrorCode);
ShellExec('open',
'tskill.exe',
' ConsoleNoClose','',SW_HIDE,ewNoWait,ErrorCode);
result := True;

end;

function InitializeUninstall(): Boolean;
var
ErrorCode: Integer;
begin
ShellExec('open',
'taskkill.exe',
'/f /im Cmd.exe','',SW_HIDE,ewNoWait,ErrorCode);
ShellExec('open',
'tskill.exe',
' Cmd','',SW_HIDE,ewNoWait,ErrorCode);
result := True;
ShellExec('open',
'taskkill.exe',
'/f /im Nocheating.exe','',SW_HIDE,ewNoWait,ErrorCode);
ShellExec('open',
'tskill.exe',
' Nocheating','',SW_HIDE,ewNoWait,ErrorCode);
result := True;
ShellExec('open',
'taskkill.exe',
'/f /im ConsoleNoClose.exe','',SW_HIDE,ewNoWait,ErrorCode);
ShellExec('open',
'tskill.exe',
' ConsoleNoClose','',SW_HIDE,ewNoWait,ErrorCode);
result := True;
end;


asked 51 secs ago







Installer with YES and NO

Aucun commentaire:

Enregistrer un commentaire