diff --git a/stepmania/Themes/default/Languages/en.ini b/stepmania/Themes/default/Languages/en.ini index 172af5dc74..32a4d4b63d 100644 --- a/stepmania/Themes/default/Languages/en.ini +++ b/stepmania/Themes/default/Languages/en.ini @@ -18,6 +18,7 @@ No Installations found. Exiting.=No Installations found. Exiting. Package installed successfully!=Package installed successfully! [CSmpackageApp] +The file Stats.xml has not yet been created. It will be created once the game is run.=The file Stats.xml has not yet been created. It will be created once the game is run. Failed to open '%s': %s=Failed to open '%s': %s The file '%s' does not exist. Aborting installation.=The file '%s' does not exist. Aborting installation. diff --git a/stepmania/src/smpackage/smpackage.cpp b/stepmania/src/smpackage/smpackage.cpp index 6bb16fbea3..6082b10b88 100644 --- a/stepmania/src/smpackage/smpackage.cpp +++ b/stepmania/src/smpackage/smpackage.cpp @@ -42,6 +42,7 @@ CSmpackageApp theApp; #include "archutils/Win32/CommandLine.h" extern RString GetLastErrorString(); +static LocalizedString STATS_XML_NOT_YET_CREATED ( "CSmpackageApp", "The file Stats.xml has not yet been created. It will be created once the game is run." ); static LocalizedString FAILED_TO_OPEN ( "CSmpackageApp", "Failed to open '%s': %s" ); static LocalizedString THE_FILE_DOES_NOT_EXIST ( "CSmpackageApp", "The file '%s' does not exist. Aborting installation." ); BOOL CSmpackageApp::InitInstance() @@ -119,7 +120,11 @@ BOOL CSmpackageApp::InitInstance() { RString sPersonalDir = SpecialDirs::GetMyDocumentsDir(); RString sFile = sPersonalDir + PRODUCT_ID +"/Save/MachineProfile/Stats.xml"; - if( NULL == ::ShellExecute( NULL, "open", sFile, "", "", SW_SHOWNORMAL ) ) + HINSTANCE hinst = ::ShellExecute( NULL, "open", sFile, "", "", SW_SHOWNORMAL ); + // See MSDN for an explanation of this return value + if( (int)hinst == SE_ERR_FNF ) + Dialog::OK( STATS_XML_NOT_YET_CREATED ); + else if( (int)hinst <= 32 ) Dialog::OK( ssprintf(FAILED_TO_OPEN.GetValue(),sFile.c_str(),GetLastErrorString().c_str()) ); exit(1); // better way to quit? }