modules/jdk.packager/src/main/native/library/common/WindowsPlatform.cpp

Print this page




 237     MessageBox(NULL, description.data(), appname.data(), MB_ICONERROR | MB_OK);
 238 }
 239 
 240 MessageResponse WindowsPlatform::ShowResponseMessage(TString title, TString description) {
 241     MessageResponse result = mrCancel;
 242 
 243     if (::MessageBox(NULL, description.data(), title.data(), MB_OKCANCEL) == IDOK) {
 244         result = mrOK;
 245     }
 246 
 247     return result;
 248 }
 249 
 250 //MessageResponse WindowsPlatform::ShowResponseMessage(TString description) {
 251 //    TString appname = GetModuleFileName();
 252 //    appname = FilePath::ExtractFileName(appname);
 253 //    return ShowResponseMessage(appname, description);
 254 //}
 255 
 256 TString WindowsPlatform::GetBundledJVMLibraryFileName(TString RuntimePath) {
 257 #ifdef USE_JLI_LAUNCH
 258     TString result = FilePath::IncludeTrailingSeparater(RuntimePath) +
 259         _T("jre\\bin\\jli.dll");
 260 
 261     if (FilePath::FileExists(result) == false) {
 262         result = FilePath::IncludeTrailingSeparater(RuntimePath) +
 263             _T("bin\\jli.dll");
 264     }
 265 #else
 266     TString result = FilePath::IncludeTrailingSeparater(RuntimePath) +
 267         _T("jre\\bin\\client\\jvm.dll");
 268 
 269     if (FilePath::FileExists(result) == false) {
 270         result = FilePath::IncludeTrailingSeparater(RuntimePath) +
 271             _T("jre\\bin\\server\\jvm.dll");
 272     }
 273 
 274     if (FilePath::FileExists(result) == false) {
 275         result = FilePath::IncludeTrailingSeparater(RuntimePath) +
 276             _T("bin\\client\\jvm.dll");
 277     }
 278 
 279     if (FilePath::FileExists(result) == false) {
 280         result = FilePath::IncludeTrailingSeparater(RuntimePath) +
 281             _T("bin\\server\\jvm.dll");
 282     }
 283 #endif
 284 
 285     return result;
 286 }
 287 
 288 TString WindowsPlatform::GetSystemJVMLibraryFileName() {
 289     TString result;
 290     TString jvmPath = GetSystemJRE();
 291 
 292     if (jvmPath.empty() == false) {
 293         result = GetBundledJVMLibraryFileName(jvmPath);
 294     }
 295 
 296     return result;
 297 }
 298 
 299 ISectionalPropertyContainer* WindowsPlatform::GetConfigFile(TString FileName) {
 300     IniFile *result = new IniFile();
 301 
 302     if (result->LoadFromFile(FileName) == false) {
 303         // New property file format was not found, attempt to load old property file format.




 237     MessageBox(NULL, description.data(), appname.data(), MB_ICONERROR | MB_OK);
 238 }
 239 
 240 MessageResponse WindowsPlatform::ShowResponseMessage(TString title, TString description) {
 241     MessageResponse result = mrCancel;
 242 
 243     if (::MessageBox(NULL, description.data(), title.data(), MB_OKCANCEL) == IDOK) {
 244         result = mrOK;
 245     }
 246 
 247     return result;
 248 }
 249 
 250 //MessageResponse WindowsPlatform::ShowResponseMessage(TString description) {
 251 //    TString appname = GetModuleFileName();
 252 //    appname = FilePath::ExtractFileName(appname);
 253 //    return ShowResponseMessage(appname, description);
 254 //}
 255 
 256 TString WindowsPlatform::GetBundledJVMLibraryFileName(TString RuntimePath) {

 257     TString result = FilePath::IncludeTrailingSeparater(RuntimePath) +
 258         _T("jre\\bin\\jli.dll");
 259 
 260     if (FilePath::FileExists(result) == false) {
 261         result = FilePath::IncludeTrailingSeparater(RuntimePath) +
 262             _T("bin\\jli.dll");
 263     }



















 264 
 265     return result;
 266 }
 267 
 268 TString WindowsPlatform::GetSystemJVMLibraryFileName() {
 269     TString result;
 270     TString jvmPath = GetSystemJRE();
 271 
 272     if (jvmPath.empty() == false) {
 273         result = GetBundledJVMLibraryFileName(jvmPath);
 274     }
 275 
 276     return result;
 277 }
 278 
 279 ISectionalPropertyContainer* WindowsPlatform::GetConfigFile(TString FileName) {
 280     IniFile *result = new IniFile();
 281 
 282     if (result->LoadFromFile(FileName) == false) {
 283         // New property file format was not found, attempt to load old property file format.