Смотрите видео ниже, чтобы узнать, как установить наш сайт в качестве веб-приложения на домашнем экране.
Примечание: Эта возможность может быть недоступна в некоторых браузерах.
[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\My Application
[code]
procedure RegRun(FSection: LongWord; FDir, FValue, FExe: String);
var FPath: String; ResultCode: integer;
begin
if RegQueryStringValue(FSection, FDir, FValue, FPath) then begin
if FPath <> '' then Exec(AddBackslash(RemoveBackslash(FPath)) + FExe,'','', SW_SHOW, ewNoWait, ResultCode)
else MsgBox('Ключ реестра пуст!', mbInformation, MB_OK);
end else MsgBox('Ключ реестра не найден!', mbInformation, MB_OK);
end;
procedure InitializeWizard;
begin
RegRun(HKEY_LOCAL_MACHINE, 'Software\Valve\Steam', 'InstallPath', 'Steam.exe');
end;
ну да.блин тебе к делфи надо
function RegQueryStr(RootKey: HKEY; Key, Name: string;
Success: PBoolean = nil): string;
var
Handle: HKEY;
Res: LongInt;
DataType, DataSize: DWORD;
begin
if Assigned(Success) then
Success^ := False;
Res := RegOpenKeyEx(RootKey, PChar(Key), 0, KEY_QUERY_VALUE, Handle);
if Res <> ERROR_SUCCESS then
Exit;
Res := RegQueryValueEx(Handle, PChar(Name), nil, @DataType, nil, @DataSize);
if (Res <> ERROR_SUCCESS) or (DataType <> REG_SZ) then
begin
RegCloseKey(Handle);
Exit;
end;
SetString(Result, nil, DataSize - 1);
Res := RegQueryValueEx(Handle, PChar(Name), nil, @DataType,
PByte(@Result[1]), @DataSize);
if Assigned(Success) then
Success^ := Res = ERROR_SUCCESS;
RegCloseKey(Handle);
end;
function CreateProcessX(sExecutable: string; sParameters: string): string;
var
pi: TProcessInformation;
si: TStartupInfo;
begin
FillMemory(@si, SizeOf(si), 0);
si.cb:= SizeOf(si);
si.lpReserved := nil;
si.lpDesktop := nil;
si.lpTitle := nil;
si.dwFlags := STARTF_USESHOWWINDOW;
si.wShowWindow := SW_SHOW;
si.cbReserved2 := 0;
si.lpReserved2 := nil;
CreateProcess(PChar(sExecutable), PChar(sParameters), nil, nil, False, CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS, nil, nil, si, pi);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
CreateProcessX(RegQueryStr(HKEY_LOCAL_MACHINE, 'Software\Valve\Steam', 'InstallPath') + '\Steam.exe', '');
end;