Skip to content

Commit 07d8d18

Browse files
author
markus
committed
backupdir is now relative to .\
1 parent 5a1930f commit 07d8d18

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

cpupdate_portable.bat

+15-11
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ if exist "%destination%" (
101101

102102
rem Backup directory
103103
set "curpath=%cd%"
104-
set backupdir=%curpath%\cpbackup
105-
echo Your backup folder is: %backupdir%
104+
set backupdir=.\cpbackup
105+
echo Your backup folder is: %curpath%\cpbackup
106106

107107
rem Extract moddesc.xml from ZIPFILE
108108
if %deployment%=="ZIPFILE" (
@@ -182,12 +182,9 @@ if %freshinstall%=="no" (
182182
echo Creating a backup of your current Courseplay...
183183
mkdir %backupdir% 2> NUL
184184
if %deployment%=="DIRECTORY" (
185-
echo backupfile: %backupfile%
186-
pause
187185
%zipexe% a -r "%backupfile%" "%destination%\*" >NUL 2>&1
188-
) else (
189-
190-
copy "%destination%" "%backupfile%" > NUL
186+
) else (
187+
copy "%destination%" %backupfile% > NUL
191188
)
192189
) else (
193190
echo No former version found - this seems to be a fresh install. Creating new mod directory for Courseplay...
@@ -204,8 +201,7 @@ rem Copy cloned directory to mod folder
204201
if %deployment%=="DIRECTORY" (
205202
echo Copying the update to your mod folder...
206203
xcopy /S /E /H /Y /C /Q ".\courseplay\*.*" "%destination%\" >NUL
207-
)
208-
if %deployment%=="ZIPFILE" (
204+
) else (
209205
echo Copying the updated Courseplay directory as ZIP file to your mod folder...
210206
%zipexe% a -r -tzip "%destination%" .\courseplay\* >NUL 2>&1
211207
)
@@ -229,9 +225,17 @@ if "%zipok%"=="-1" (
229225
goto ende
230226

231227
:ende
232-
del /q "%TEMP%\getversion.vbs" >NUL
228+
rem Cleanup
229+
if exist "%TEMP%\getversion.vbs" (
230+
del /q "%TEMP%\getversion.vbs" >NUL
231+
)
232+
rem Goodbye
233233
echo.
234-
echo Thanks for using me. (Any key to exit)
234+
echo You should check for an update of cpupdate from time to time:
235+
echo https://github.com/elpatron68/cpupdate/releases
236+
echo .
237+
echo Bye, and thanks for the fish.
235238
if %autoclose%=="No" (
239+
echo ^(Any key to exit^)
236240
pause >NUL
237241
)

0 commit comments

Comments
 (0)