#if defined(HAVE_CRASHRPT)
#include <CrashRpt.h>
+
+bool global_crashRptEnabled = false;
+
#endif
std::string homedir;
// Restart the app on crash
info.dwFlags |= CR_INST_SEND_QUEUED_REPORTS;
- // autoamticallty install handlers for all threads
+ // automatically install handlers for all threads
info.dwFlags |= CR_INST_AUTO_THREAD_HANDLERS;
// Define the Privacy Policy URL
// Install crash reporting
int nResult = crInstall(&info);
if(nResult!=0) {
- std::cerr << "failed to install crash reporting engine" << std::endl;
+ char buf[1024];
+ crGetLastErrorMsg(buf, 1024);
+ flightgear::modalMessageBox("CrashRpt setup failed",
+ "Failed to setup crash-reporting engine, check the installation is not damaged.",
+ buf);
} else {
- crAddProperty("hudson-build-id", HUDSON_BUILD_ID);
+ global_crashRptEnabled = true;
+
+ crAddProperty("hudson-build-id", HUDSON_BUILD_ID);
+ char buf[16];
+ ::snprintf(buf, 16, "%d", HUDSON_BUILD_NUMBER);
+ crAddProperty("hudson-build-number", buf);
}
#endif