有誰知道 inno setup 打包, 如果要檢測一個有沒有安裝資料庫和有沒有安裝框架的怎么弄,我只弄成的框架其它的出錯。
我是這樣的,安裝時要檢測是否安裝框架和是否安裝好單機資料庫,
下面這樣寫出錯。
[code]
function CheckDotNet4_0():boolean;
begin
Result:= not RegKeyExists(HKLM, 'SOFTWARE\Microsoft\.NETFramework\policy\v4.0');
end;
function InitializeSetup(): Boolean;
var Path:string;
ResultCode: Integer;
begin
if CheckDotNet4_0() then
begin
ExtractTemporaryFile('dotNetFx40_Full_x86_x64.exe');
Exec(ExpandConstant('{tmp}\dotNetFx40_Full_x86_x64.exe'), '', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
end ;
result:=true;
end;
var Path:string;
ResultCode: Integer;
function CheckLocalDB():boolean;
begin
Result:= not RegKeyExists(HKLM, 'SOFTWARE\Microsoft\Microsoft SQL Server Local DB\Installed Versions\12.0');
end;
begin
if CheckLocalDB() then
begin
ExtractTemporaryFile('SqlLocalDB_2014_32bit.msi');
Exec(ExpandConstant('{tmp}\SqlLocalDB_2014_32bit.msi'), '', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
end ;
result:=true;
end;
uj5u.com熱心網友回復:
https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installedHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSQLSERVER
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/25975.html
標籤:VCL組件開發及應用
上一篇:DrawColumnCell問題
