Inno Setup 安装程序启动的我的批次显示 "The system cannot find the file specified" 就在那里
My batch launched by Inno Setup installer says "The system cannot find the file specified" while it is right there
在我的 Inno 安装脚本中,我有这一行:
[Files]
Source: C:\CLIENTS\ACSORDER\DeployAcsOrder\installSQL\*; DestDir: "{code:GetDir|0}\installSQL";
[Run]
Filename: {code:GetDir|0}\installSQL\installSQL.bat Parameters: {code:GetDir|0}\installSQL; Description: {cm:LaunchProgram,LumisTraiteur}; StatusMsg: Installation SQL serveur...; Flags: runhidden
[Code]
var
DirPage: TInputDirWizardPage;
function GetDir(Param: String): String;
begin
Result := DirPage.Values[StrToInt(Param)];
end;
procedure InitializeWizard;
begin
{ create a directory input page }
DirPage := CreateInputDirPage(
wpSelectDir, 'Moteur base de données', 'Choisir un emplacement de destination du setupSQL', 'SubCaption', False, '');
{ add directory input page items }
DirPage.Add('Répertoire installation SQL');
{ assign default directories for the items from the previously stored data; if }
{ there are no data stored from the previous installation, use default folders }
{ of your choice }
DirPage.Values[0] := GetPreviousData('Répertoire installation SQL', 'C:\');
end;
procedure RegisterPreviousData(PreviousDataKey: Integer);
begin
{ store chosen directories for the next run of the setup }
SetPreviousData(PreviousDataKey, 'Directory1', DirPage.Values[0]);
end;
...
但是安装完成后,弹出一个错误提示:
Unable to execute file:
C:\folderIchoose\installSQL.bat Parameters: C:\folderIchoose\
CreateProcess failed; code 2.
The system cannot find the file specified.
当我转到 C:\folderIchoose
时,installSQL.bat
就在那里,当我尝试使用 cmd 启动和参数时,它有效...为什么它会说找不到文件?
我想用我的 bach 文件夹的名称作为参数启动我的批处理(不确定是否清楚...)
谢谢。
您在 Parameters:
之前少了一个分号。所以它被认为是批处理文件路径的一部分。
应该是:
[Run]
Filename: {code:GetDir|0}\installSQL\installSQL.bat; Parameters: ...
在我的 Inno 安装脚本中,我有这一行:
[Files]
Source: C:\CLIENTS\ACSORDER\DeployAcsOrder\installSQL\*; DestDir: "{code:GetDir|0}\installSQL";
[Run]
Filename: {code:GetDir|0}\installSQL\installSQL.bat Parameters: {code:GetDir|0}\installSQL; Description: {cm:LaunchProgram,LumisTraiteur}; StatusMsg: Installation SQL serveur...; Flags: runhidden
[Code]
var
DirPage: TInputDirWizardPage;
function GetDir(Param: String): String;
begin
Result := DirPage.Values[StrToInt(Param)];
end;
procedure InitializeWizard;
begin
{ create a directory input page }
DirPage := CreateInputDirPage(
wpSelectDir, 'Moteur base de données', 'Choisir un emplacement de destination du setupSQL', 'SubCaption', False, '');
{ add directory input page items }
DirPage.Add('Répertoire installation SQL');
{ assign default directories for the items from the previously stored data; if }
{ there are no data stored from the previous installation, use default folders }
{ of your choice }
DirPage.Values[0] := GetPreviousData('Répertoire installation SQL', 'C:\');
end;
procedure RegisterPreviousData(PreviousDataKey: Integer);
begin
{ store chosen directories for the next run of the setup }
SetPreviousData(PreviousDataKey, 'Directory1', DirPage.Values[0]);
end;
...
但是安装完成后,弹出一个错误提示:
Unable to execute file:
C:\folderIchoose\installSQL.bat Parameters: C:\folderIchoose\CreateProcess failed; code 2.
The system cannot find the file specified.
当我转到 C:\folderIchoose
时,installSQL.bat
就在那里,当我尝试使用 cmd 启动和参数时,它有效...为什么它会说找不到文件?
我想用我的 bach 文件夹的名称作为参数启动我的批处理(不确定是否清楚...)
谢谢。
您在 Parameters:
之前少了一个分号。所以它被认为是批处理文件路径的一部分。
应该是:
[Run]
Filename: {code:GetDir|0}\installSQL\installSQL.bat; Parameters: ...