private VegasDirectoryStatus EvalScriptDir() { // check for existing directories string appExtDir = Path.Combine(cbAppSrc.Text, Str.AppExtDirName); if (!Directory.Exists(appExtDir)) { return(VegasDirectoryStatus.None); } if (JunctionPoint.Exists(Path.Combine(appExtDir, Str.AppJunctionDirName))) { return(VegasDirectoryStatus.DirectoryExists | VegasDirectoryStatus.JunctionExists); } return(VegasDirectoryStatus.DirectoryExists); }
private void btnJunction_Click(object sender, EventArgs e) { string selectedDir; using (var dlg = new FolderBrowserDialog { SelectedPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) }) { if (dlg.ShowDialog() != DialogResult.OK) { return; } selectedDir = dlg.SelectedPath; } // appext string vegasDir = cbAppSrc.Text; string appTarget = Path.Combine(selectedDir, Str.AppExtDirName); string appextDir = Path.Combine(vegasDir, Str.AppExtDirName); //appextDir = Path.Combine(appextDir, Str.AppJunctionDirName); string scrTarget = Path.Combine(selectedDir, Str.ScrMenuDirName); string scrDir = Path.Combine(vegasDir, Str.ScrMenuDirName); scrDir = Path.Combine(scrDir, Str.AppJunctionDirName); try { if (!Directory.Exists(appextDir) && !JunctionPoint.Exists(appextDir)) { CreateJunction(appextDir, appTarget); } if (!Directory.Exists(scrDir) && !JunctionPoint.Exists(scrDir)) { CreateJunction(scrDir, scrTarget); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }