windows: Add SparkleShare folder icon. Closes #648

This commit is contained in:
Hylke Bons 2012-07-30 11:11:39 +02:00
parent 1e548aa964
commit 57d2c4db9f
4 changed files with 1162 additions and 536 deletions

File diff suppressed because it is too large Load diff

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View file

@ -130,16 +130,29 @@ namespace SparkleShare {
{
if (!Directory.Exists (FoldersPath)) {
Directory.CreateDirectory (FoldersPath);
SparkleHelpers.DebugInfo ("Config", "Created '" + FoldersPath + "'");
// TODO: Set a custom SparkleShare folder icon
File.SetAttributes (FoldersPath, File.GetAttributes (FoldersPath) | FileAttributes.System);
return true;
} else {
return false;
} else if (!File.Exists (icon_file_path)) {
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 ini_file "[.ShellClassInfo]" +
"IconFile=" + icon_file_path +
"IconIndex=0" +
"InfoTip=SparkleShare";
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 + "'");
}
return false;
}

View file

@ -290,4 +290,7 @@
<Name>SparkleLib</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Pixmaps\sparkleshare-folder.ico" />
</ItemGroup>
</Project>