windows: Fix build. Closes #894
This commit is contained in:
parent
a6348fa726
commit
e7e3b8603f
|
@ -45,14 +45,9 @@
|
||||||
<Link>SparkleRepoGit.cs</Link>
|
<Link>SparkleRepoGit.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\SparkleLib.csproj">
|
|
||||||
<Project>{2C914413-B31C-4362-93C7-1AE34F09112A}</Project>
|
|
||||||
<Name>SparkleLib</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="Properties\" />
|
<Folder Include="Properties\" />
|
||||||
|
@ -65,4 +60,10 @@
|
||||||
<Target Name="AfterBuild">
|
<Target Name="AfterBuild">
|
||||||
</Target>
|
</Target>
|
||||||
-->
|
-->
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\SparkleLib.csproj">
|
||||||
|
<Project>{2C914413-B31C-4362-93C7-1AE34F09112A}</Project>
|
||||||
|
<Name>SparkleLib</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Security.Principal;
|
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
|
||||||
namespace SparkleLib {
|
namespace SparkleLib {
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
<RootNamespace>SparkleLib</RootNamespace>
|
<RootNamespace>SparkleLib</RootNamespace>
|
||||||
<AssemblyName>SparkleLib</AssemblyName>
|
<AssemblyName>SparkleLib</AssemblyName>
|
||||||
<ReleaseVersion />
|
<ReleaseVersion />
|
||||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
|
|
@ -128,28 +128,38 @@ namespace SparkleShare {
|
||||||
|
|
||||||
public override bool CreateSparkleShareFolder ()
|
public override bool CreateSparkleShareFolder ()
|
||||||
{
|
{
|
||||||
if (!Directory.Exists (FoldersPath)) {
|
if (Directory.Exists (FoldersPath))
|
||||||
|
return false;
|
||||||
|
|
||||||
Directory.CreateDirectory (FoldersPath);
|
Directory.CreateDirectory (FoldersPath);
|
||||||
File.SetAttributes (FoldersPath, File.GetAttributes (FoldersPath) | FileAttributes.System);
|
File.SetAttributes (FoldersPath, File.GetAttributes (FoldersPath) | FileAttributes.System);
|
||||||
|
|
||||||
return true;
|
SparkleLogger.LogInfo ("Config", "Created '" + FoldersPath + "'");
|
||||||
|
|
||||||
} else if (!File.Exists (icon_file_path)) {
|
string app_path = Path.GetDirectoryName (Forms.Application.ExecutablePath);
|
||||||
string ini_file_path = Path.Combine (FoldersPath, "desktop.ini");
|
|
||||||
string app_path = Path.GetDirectoryName (Application.ExecutablePath);
|
|
||||||
string icon_file_path = Path.Combine (app_path, "Pixmaps", "sparkleshare-folder.ico");
|
string icon_file_path = Path.Combine (app_path, "Pixmaps", "sparkleshare-folder.ico");
|
||||||
|
|
||||||
string ini_file "[.ShellClassInfo]" +
|
if (!File.Exists (icon_file_path)) {
|
||||||
|
string ini_file_path = Path.Combine (FoldersPath, "desktop.ini");
|
||||||
|
|
||||||
|
string ini_file = "[.ShellClassInfo]" +
|
||||||
"IconFile=" + icon_file_path +
|
"IconFile=" + icon_file_path +
|
||||||
"IconIndex=0" +
|
"IconIndex=0" +
|
||||||
"InfoTip=SparkleShare";
|
"InfoTip=SparkleShare";
|
||||||
|
|
||||||
|
try {
|
||||||
|
File.Create (ini_file_path).Close ();
|
||||||
File.WriteAllText (ini_file_path, ini_file);
|
File.WriteAllText (ini_file_path, ini_file);
|
||||||
|
|
||||||
File.SetAttributes (ini_file_path,
|
File.SetAttributes (ini_file_path,
|
||||||
File.GetAttributes (ini_file_path) | FileAttributes.Hidden | FileAttributes.System);
|
File.GetAttributes (ini_file_path) | FileAttributes.Hidden | FileAttributes.System);
|
||||||
|
|
||||||
SparkleHelpers.DebugInfo ("Config", "Created '" + FoldersPath + "'");
|
} catch (IOException e) {
|
||||||
|
SparkleLogger.LogInfo ("Config",
|
||||||
|
"Failed setting icon for '" + FoldersPath + "': " + e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -184,7 +194,7 @@ namespace SparkleShare {
|
||||||
string auth_sock = Environment.GetEnvironmentVariable ("SSH_AUTH_SOCK");
|
string auth_sock = Environment.GetEnvironmentVariable ("SSH_AUTH_SOCK");
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty (auth_sock)) {
|
if (!string.IsNullOrEmpty (auth_sock)) {
|
||||||
SparkleHelpers.DebugInfo ("Controller", "Using existing ssh-agent with PID=" + this.ssh_agent_pid);
|
SparkleLogger.LogInfo ("Controller", "Using existing ssh-agent with PID=" + this.ssh_agent_pid);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,10 +221,10 @@ namespace SparkleShare {
|
||||||
Int32.TryParse (ssh_pid, out this.ssh_agent_pid);
|
Int32.TryParse (ssh_pid, out this.ssh_agent_pid);
|
||||||
Environment.SetEnvironmentVariable ("SSH_AGENT_PID", ssh_pid);
|
Environment.SetEnvironmentVariable ("SSH_AGENT_PID", ssh_pid);
|
||||||
|
|
||||||
SparkleHelpers.DebugInfo ("Controller", "ssh-agent started, PID=" + ssh_pid);
|
SparkleLogger.LogInfo ("Controller", "ssh-agent started, PID=" + ssh_pid);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
SparkleHelpers.DebugInfo ("Controller", "ssh-agent started, PID=Unknown");
|
SparkleLogger.LogInfo ("Controller", "ssh-agent started, PID=Unknown");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,7 +238,7 @@ namespace SparkleShare {
|
||||||
Process.GetProcessById (this.ssh_agent_pid).Kill ();
|
Process.GetProcessById (this.ssh_agent_pid).Kill ();
|
||||||
|
|
||||||
} catch (ArgumentException e) {
|
} catch (ArgumentException e) {
|
||||||
SparkleHelpers.DebugInfo ("SSH", "Could not stop ssh-agent: " + e.Message);
|
SparkleLogger.LogInfo ("SSH", "Could not stop ssh-agent: " + e.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,12 +73,14 @@ namespace SparkleShare {
|
||||||
FontWeight = FontWeights.Bold
|
FontWeight = FontWeights.Bold
|
||||||
};
|
};
|
||||||
|
|
||||||
|
string name = System.Security.Principal.WindowsIdentity.GetCurrent ().Name;
|
||||||
|
name = name.Split ("\\".ToCharArray ()) [1];
|
||||||
|
|
||||||
TextBox name_box = new TextBox () {
|
TextBox name_box = new TextBox () {
|
||||||
Text = Controller.GuessedUserName,
|
Text = name,
|
||||||
Width = 175
|
Width = 175
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
TextBlock email_label = new TextBlock () {
|
TextBlock email_label = new TextBlock () {
|
||||||
Text = "Email:",
|
Text = "Email:",
|
||||||
Width = 150,
|
Width = 150,
|
||||||
|
@ -87,12 +89,10 @@ namespace SparkleShare {
|
||||||
};
|
};
|
||||||
|
|
||||||
TextBox email_box = new TextBox () {
|
TextBox email_box = new TextBox () {
|
||||||
Width = 175,
|
Width = 175
|
||||||
Text = Controller.GuessedUserEmail
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Button cancel_button = new Button () {
|
Button cancel_button = new Button () {
|
||||||
Content = "Cancel"
|
Content = "Cancel"
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue