inno setup에서 쉘 스크립트를 실행하려고하는데 실패했다.InnoSetup - 쉘 스크립트를 인식하지 못한다.
이procedure CurStepChanged(CurStep: TSetupStep);
var
ErrorCode: Integer;
cmdString: String;
begin
if (CurStep=ssInstall)
then
cmdString := 'net stop wuauserv';
Exec(ExpandConstant('{cmd}'), '/C ' + cmdString, '', SW_SHOW, ewWaitUntilTerminated, ErrorCode);
if (CurStep=ssPostInstall)
then
cmdString := 'net start wuauserv';
Exec(ExpandConstant('{cmd}'), '/C ' + cmdString, '', SW_SHOW, ewWaitUntilTerminated, ErrorCode);
if Exec(ExpandConstant('{cmd}'), '/c {tmp}/wsus.bat', '', SW_SHOW, ewWaitUntilTerminated, ErrorCode) then
if (CurStep=ssDone)
then
cmdString := 'wuauclt /resetauthorization /detectnow & pause';
Exec(ExpandConstant('{cmd}'), '/C ' + cmdString, '', SW_SHOW, ewWaitUntilIdle, ErrorCode);
end;
처음이 잘 실행 표시되는 마지막 명령이 실패 오류와 함께, : 여기 내 코드는
'wuauclt' is not recognized as an internal or external command,
operable program or batch file.
Press any key to continue . .
어떤 제안? 올바른 작업 디렉토리를 설정하지 않는다고 생각합니다. Exec (ExpandConstant ('{win}'), Exec (ExpandConstant ('{sys}') 및 Exec (ExpandConstant ('{cmd}')를 사용해 보았습니다. 당신이 뉴스 그룹에 게시 된 정보를 사용하여
내가 당신이라면 Windows Update Agent API를 사용합니다. – TLama
내가 달성하고자하는 것에 너무 복잡하기 때문에 (또는 할 수있는 기술이 필요함). 위의 명령은 그것을 복잡하게하지 않고도 내 목표에 완벽하게 적합 할 것입니다. 왜 제대로 작동하지 않는지 알아낼 수만 있다면. 내 설치의 일환으로 그것은 응용 프로그램 디렉토리에 박쥐 파일을 복사합니다. 설치 프로그램 외부에서이를 실행하면 [RUN] 또는 위의 명령문을 사용하여 실행해도 실패합니다. – copyandpaster
다시 시도하면 .bat 파일이 app 디렉토리에 설치되고 inno setup 파일을 통해 실행되지만 .. app 디렉토리에서 직접 파일을 실행하면 wuauclt가 인식되지 않는 것과 같은 오류가 발생합니다. – copyandpaster