-bool check_version(){
- // a safe check to avoid people running broken installations
- // (otherwise, they run it, crash it, and blame us for not forcing them hard enough to pay attention while installing)
- // make something idiot proof and someone will make better idiots, this may be overkill
- // let's leave it disabled in debug mode in any case
- // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=431
-#ifndef _DEBUG
-#define CHECK_VERSION
-#endif
-#ifdef CHECK_VERSION
- // locate and open RADIANT_MAJOR and RADIANT_MINOR
- bool bVerIsGood = true;
- {
- StringOutputStream ver_file_name( 256 );
- ver_file_name << AppPath_get() << "RADIANT_MAJOR";
- bVerIsGood = check_version_file( ver_file_name.c_str(), RADIANT_MAJOR_VERSION );
- }
- {
- StringOutputStream ver_file_name( 256 );
- ver_file_name << AppPath_get() << "RADIANT_MINOR";
- bVerIsGood = check_version_file( ver_file_name.c_str(), RADIANT_MINOR_VERSION );
- }
-
- if ( !bVerIsGood ) {
- StringOutputStream msg( 256 );
- msg << "This editor binary (" RADIANT_VERSION ") doesn't match what the latest setup has configured in this directory\n"
- "Make sure you run the right/latest editor binary you installed\n"
- << AppPath_get();
- ui::alert( 0, msg.c_str(), "Radiant", eMB_OK, eMB_ICONDEFAULT );
- }
- return bVerIsGood;
-#else
- return true;
-#endif
-}
-