void Updater::DO_Uninstall(void) { // removes executable String path; #ifdef PLATFORM_POSIX path = AppendFileName(GetProgramsFolder(), appName); #else path = AppendFileName(GetProgramsFolder(), appName + "/" + appName + ".exe"); #endif FileDelete(path); // removes system config folder // leaves user one alone, it can contain user data // (on win32, that's also the program folder) DeleteFolderDeep(systemConfigPath); // unlink application from shess ShellUnlink(); // signal op success and leave // as it was uninstalling, it will restart // launching app (uninstaller, possibily) SucceedUpdate(); RestartApp(RestartTemp); }
String MakeBuild::OutDir(const Index<String>& cfg, const String& package, const VectorMap<String, String>& bm, bool use_target) { Index<String> excl; excl.Add(bm.Get("BUILDER", "GCC")); excl.Add("MSC"); LocalHost().AddFlags(excl); Vector<String> x; bool dbg = cfg.Find("DEBUG_FULL") >= 0 || cfg.Find("DEBUG_MINIMAL") >= 0; if(cfg.Find("DEBUG") >= 0) { excl.Add("BLITZ"); if(cfg.Find("BLITZ") < 0) x.Add("NOBLITZ"); } else if(dbg) x.Add("RELEASE"); if(use_target) excl.Add("MAIN"); for(int i = 0; i < cfg.GetCount(); i++) if(excl.Find(cfg[i]) < 0) x.Add(cfg[i]); Sort(x); for(int i = 0; i < x.GetCount(); i++) x[i] = InitCaps(x[i]); String outdir = GetVar("OUTPUT"); if(output_per_assembly) outdir = AppendFileName(outdir, GetVarsName()); if(!use_target) outdir = AppendFileName(outdir, package); outdir = AppendFileName(outdir, GetFileTitle(method) + "." + Join(x, ".")); outdir = Filter(outdir, CharFilterSlash); return outdir; }
void MapEditor::OnLevelMapCalc(Level& level, int number) { if (level.GetMapBG().IsEmpty()) { Exclamation(NFormat(t_("Please, select the image for level: %s"), level.GetName())); return; } String fp = AppendFileName( AppendFileName( GetFileDirectory(GetExeFilePath()), "Maps"), level.GetMapBG()); if (!FileExists(fp)) { Exclamation(NFormat(t_("Image file not exist: %s"), fp)); return; } String name = level.GetName(); double zx = level.GetZoomDX(); Size pz = level.GetPageSize(); Size sz = level.GetCellSize(); FileIn in(fp); One<StreamRaster> r = StreamRaster::OpenAny(in); if (!r) { Exclamation(NFormat(t_("Error while loading image file: %s"), fp)); return; } Image img = r->GetImage(); Calculate(sz.cx, sz.cy, pz.cx, pz.cy, zx, NFormat("%s-%d", _map.GetName(), number + 1), img); }
void Ide::ExportProject(const String& ep, bool all, bool gui, bool deletedir) { SaveFile(false); ::Workspace wspc; wspc.Scan(main); Index<String> used; HdependClearDependencies(); for(int i = 0; i < wspc.GetCount(); i++) { const Package& p = wspc.GetPackage(i); String pn = wspc[i]; for(int j = 0; j < p.GetCount(); j++) { const Package::File& f = p[j]; if(!f.separator) { String p = SourcePath(pn, f); used.FindAdd(p); Vector<String> d = HdependGetDependencies(p); for(int q = 0; q < d.GetCount(); q++) used.FindAdd(d[q]); for(int q = 0; q < f.depends.GetCount(); q++) used.FindAdd(SourcePath(pn, f.depends[q].text)); } } } if(FileExists(ep)) { if(gui && !PromptYesNo(DeQtf(ep) + " is existing file.&" "Do you want to delete it?")) return; FileDelete(ep); } if(deletedir && DirectoryExists(ep)) { if(gui && !PromptYesNo(DeQtf(ep) + " is existing directory.&" "Do you want to replace it?")) return; DeleteFolderDeep(ep); } Progress pi("Exporting project"); pi.SetTotal(wspc.GetCount()); for(int i = 0; i < wspc.GetCount(); i++) { if(gui && pi.StepCanceled()) return; CopyFolder(AppendFileName(ep, wspc[i]), PackageDirectory(wspc[i]), used, all, true); } Vector<String> upp = GetUppDirs(); for(int i = 0; i < upp.GetCount(); i++) { if(gui && pi.StepCanceled()) return; String d = upp[i]; FindFile ff(AppendFileName(d, "*")); while(ff) { if(ff.IsFile()) { String fn = ff.GetName(); String path = AppendFileName(d, fn); if(all || used.Find(path) >= 0) CopyFile(AppendFileName(ep, fn), path, true); } ff.Next(); } CopyFolder(AppendFileName(ep, wspc[i]), PackageDirectory(wspc[i]), used, all, true); } ExportMakefile(ep); }
void CodeBrowser::Load() { String find = ToUpper((String)~search); String match = ToUpper((String)~search_scope); String pm = GetPm(); Vector<String> txt; Vector<Value> ndx; Index<int> fi; Index<String> fs; for(int i = 0; i < CodeBase().GetCount(); i++) { String s = CodeBase().GetKey(i); const Array<CppItem>& n = CodeBase()[i]; if(s.GetCount()) if(MatchCib(s, match) && (MatchCib(s, find) || HasItem(n, find)) && MatchPm(n, pm)) { txt.Add(s); ndx.Add(s); } for(int i = 0; i < n.GetCount(); i++) { int f = n[i].file; if(fi.Find(f) < 0) { String s = GetFileText(GetSourceFilePath(f)); if(s.StartsWith(pm) && MatchCib(s, match) && (IsNull(find) || MatchCib(s, find) || n[i].uname.StartsWith(find))) { txt.Add(s); ndx.Add(f); fs.Add(s); fi.Add(f); } } } } const Workspace& wspc = GetIdeWorkspace(); for(int i = 0; i < wspc.GetCount(); i++) { String pn = wspc[i]; const Package& p = wspc.GetPackage(i); String pp = PackageDirectory(pn); for(int j = 0; j < p.GetCount(); j++) if(!p[j].separator) { String fn = AppendFileName(pp, p[j]); String s = GetFileText(AppendFileName(pn, p[j])); if(fs.Find(s) < 0 && (IsNull(find) || MatchCib(s, find)) && MatchCib(s, match) && MatchPm(fn, pm)) { int f = GetSourceFileIndex(SourcePath(pn, p[j])); txt.Add(s); ndx.Add(f); fs.Add(s); } } } IndexSort(txt, ndx, ScopeLess()); Value key = scope.GetKey(); int sc = scope.GetCursorSc(); scope.Clear(); for(int i = 0; i < txt.GetCount(); i++) scope.Add(IsString(ndx[i]) ? ndx[i] : Null, txt[i], ndx[i]); if(scope.FindSetCursor(key)) scope.ScCursor(sc); // clear.Enable(IsSearch()); }
bool InstallProgramGroup(const char *exe, const char *groupname, const char *lnk, int icon) { String dir = GetShellFolder("Common Programs", HKEY_LOCAL_MACHINE); if(groupname) { dir = AppendFileName(dir, groupname); CreateDirectory(dir, NULL); } return CreateShellLink(exe, AppendFileName(dir, lnk), "", icon); }
void GrabScreen::Init(GrabYourScreen &_program) { program = &_program; editFileNameGrab <<= AppendFileName(GetDesktopFolder(), "ScreenGrab.avi"); editFileNameGrab.Type(t_("Video file"), ".avi"); editTime <<= 5; editFrameRate <<= 1; opGrabMouse <<= true; swGrabMode.Add("Desktop"); swGrabMode.Add("Window"); #if defined(PLATFORM_WIN32) swGrabMode.Add("Rectangle"); #endif swGrabMode.MinCaseHeight(20); swGrabMode.SetData(0); swGrabMode.WhenAction = THISBACK(SwGrabMode_Action); SwGrabMode_Action(); #if defined(PLATFORM_WIN32) butGrab.WhenPush = THISBACK(ButGrab_Push); #else butGrab.Enable(false); editFileNameGrab.Enable(false); editTime.Enable(false); editFrameRate.Enable(false); opGrabMouse.Enable(false); editLeft.Hide(); editTop.Hide(); editWidth.Hide(); editHeight.Hide(); left.Hide(); top.Hide(); width.Hide(); height.Hide(); #endif editLeft <<= 100; editWidth <<= 1000; editTop <<= 100; editHeight <<= 900; String extension; editFileNameSnap <<= AppendFileName(GetDesktopFolder(), "ScreenSnap.jpg"); editFileNameSnap.Type(t_("Image file"), ".jpg"); butSnap.WhenPush = THISBACK(ButSnap_Push); Array<int64> hWnd, processId; Array<String> name, fileName, caption; GetWindowsList(hWnd, processId, name, fileName, caption, false); Sort(caption); for (int i = 0; i < caption.GetCount(); ++i) { if (!Trim(caption[i]).IsEmpty()) editWindowTitle.Add(caption[i]); } editWindowTitle.SetData(editWindowTitle.GetValue(0)); SetTimeCallback(-1000, THISBACK(Timer)); }
int DlgCompareDir::Refresh(String rel_path, int parent) { FindFile ff; VectorMap<String, FileInfo> afile, bfile; VectorMap<String, String> adir, bdir; String arel = AppendFileName(pa, rel_path); String brel = AppendFileName(pb, rel_path); int done = 0; if(!FetchDir(arel, afile, adir)) done |= 2; if(!FetchDir(brel, bfile, bdir)) done |= 1; Index<String> dir_index; dir_index <<= adir.GetIndex(); FindAppend(dir_index, bdir.GetKeys()); Vector<String> dirs(dir_index.PickKeys()); Sort(dirs, GetLanguageInfo()); for(int i = 0; i < dirs.GetCount(); i++) { int fa = adir.Find(dirs[i]), fb = bdir.Find(dirs[i]); String dn = (fb >= 0 ? bdir[fb] : adir[fa]); int dirpar = tree.Add(parent, CtrlImg::Dir(), dn); int dirdone = Refresh(AppendFileName(rel_path, dirs[i]), dirpar); done |= dirdone; switch(dirdone) { case 0: tree.Remove(dirpar); break; case 1: tree.SetNode(dirpar, TreeCtrl::Node().SetImage(CompDirImg::a_dir()).Set(dn)); break; case 2: tree.SetNode(dirpar, TreeCtrl::Node().SetImage(CompDirImg::b_dir()).Set(dn)); break; case 3: tree.SetNode(dirpar, TreeCtrl::Node().SetImage(CompDirImg::ab_dir()).Set(dn)); break; } } Index<String> name_index; name_index <<= afile.GetIndex(); FindAppend(name_index, bfile.GetKeys()); Vector<String> names(name_index.PickKeys()); Sort(names, GetLanguageInfo()); for(int i = 0; i < names.GetCount(); i++) { int fa = afile.Find(names[i]), fb = bfile.Find(names[i]); if(fa < 0) { tree.Add(parent, CompDirImg::b_file(), NFormat("%s: B (%`, %0n)", bfile[fb].name, bfile[fb].time, bfile[fb].size)); done |= 2; } else if(fb < 0) { tree.Add(parent, CompDirImg::a_file(), NFormat("%s: A (%`, %0n)", afile[fa].name, afile[fa].time, afile[fa].size)); done |= 1; } else if(afile[fa].size != bfile[fb].size || LoadFile(AppendFileName(arel, names[i])) != LoadFile(AppendFileName(brel, names[i]))) { tree.Add(parent, CompDirImg::ab_file(), NFormat("%s: A (%`, %0n), B (%`, %0n)", bfile[fb].name, afile[fa].time, afile[fa].size, bfile[fb].time, bfile[fb].size)); done |= 3; } } return done; }
void DlgCompareDir::DoTreeCursor() { String s = GetTreePath(); if(IsNull(s)) return; String fa = AppendFileName(pa, s), fb = AppendFileName(pb, s); String da = LoadFile(fa), db = LoadFile(fb); if(!IsNull(da) || !IsNull(db)) { if(IsNull(da) || IsNull(db)) { qtf.Hide(); lineedit.Show(); lineedit <<= Nvl(db, da); } else { lineedit.Hide(); qtf.Show(); String comptext = "[C2 "; Vector<String> la = GetStringLineMap(da), lb = GetStringLineMap(db); Array<TextSection> sections = CompareLineMaps(la, lb); for(int s = 0; s < sections.GetCount(); s++) { const TextSection& sec = sections[s]; if(sec.same) { comptext << "[@(0.0.0) \1"; if(sec.count1 <= 6) for(int i = 0; i < sec.count1; i++) comptext << ExpandTabs(la[i + sec.start1]) << '\n'; else { for(int i = 0; i < 3; i++) comptext << ExpandTabs(la[i + sec.start1]) << '\n'; comptext << "...\n"; for(int i = -3; i < 0; i++) comptext << ExpandTabs(la[i + sec.start1 + sec.count1]) << '\n'; } comptext << "\1]"; } else { if(sec.count1) { comptext << "[@(0.160.0) \1"; for(int i = 0; i < sec.count1; i++) comptext << ExpandTabs(la[sec.start1 + i]) << '\n'; comptext << "\1]"; } if(sec.count2) { comptext << "[@(0.0.255) \1"; for(int i = 0; i < sec.count2; i++) comptext << ExpandTabs(lb[sec.start2 + i]) << '\n'; comptext << "\1]"; } } } qtf.SetQTF(comptext); } } }
// fetch the new app version from server // and replaces older one // if ver is not specified, fetches the maximum available // one but which is less than or equal maxVersion bool Updater::FetchApp(ProductVersion ver, bool devel) { int err = 0; if(!ver) ver = FetchMaxValidVersion(acceptDevelVersions); if(!ver) return false; String appServerPath, destPath; #ifdef PLATFORM_POSIX appServerPath = GetPlatformRoot() + ver.ToString() + "/" + appName; destPath = AppendFileName(GetProgramsFolder(), appName); #else appServerPath = GetPlatformRoot() + ver.ToString() + "/" + appName + ".exe"; destPath = AppendFileName(GetProgramsFolder(), appName + "\\" + appName + ".exe"); RealizePath(destPath); #endif if(isWebServer) { http.Url(appServerPath); http.Timeout(1000*60*30); http.MaxContentSize(100000000); http.WhenDo = THISBACK(doProgress); // fetch version file from server appBuffer = http.Execute(); err = http.GetStatusCode(); if(err != 200 || http.IsAbort() || http.IsError()) { appBuffer = ""; return false; } // replaces/installs app if(!SaveFile(destPath, appBuffer)) return false; } else FileCopy(appServerPath, destPath); #ifdef PLATFORM_POSIX if(chmod(~destPath, 0755) != 0) return false; #endif // stores current version inside system config path if(!SaveFile(AppendFileName(systemConfigPath, "version"), ver.ToString())) return false; installedVersion = ver; return true; }
// app started, must check for update/install requests // returns true if app must continue execution, false otherwise bool Updater::DO_NormalRun(void) { // we now check if we just want to uninstall app // it can be done by command line --UNINSTALL option if(CommandLine().GetCount() && CommandLine()[0] == "--UNINSTALL") return START_Uninstall(); // if app not installed, we shall install it // (if any available version is present on server....) if(!appInstalled) { // fetch available application versions ProductVersions versions = FetchVersions(); // if versions present on server, install latest if(versions.GetCount()) return START_Install(); // otherwise resume execution -- it's an uninstalled run else return true; } // not installing nor uninstalling // we shall check which kind of update is enabled String updateMode; if(!FileExists(AppendFileName(userConfigPath, "UPDATER_MODE"))) { updateMode = "ASK"; SaveFile(AppendFileName(userConfigPath, "UPDATER_MODE"), updateMode); } else updateMode = LoadFile(AppendFileName(userConfigPath, "UPDATER_MODE")); // if updates are disabled, just do nothing if(updateMode == "DISABLED") return true; // if we don't have a new version available, just do nothing ProductVersion maxVer; if( (maxVer = FetchMaxValidVersion(acceptDevelVersions)) <= installedVersion) return true; // if we want manual updates, just ask if(updateMode == "ASK") if(!PromptYesNo(Format(t_("New version '%s' is available&Install it ?"), maxVer.ToString()))) return true; // updater enabled, start it // if update failed, resume normal run, otherwise exit // as the app will be launched again by updater itself return START_Update(); }
void InitWwwTpp() { String wwwtpp = AppendFileName(uppbox, "uppweb/www.tpp"); FindFile ff(AppendFileName(wwwtpp, "*")); static Vector<String> data; while(ff) { RLOG(ff.GetName()); Topic p = ReadTopic0(LoadFile(AppendFileName(wwwtpp, ff.GetName()))); data.Add(p.text); RegisterTopic__("<uppweb/www.tpp/all.i>", GetFileTitle(ff.GetName()), p.title, data.Top(), data.Top().GetCount()); ff.Next(); } };
String Nest::PackagePath0(const String& name) { String uppfile = NativePath(name); if(IsFullPath(uppfile)) return NormalizePath(uppfile); Vector<String> d = GetUppDirs(); String p; for(int i = 0; i < d.GetCount(); i++) { p = NormalizePath(AppendFileName(AppendFileName(d[i], uppfile), GetFileName(uppfile)) + ".upp"); if(FileExists(p)) return p; } return d.GetCount() ? NormalizePath(AppendFileName(AppendFileName(d[0], uppfile), GetFileName(uppfile)) + ".upp") : ""; }
void SearchForFiles(Index<String>& files, String dir, String mask, int readonly, Progress& pi) { FindFile ff(AppendFileName(dir, "*.*")); while(ff) { if(ff.IsFolder() && *ff.GetName() != '.') SearchForFiles(files, AppendFileName(dir, ff.GetName()), mask, readonly, pi); else if(ff.IsFile() && PatternMatchMulti(mask, ff.GetName())) { if(IsNull(readonly) || !!readonly == !!ff.IsReadOnly()) { if(pi.StepCanceled()) return; files.FindAdd(AppendFileName(dir, ff.GetName())); } } ff.Next(); } }
//============================================================================================== int UrpMain(UrpTopWindow &ctrlMain) { // When the dev version is run, it uses the config files in that folder so as to avoid // disturbing the useful user settings on the same computer for the app installed in // "Program Files". ASSERT(&ctrlMain); ctrlMain.configFileNameBase = ToLower(UrpString::GetWord(ctrlMain.Name(), 1)); // Get 2nd word in string (index zero-based) ctrlMain.binConfigFile = AppendFileName(ctrlMain.configFileFolder, ctrlMain.configFileNameBase + BIN_TAIL); ctrlMain.xmlConfigFile = AppendFileName(ctrlMain.configFileFolder, ctrlMain.configFileNameBase + XML_TAIL); RunWithConfig(ctrlMain, CONFIGACTION_LOAD_AND_SAVE, WINDOWINSTANCINGMETHOD_RUN); return 0; // Default exit code historically means success (MS-DOS) };
void MapEditor::OnSaveMap() { CalculateAllPrompt(); if (!StoreAsXMLFile(_map, _map.GetName(), AppendFileName( AppendFileName(GetFileDirectory(GetExeFilePath()), "Mipmaps"), _map.GetName() + ".map" ))) { Exclamation(t_("Error while saving map to file!")); } UpdateEditorCtrls(); }
bool FindFile::IsSymLink() const { String name = GetName(); if(GetFileExt(name) != ".lnk") return false; return sGetSymLinkPath0(AppendFileName(path, name), NULL); }
bool MapBG::Load(const char* fp) { if (!FileExists(fp)) { LOG(NFormat("MapBG: File not exists, \"%s\"", fp)); return false; } if (!LoadFromXMLFile(_levels, fp)) { LOG("MapBG: Error while loading map from XML-file!"); return false; } _mapDir = AppendFileName(GetFileDirectory(fp), GetFileTitle(fp)); _currLevel = _levels.GetCount() > 0 ? 0 : -1; if (_currLevel < 0) { LOG("MapBG: No zoom levels found in map!"); return false; } _recalc = true; return true; }
String GetExeFilePath() { static String exepath; ONCELOCK { const char *exe = procexepath_(); if(*exe) exepath = exe; else { String x = Argv0__; if(IsFullPath(x) && FileExists(x)) exepath = x; else { exepath = GetHomeDirFile("upp"); Vector<String> p = Split(FromSystemCharset(Environment().Get("PATH")), ':'); if(x.Find('/') >= 0) p.Add(GetCurrentDirectory()); for(int i = 0; i < p.GetCount(); i++) { String ep = NormalizePath(AppendFileName(p[i], x)); if(FileExists(ep)) exepath = ep; } } } } return exepath; }
std::string User( std::string subdirectory, bool roaming, std::string filename ) { std::string full_directory = "./"; char * home_path = getenv( "XDG_DATA_HOME" ); /* If XDG_DATA_HOME not set use HOME instead */ if ( home_path == NULL ) { home_path = getenv( "HOME" ); if ( home_path ) { full_directory.assign(home_path); full_directory.append("/.local/share"); } else { /* Fallback to current directory */ full_directory.assign("./"); } } else { full_directory.assign(home_path); } #endif AppendDirectoryAndCreate( full_directory, elix::program::_user ); AppendDirectoryAndCreate( full_directory, subdirectory ); AppendFileName( full_directory, filename ); return full_directory; }
std::string Resources( std::string subdirectory, std::string filename ) { std::string full_directory = "./"; std::string share_directory = elix::program::RootDirectory(); AppendDirectory( share_directory, "share" ); if ( elix::path::Exist( share_directory ) ) { full_directory = share_directory; } else { share_directory = elix::program::RootDirectory(); /* Takes into account the the binaries are stored in bin subdirectory */ size_t pos = share_directory.find_last_of(ELIX_DIR_SEPARATOR); if ( pos > 1 ) full_directory = share_directory.substr(0, pos); else full_directory = ".."; AppendDirectory( full_directory, "share" ); } AppendDirectoryAndCreate( full_directory, elix::program::_user ); AppendDirectoryAndCreate( full_directory, subdirectory ); AppendFileName( full_directory, filename ); return full_directory; }
std::string Vpath::GetFilePath (std::string const & fileName) { AppendFileName (fileName); std::string result = ToString (); RemoveFileName (); return result; }
std::string Cache( std::string filename ) { std::string full_directory; char * home_path = NULL; home_path = getenv( "XDG_CACHE_HOME" ); if ( !home_path ) { home_path = getenv( "HOME" ); if ( home_path ) { full_directory.assign(home_path); full_directory.append("/.ElixCache/"); elix::path::Create( full_directory ); } else { full_directory.assign("./.ElixCache/"); } elix::path::Create( full_directory ); } else { full_directory.assign( home_path ); } AppendDirectoryAndCreate( full_directory, elix::program::_user ); AppendFileName( full_directory, filename ); return full_directory; }
void WorkspaceWork::PackageCursor() { InvalidatePackageCache(); filelist.WhenBar.Clear(); actualpackage = GetActivePackage(); svn_dirs = false; if(actualpackage.IsEmpty()) return; if(actualpackage == METAPACKAGE) { actual.file.Clear(); actual.file.AddPick(Package::File(String(HELPNAME))); Vector<String> d = GetUppDirs(); for(int i = 0; i < d.GetCount(); i++) actual.file.AddPick(Package::File(AppendFileName(d[i], "$.tpp"))); actual.file.AddPick(Package::File(ConfigFile("global.defs"))); } else { String pp = PackagePathA(actualpackage); RealizePath(pp); actual.Load(pp); } LoadActualPackage(); filelist.Enable(); if(actualpackage != METAPACKAGE) filelist.WhenBar = THISBACK(FileMenu); svn_dirs = SvnDirs(true).GetCount(); }
bool CreateLinkToExifPro(const TCHAR* exif_pro_path, const TCHAR* description, const TCHAR* link_name, int special_folder_id) { ITEMIDLIST* idl= 0; if (::SHGetSpecialFolderLocation(0, special_folder_id, &idl) == 0) { TCHAR path[2 * MAX_PATH]; ::SHGetPathFromIDList(idl, path); IMallocPtr malloc; if (::SHGetMalloc(&malloc) == 0) malloc->Free(idl); TCHAR link[2 * MAX_PATH]; AppendFileName(path, link_name, link); if (CreateLink(exif_pro_path, link, description) != S_OK) return false; TCHAR key[MAX_PATH]; wsprintf(key, L"UninstLink_%d", special_folder_id); CreateUninstallLinkInfo(link, key); return true; } return false; }
void Ide::UscProcessDirDeep(const String& dir) { UscProcessDir(dir); for(FindFile ff(AppendFileName(dir, "*")); ff; ff.Next()) if(ff.IsFolder()) UscProcessDirDeep(ff.GetPath()); }
bool CopyExifFiles(const TCHAR* dest_dir) { TCHAR dir[MAX_PATH * 2]; AppendFileName(dest_dir, _T("Templates"), dir); DWORD attribs= ::GetFileAttributes(dir); if (attribs == ~0 || (attribs & FILE_ATTRIBUTE_DIRECTORY) == 0) if (!::CreateDirectory(dir, 0)) return false; if (!CopyFileToDir(dest_dir, g_EXIF_APP, g_IsWindows64 ? IDR_EXIFPRO_x64 : IDR_EXIFPRO_x86)) return false; if (!CopyFileToDir(dest_dir, g_EXIF_SYM, g_IsWindows64 ? IDR_EXIFPRO_x64_DBG : IDR_EXIFPRO_x86_DBG)) return false; if (!CopyFileToDir(dest_dir, g_EXIF_HELP, IDR_EXIFPRO_HELP)) return false; if (!CopyFileToDir(dest_dir, g_UNINST_APP, IDR_UNINSTALL)) return false; if (!CopyFileToDir(dest_dir, g_COMM_CTL_UPD, IDR_COMM_CTL_UPD)) return false; // HTML template files if (!CopyFileToDir(dir, g_TEMPLATE_1, IDR_TEMPLATE_1)) return false; if (!CopyFileToDir(dir, g_TEMPLATE_2, IDR_TEMPLATE_2)) return false; if (!CopyFileToDir(dir, g_TEMPLATE_3, IDR_TEMPLATE_3)) return false; if (!CopyFileToDir(dir, g_TEMPLATE_4, IDR_TEMPLATE_4)) return false; if (!CopyFileToDir(dir, g_TEMPLATE_5, IDR_TEMPLATE_5)) return false; return true; }
bool IsSvnDir2(const String& p) { // this is a cope of usvn/IsSvnDir to avoid modular issues if(IsNull(p)) return false; if(DirectoryExists(AppendFileName(p, ".svn")) || DirectoryExists(AppendFileName(p, "_svn"))) return true; String path = p; String path0; while(path != path0) { path0 = path; path = GetFileFolder(path); if(DirectoryExists(AppendFileName(path, ".svn"))) return true; } return false; }
String GatherTpp::TopicFileName(const char *topic) { TopicLink tl = ParseTopicLink(topic); String file = AppendFileName(dir, AppendFileName(tl.group + ".tpp", tl.topic + ".tpp")); if (FileExists(file)) return file; for (int i = 0; i < rootFolders.GetCount(); ++i) { if (rootFolders[i] != dir) { file = AppendFileName(rootFolders[i], AppendFileName(tl.package , AppendFileName(tl.group + ".tpp", tl.topic + ".tpp"))); if (FileExists(file)) return file; } } return ""; }
void WorkspaceWork::ToggleIncludeable() { if(IsActiveFile()) { String p = GetActiveFilePath(); SetTopicGroupIncludeable(p, !FileExists(AppendFileName(p, "all.i"))); SaveLoadPackageNS(); } }