Changeset 496
- Timestamp:
- Feb 22, 2010, 1:00:55 AM (15 years ago)
- Location:
- AE/Installer/trunk/source
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
AE/Installer/trunk/source/installer.cpp
r489 r496 1143 1143 #ifdef WIN32 1144 1144 // TODO: Fill in Windows equivalent of code below :-3 1145 popenCommand = "replace_installer.bat"; 1145 1146 #else 1146 1147 // We can't just use '~' to mean "the home directory" because we need to check the path in C... … … 1164 1165 file.close(); 1165 1166 file.clear(); 1167 #ifdef WIN32 1168 system(popenCommand.c_str()); 1169 #else 1166 1170 popen(popenCommand.c_str(), "r"); 1167 1171 #endif 1168 1172 return true; // returning 'true' tells the Installer to quit itself ASAP so it can be replaced by the process that is now running 1169 1173 } … … 1196 1200 // TODO: Fill in Windows equivalent of code below 1197 1201 #ifdef WIN32 1198 string strTrashDir = " %RECYCLE%";1202 string strTrashDir = "Trash\\"; 1199 1203 #else 1200 1204 FILE *fUserName = NULL; … … 1241 1245 } 1242 1246 } 1243 1247 #ifndef WIN32 1244 1248 if (!*installerJustUpdated || needNewTrashDir) // prepare a new directory for deleted files to go to 1245 1249 { … … 1249 1253 create_directory(strTrashDir); 1250 1254 } 1255 #endif 1251 1256 file.close(); 1252 1257 file.clear(); … … 1324 1329 aParentPath = aParentPath + "/"; 1325 1330 } 1331 #ifndef WIN32 1326 1332 rename((path)("../" + thePath), (path)(strTrashDir + thePath)); 1333 #else 1334 remove((path)("../" + thePath)); 1335 #endif 1327 1336 } 1328 1337 } … … 1347 1356 if (iter1->modStringVersion > iter2->modStringVersion) 1348 1357 { 1358 #ifndef WIN32 1349 1359 rename((path)(strPathToPackages + iter2->modStringName), (path)(strTrashDir + iter2->modStringName)); 1360 #else 1361 remove((path)(strPathToPackages + iter2->modStringName)); 1362 #endif 1350 1363 rename((path)(strPathToEUFNPackages + iter1->modStringName), (path)(strPathToPackages + iter1->modStringName)); 1351 1364 } -
AE/Installer/trunk/source/replace_installer.bat
r491 r496 1 SLEEP 1 2 REM %~dp is the directory of the batch file 3 if exist %~dp\AEInstaller.exe (4 if exist %~dp\..\..\..\install\AEInstaller.exe (5 DEL %11 PING -n 1 127.0.0.1>nul 2 cd "%~dp0" /D 3 if exist AEInstaller.exe ( 4 if exist .\..\..\..\install\AEInstaller.exe ( 5 DEL .\..\..\..\install\AEInstaller.exe 6 6 ) 7 else ( 8 exit 9 ) 10 MOVE %~dp/AEInstaller.exe %~dp\..\..\..\install\ 11 START %~dp\..\..\..\install\AEInstaller.exe 7 8 COPY AEInstaller.exe .\..\..\..\install\ 9 START ..\..\..\install\AEInstaller.exe 12 10 ) 13 ELSE (14 START %~dp\AEInstaller.exe15 )
Note:
See TracChangeset
for help on using the changeset viewer.