windows: Fix build. Closes #894
This commit is contained in:
parent
a6348fa726
commit
e7e3b8603f
|
@ -45,14 +45,9 @@
|
|||
<Link>SparkleRepoGit.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SparkleLib.csproj">
|
||||
<Project>{2C914413-B31C-4362-93C7-1AE34F09112A}</Project>
|
||||
<Name>SparkleLib</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Properties\" />
|
||||
|
@ -65,4 +60,10 @@
|
|||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SparkleLib.csproj">
|
||||
<Project>{2C914413-B31C-4362-93C7-1AE34F09112A}</Project>
|
||||
<Name>SparkleLib</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Principal;
|
||||
using System.Xml;
|
||||
|
||||
namespace SparkleLib {
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
<RootNamespace>SparkleLib</RootNamespace>
|
||||
<AssemblyName>SparkleLib</AssemblyName>
|
||||
<ReleaseVersion />
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
|
|
@ -128,28 +128,38 @@ namespace SparkleShare {
|
|||
|
||||
public override bool CreateSparkleShareFolder ()
|
||||
{
|
||||
if (!Directory.Exists (FoldersPath)) {
|
||||
if (Directory.Exists (FoldersPath))
|
||||
return false;
|
||||
|
||||
Directory.CreateDirectory (FoldersPath);
|
||||
File.SetAttributes (FoldersPath, File.GetAttributes (FoldersPath) | FileAttributes.System);
|
||||
|
||||
return true;
|
||||
SparkleLogger.LogInfo ("Config", "Created '" + FoldersPath + "'");
|
||||
|
||||
} else if (!File.Exists (icon_file_path)) {
|
||||
string ini_file_path = Path.Combine (FoldersPath, "desktop.ini");
|
||||
string app_path = Path.GetDirectoryName (Application.ExecutablePath);
|
||||
string app_path = Path.GetDirectoryName (Forms.Application.ExecutablePath);
|
||||
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 +
|
||||
"IconIndex=0" +
|
||||
"InfoTip=SparkleShare";
|
||||
|
||||
try {
|
||||
File.Create (ini_file_path).Close ();
|
||||
File.WriteAllText (ini_file_path, ini_file);
|
||||
|
||||
File.SetAttributes (ini_file_path,
|
||||
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;
|
||||
|
@ -184,7 +194,7 @@ namespace SparkleShare {
|
|||
string auth_sock = Environment.GetEnvironmentVariable ("SSH_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;
|
||||
}
|
||||
|
||||
|
@ -211,10 +221,10 @@ namespace SparkleShare {
|
|||
Int32.TryParse (ssh_pid, out this.ssh_agent_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 {
|
||||
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 ();
|
||||
|
||||
} 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
|
||||
};
|
||||
|
||||
string name = System.Security.Principal.WindowsIdentity.GetCurrent ().Name;
|
||||
name = name.Split ("\\".ToCharArray ()) [1];
|
||||
|
||||
TextBox name_box = new TextBox () {
|
||||
Text = Controller.GuessedUserName,
|
||||
Text = name,
|
||||
Width = 175
|
||||
};
|
||||
|
||||
|
||||
TextBlock email_label = new TextBlock () {
|
||||
Text = "Email:",
|
||||
Width = 150,
|
||||
|
@ -87,12 +89,10 @@ namespace SparkleShare {
|
|||
};
|
||||
|
||||
TextBox email_box = new TextBox () {
|
||||
Width = 175,
|
||||
Text = Controller.GuessedUserEmail
|
||||
Width = 175
|
||||
};
|
||||
|
||||
|
||||
|
||||
Button cancel_button = new Button () {
|
||||
Content = "Cancel"
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue