Skip to content

Commit

Permalink
Merge branch 'release/1.0.0.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
amitailanciano committed Jan 14, 2015
2 parents 7d627f3 + 8d6a7dc commit 9a8acc3
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 66 deletions.
14 changes: 6 additions & 8 deletions Lanayo.VagrantManager/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ public void Run() {

this.RefreshTimerState();

using (new SingleGlobalInstance(1000)) {
Application.Run();
}
Application.Run();
}

void Application_ApplicationExit(object sender, EventArgs e) {
Expand Down Expand Up @@ -122,15 +120,15 @@ private void ShowUpdateNotificationPreferenceChanged(Notification notification)

public void PerformVagrantAction(string action, VagrantInstance instance) {
if (action == "ssh") {
action = String.Format("cd {0} && vagrant ssh", Util.EscapeShellArg(instance.Path));
action = String.Format("cd /d {0} && vagrant ssh", Util.EscapeShellArg(instance.Path));
this.RunTerminalCommand(action);
} else {
this.RunVagrantAction(action, instance);
}
}
public void PerformVagrantAction(string action, VagrantMachine machine) {
if (action == "ssh") {
action = String.Format("cd {0} && vagrant ssh {1}", Util.EscapeShellArg(machine.Instance.Path), machine.Name);
action = String.Format("cd /d {0} && vagrant ssh {1}", Util.EscapeShellArg(machine.Instance.Path), machine.Name);
this.RunTerminalCommand(action);
} else {
this.RunVagrantAction(action, machine);
Expand All @@ -147,7 +145,7 @@ public void OpenInstanceInTerminal(VagrantInstance instance) {
if (Directory.Exists(instance.Path)) {
Process p = new Process();
p.StartInfo.FileName = "cmd";
p.StartInfo.Arguments = String.Format("/K cd {0}", instance.Path);
p.StartInfo.Arguments = String.Format("/K cd /d {0}", instance.Path);
p.Start();
} else {
MessageBox.Show("Path not found: " + instance.Path);
Expand Down Expand Up @@ -244,7 +242,7 @@ private void RunVagrantAction(string action, VagrantMachine machine) {
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.Arguments = String.Format("/C cd {0} && {1} {2}", Util.EscapeShellArg(machine.Instance.Path), command, Util.EscapeShellArg(machine.Name));
process.StartInfo.Arguments = String.Format("/C cd /d {0} && {1} {2}", Util.EscapeShellArg(machine.Instance.Path), command, Util.EscapeShellArg(machine.Name));

TaskOutputWindow outputWindow = new TaskOutputWindow();
outputWindow.Task = process;
Expand Down Expand Up @@ -282,7 +280,7 @@ private void RunVagrantAction(string action, VagrantInstance instance) {
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.Arguments = String.Format("/C cd {0} && {1}", Util.EscapeShellArg(instance.Path), command);
process.StartInfo.Arguments = String.Format("/C cd /d {0} && {1}", Util.EscapeShellArg(instance.Path), command);

TaskOutputWindow outputWindow = new TaskOutputWindow();
outputWindow.Task = process;
Expand Down
2 changes: 1 addition & 1 deletion Lanayo.VagrantManager/Core/Vagrant/VagrantInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void QueryMachines() {
FileName = "cmd",
WindowStyle = ProcessWindowStyle.Hidden,
CreateNoWindow = true,
Arguments = String.Format("/C cd {0} && vagrant status", Util.EscapeShellArg(_Path)),
Arguments = String.Format("/C cd /d {0} && vagrant status", Util.EscapeShellArg(_Path)),
UseShellExecute = false,
RedirectStandardOutput = true,
}
Expand Down
3 changes: 1 addition & 2 deletions Lanayo.VagrantManager/Lanayo.Vagrant_Manager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>2</ApplicationRevision>
<ApplicationRevision>3</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
Expand Down Expand Up @@ -89,7 +89,6 @@
<Compile Include="NotificationCenter.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SingleGlobalInstance.cs" />
<Compile Include="Util.cs" />
<Compile Include="Windows\AboutWindow.cs">
<SubType>Form</SubType>
Expand Down
13 changes: 13 additions & 0 deletions Lanayo.VagrantManager/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

Expand All @@ -13,8 +15,19 @@ static class Program {
/// </summary>
[STAThread]
static void Main() {
bool OK;
string appGuid = ((GuidAttribute)Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(GuidAttribute), false).GetValue(0)).Value.ToString();
Mutex mutex = new System.Threading.Mutex(true, appGuid, out OK);

if (!OK) {
MessageBox.Show("Another instance of Vagrant Manager is already running");
return;
}

App app = App.Instance;
app.Run();

GC.KeepAlive(mutex);
}
}
}
4 changes: 2 additions & 2 deletions Lanayo.VagrantManager/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.2")]
[assembly: AssemblyFileVersion("1.0.0.2")]
[assembly: AssemblyVersion("1.0.0.3")]
[assembly: AssemblyFileVersion("1.0.0.3")]
53 changes: 0 additions & 53 deletions Lanayo.VagrantManager/SingleGlobalInstance.cs

This file was deleted.

0 comments on commit 9a8acc3

Please sign in to comment.