preparing for future additions
This commit is contained in:
@@ -13,15 +13,15 @@
|
|||||||
#include "RageFileManager.h"
|
#include "RageFileManager.h"
|
||||||
#include "SpecialFiles.h"
|
#include "SpecialFiles.h"
|
||||||
|
|
||||||
|
// only used for Version()
|
||||||
#if defined(_WINDOWS)
|
#if defined(_WINDOWS)
|
||||||
// fuck you
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <conio.h>
|
#include <conio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const RString INSTALLER_LANGUAGES_DIR = "Themes/_Installer/Languages/";
|
const RString INSTALLER_LANGUAGES_DIR = "Themes/_Installer/Languages/";
|
||||||
|
|
||||||
static const RString TEMP_MOUNT_POINT = "/@tempinstallpackage/";
|
static const RString TEMP_ZIP_MOUNT_POINT = "/@temp-zip/";
|
||||||
|
|
||||||
static bool IsPackageFile( RString sFile )
|
static bool IsPackageFile( RString sFile )
|
||||||
{
|
{
|
||||||
@@ -85,17 +85,17 @@ void CommandLineActions::Install()
|
|||||||
RString sOsDir, sFilename, sExt;
|
RString sOsDir, sFilename, sExt;
|
||||||
splitpath( *s, sOsDir, sFilename, sExt );
|
splitpath( *s, sOsDir, sFilename, sExt );
|
||||||
|
|
||||||
FILEMAN->Mount( "dir", sOsDir, TEMP_MOUNT_POINT );
|
FILEMAN->Mount( "dir", sOsDir, TEMP_ZIP_MOUNT_POINT );
|
||||||
|
|
||||||
// TODO: Validate that this zip contains files for this version of StepMania
|
// TODO: Validate that this zip contains files for this version of StepMania
|
||||||
|
|
||||||
bool bFileExists = DoesFileExist( SpecialFiles::USER_PACKAGES_DIR + sFilename + sExt );
|
bool bFileExists = DoesFileExist( SpecialFiles::USER_PACKAGES_DIR + sFilename + sExt );
|
||||||
if( FileCopy( TEMP_MOUNT_POINT + sFilename + sExt, SpecialFiles::USER_PACKAGES_DIR + sFilename + sExt ) )
|
if( FileCopy( TEMP_ZIP_MOUNT_POINT + sFilename + sExt, SpecialFiles::USER_PACKAGES_DIR + sFilename + sExt ) )
|
||||||
vSucceeded.push_back( FileCopyResult(*s,bFileExists ? "overwrote existing file" : "") );
|
vSucceeded.push_back( FileCopyResult(*s,bFileExists ? "overwrote existing file" : "") );
|
||||||
else
|
else
|
||||||
vFailed.push_back( FileCopyResult(*s,ssprintf("error copying file to '%s'",sOsDir.c_str())) );
|
vFailed.push_back( FileCopyResult(*s,ssprintf("error copying file to '%s'",sOsDir.c_str())) );
|
||||||
|
|
||||||
FILEMAN->Unmount( "dir", sOsDir, TEMP_MOUNT_POINT );
|
FILEMAN->Unmount( "dir", sOsDir, TEMP_ZIP_MOUNT_POINT );
|
||||||
}
|
}
|
||||||
if( vSucceeded.empty() && vFailed.empty() )
|
if( vSucceeded.empty() && vFailed.empty() )
|
||||||
{
|
{
|
||||||
@@ -196,6 +196,7 @@ void CommandLineActions::Version()
|
|||||||
freopen( "CONOUT$","wb", stderr );
|
freopen( "CONOUT$","wb", stderr );
|
||||||
|
|
||||||
fprintf(stdout, "Version Information:\n%s %s\n", sProductID.c_str(), sVersion.c_str() );
|
fprintf(stdout, "Version Information:\n%s %s\n", sProductID.c_str(), sVersion.c_str() );
|
||||||
|
fprintf(stdout, "Press any key to exit." );
|
||||||
_getch();
|
_getch();
|
||||||
#endif // WIN32 && !_XBOX
|
#endif // WIN32 && !_XBOX
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user