void CExport::PreviewDebug(CApplication* pApplication, int layoutid) { ProgressDlg.Start("Loading debug"); m_bScreensaver = false; application = pApplication; LayoutBlock.allocator = &g_allocator; eventBlock.allocator = &g_allocator; appBlock.allocator = &g_allocator; imageBlock.allocator = &g_allocator; hlslBlock.allocator = &g_allocator; menuBlock.allocator = &g_allocator; CPath path; path.SetToAppDataDirectory("Scirra"); CString OutPath = GetTempExeFile(path.GetFullPath()); CString iniPath; iniPath.Format("%sConstruct.ini", path.GetFullPath()); CIni ini; ini.SetPathName(iniPath); path.SetToCurrentDirectory(); ini.WriteString("Path", "Install", path.GetFullPath()); CString DataEXE; if (application->runtime == CApplication::rt_application) DataEXE.Format("%sData\\App_pd", path.GetFullPath()); else if (application->runtime == CApplication::rt_directx) DataEXE.Format("%sData\\DX9_pd", path.GetFullPath()); if (application->game_information.use_python) DataEXE += "s"; // script enabled DataEXE += ".exe"; // Copy runtime.exe to the target file CopyFile(DataEXE, OutPath, false); // File copied, assume 10% ProgressDlg.SetProgress(10); DoExport(true, OutPath, false, layoutid); // Execute temp ShellExecute(NULL, "open", OutPath, NULL, NULL, SW_SHOW); // Done ProgressDlg.Finish(); }