未知标识符(inno setup)
Unknown identifier (inno setup)
嘿伙计们,我正在尝试使用 dotnet 检查器制作安装程序(如果未安装 .net4,则必须安装它)但由于某种原因我无法让它工作..
有什么可以帮忙的吗? inno 设置的新手
我在第 56 行遇到错误(未知标识符 'IsDotNetDetected')
function CheckIsDotNetDetected(): boolean;
begin
result := IsDotNetDetected('v4\Client', 0); <----- error
end;
(完整代码(第54行错误))http://pastebin.com/aD8JX325
谢谢 :D
要在安装过程中检查是否安装了 .NET 框架,请将以下代码部分添加到安装脚本中:
; Check if dot net is insalled
[Code]
function FrameworkIsNotInstalled: Boolean;
begin
Result := not RegKeyExists(HKEY_LOCAL_MACHINE, 'Software\Microsoft\.NETFramework\policy\v4.0');
end;
// Install dot net with feedback
[Code]
procedure InstallFramework;
var
StatusText: string;
ResultCode: Integer;
begin
StatusText := WizardForm.StatusLabel.Caption;
WizardForm.StatusLabel.Caption := 'Installing .NET framework...';
WizardForm.ProgressGauge.Style := npbstMarquee;
try
if not Exec(ExpandConstant('{tmp}\dotNetFx40_Full_x86_x64.exe'), '/q /noreboot', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
begin
// you can interact with the user that the installation failed
MsgBox('.NET installation failed with code: ' + IntToStr(ResultCode) + '.',
mbError, MB_OK);
end;
finally
WizardForm.StatusLabel.Caption := StatusText;
WizardForm.ProgressGauge.Style := npbstNormal;
end;
end;
在文件部分添加 .NET 安装程序文件。请注意标志 AfterInstall
和 Check
,它们将调用函数来检查是否安装了 .NET 并在需要时安装。
Source: "C:\Example\dotNetFx40_Full_x86_x64.exe"; DestDir: {tmp}; Flags: deleteafterinstall; AfterInstall: InstallFramework; Check: FrameworkIsNotInstalled
嘿伙计们,我正在尝试使用 dotnet 检查器制作安装程序(如果未安装 .net4,则必须安装它)但由于某种原因我无法让它工作..
有什么可以帮忙的吗? inno 设置的新手
我在第 56 行遇到错误(未知标识符 'IsDotNetDetected')
function CheckIsDotNetDetected(): boolean;
begin
result := IsDotNetDetected('v4\Client', 0); <----- error
end;
(完整代码(第54行错误))http://pastebin.com/aD8JX325
谢谢 :D
要在安装过程中检查是否安装了 .NET 框架,请将以下代码部分添加到安装脚本中:
; Check if dot net is insalled
[Code]
function FrameworkIsNotInstalled: Boolean;
begin
Result := not RegKeyExists(HKEY_LOCAL_MACHINE, 'Software\Microsoft\.NETFramework\policy\v4.0');
end;
// Install dot net with feedback
[Code]
procedure InstallFramework;
var
StatusText: string;
ResultCode: Integer;
begin
StatusText := WizardForm.StatusLabel.Caption;
WizardForm.StatusLabel.Caption := 'Installing .NET framework...';
WizardForm.ProgressGauge.Style := npbstMarquee;
try
if not Exec(ExpandConstant('{tmp}\dotNetFx40_Full_x86_x64.exe'), '/q /noreboot', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
begin
// you can interact with the user that the installation failed
MsgBox('.NET installation failed with code: ' + IntToStr(ResultCode) + '.',
mbError, MB_OK);
end;
finally
WizardForm.StatusLabel.Caption := StatusText;
WizardForm.ProgressGauge.Style := npbstNormal;
end;
end;
在文件部分添加 .NET 安装程序文件。请注意标志 AfterInstall
和 Check
,它们将调用函数来检查是否安装了 .NET 并在需要时安装。
Source: "C:\Example\dotNetFx40_Full_x86_x64.exe"; DestDir: {tmp}; Flags: deleteafterinstall; AfterInstall: InstallFramework; Check: FrameworkIsNotInstalled