![第二个安装程序执行得太早,没有等待第一个安装程序完成](https://linux22.com/image/1537060/%E7%AC%AC%E4%BA%8C%E4%B8%AA%E5%AE%89%E8%A3%85%E7%A8%8B%E5%BA%8F%E6%89%A7%E8%A1%8C%E5%BE%97%E5%A4%AA%E6%97%A9%EF%BC%8C%E6%B2%A1%E6%9C%89%E7%AD%89%E5%BE%85%E7%AC%AC%E4%B8%80%E4%B8%AA%E5%AE%89%E8%A3%85%E7%A8%8B%E5%BA%8F%E5%AE%8C%E6%88%90.png)
这是我的自提取脚本:
;Il commento che segue contiene dei comandi per lo script del modulo auto-
estraente
Setup="uTorrent quick installer\Install.bat"
Setup="%COMSPEC%" /c RD /s /q "uTorrent quick installer" 2> NUL
Silent=1
此批处理文件的内容不相关。这是安装文件:
@echo off
setlocal EnableExtensions DisableDelayedExpansion
CD "uTorrent quick installer"
:Inizio
TASKLIST | FINDSTR uTorrent.exe > NUL 2> NUL
IF %ERRORLEVEL%==0 (
cls
echo Chiudere uTorrent per far partire l'installazione...
timeout /t 1 /nobreak > NUL
goto Inizio
)
cls
IF NOT DEFINED PROGRAMFILES(X86) (set "PROGRAMFILES(X86)=%PROGRAMFILES%")
set MESSAGGIO1=0
set MESSAGGIO2=0
IF NOT EXIST "%USERPROFILE%\Desktop\Torrent da importare" (set MESSAGGIO1=1)
IF EXIST "%APPDATA%\uTorrent\*.torrent" (
set MESSAGGIO2=1
XCOPY /q /y "%APPDATA%\uTorrent\*.torrent" "%USERPROFILE%\Desktop\Torrent da importare\" > NUL
)
IF EXIST "%PROGRAMFILES(X86)%\uTorrent\*.torrent" (
set MESSAGGIO2=1
XCOPY /q /y "%PROGRAMFILES(X86)%\uTorrent\*.torrent" "%USERPROFILE%\Desktop\Torrent da importare\" > NUL
)
DEL /q "%USERPROFILE%\Desktop\uTorrent.lnk" 2> NUL
DEL /q "%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\uTorrent.lnk" 2> NUL
syspin.exe "%APPDATA%\uTorrent\uTorrent.exe" c:5387 > NUL
RD /s /q "%PROGRAMFILES(X86)%\uTorrent" 2> NUL
RD /s /q "%APPDATA%\uTorrent" 2> NUL
XCOPY /e /q /y uTorrent "%PROGRAMFILES(X86)%\uTorrent\" > NUL
Shortcut.exe /f:"%USERPROFILE%\Desktop\uTorrent.lnk" /a:c /t:"%PROGRAMFILES(X86)%\uTorrent\uTorrent.exe" > NUL
Shortcut.exe /f:"%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs/uTorrent.lnk" /a:c /t:"%PROGRAMFILES(X86)%\uTorrent\uTorrent.exe" > NUL
syspin.exe "%PROGRAMFILES(X86)%\uTorrent\uTorrent.exe" c:5386 > NUL
echo Applicazione installata.
IF %MESSAGGIO2%==1 (
IF %MESSAGGIO1%==1 (
echo E' stata creata la cartella "Torrent da importare" sul Desktop.
timeout /t 2 /nobreak > NUL
) ELSE (
echo E' stato aggiornato il contenuto della cartella sul Desktop "Torrent da importare".
timeout /t 3 /nobreak > NUL
)
)
timeout /t 2 /nobreak > NUL
start "" "%PROGRAMFILES(X86)%\uTorrent\uTorrent.exe"
endlocal
(这批工作完美)。
答案1
我解决了!
;Il commento che segue contiene dei comandi per lo script del modulo auto-estraente
Path="%TEMP%"
Setup="uTorrent quick installer\Install.bat"
Setup="%COMSPEC%" /c RD /s /q "uTorrent quick installer" 2> NUL
Setup="%COMSPEC%" /c start "" "%PROGRAMFILES(X86)%\uTorrent\uTorrent.exe"
SetupCode
Silent=1
这是批处理文件:
@echo off
setlocal EnableExtensions DisableDelayedExpansion
CD "uTorrent quick installer"
:Inizio
TASKLIST | FINDSTR uTorrent.exe > NUL 2> NUL
IF %ERRORLEVEL%==0 (
cls
echo Chiudere uTorrent per far partire l'installazione...
timeout /t 1 /nobreak > NUL
goto Inizio
)
cls
IF NOT DEFINED PROGRAMFILES(X86) (set "PROGRAMFILES(X86)=%PROGRAMFILES%")
set MESSAGGIO1=0
set MESSAGGIO2=0
IF NOT EXIST "%USERPROFILE%\Desktop\Torrent da importare" (set MESSAGGIO1=1)
IF EXIST "%APPDATA%\uTorrent\*.torrent" (
set MESSAGGIO2=1
XCOPY /q /y "%APPDATA%\uTorrent\*.torrent" "%USERPROFILE%\Desktop\Torrent da importare\" > NUL
)
IF EXIST "%PROGRAMFILES(X86)%\uTorrent\*.torrent" (
set MESSAGGIO2=1
XCOPY /q /y "%PROGRAMFILES(X86)%\uTorrent\*.torrent" "%USERPROFILE%\Desktop\Torrent da importare\" > NUL
)
DEL /q "%USERPROFILE%\Desktop\uTorrent.lnk" 2> NUL
DEL /q "%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\uTorrent.lnk" 2> NUL
syspin.exe "%APPDATA%\uTorrent\uTorrent.exe" c:5387 > NUL
RD /s /q "%PROGRAMFILES(X86)%\uTorrent" 2> NUL
RD /s /q "%APPDATA%\uTorrent" 2> NUL
XCOPY /e /q /y uTorrent "%PROGRAMFILES(X86)%\uTorrent\" > NUL
Shortcut.exe /f:"%USERPROFILE%\Desktop\uTorrent.lnk" /a:c /t:"%PROGRAMFILES(X86)%\uTorrent\uTorrent.exe" > NUL
Shortcut.exe /f:"%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs/uTorrent.lnk" /a:c /t:"%PROGRAMFILES(X86)%\uTorrent\uTorrent.exe" > NUL
syspin.exe "%PROGRAMFILES(X86)%\uTorrent\uTorrent.exe" c:5386 > NUL
echo Applicazione installata.
IF %MESSAGGIO2%==1 (
IF %MESSAGGIO1%==1 (
echo E' stata creata la cartella "Torrent da importare" sul Desktop.
timeout /t 2 /nobreak > NUL
) ELSE (
echo E' stato aggiornato il contenuto della cartella sul Desktop "Torrent da importare".
timeout /t 3 /nobreak > NUL
)
)
timeout /t 2 /nobreak > NUL
endlocal