windows: Add SparkleShare folder icon. Closes #648
This commit is contained in:
parent
1e548aa964
commit
57d2c4db9f
File diff suppressed because it is too large
Load diff
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 70 KiB |
BIN
SparkleShare/Windows/Pixmaps/sparkleshare-folder.ico
Normal file
BIN
SparkleShare/Windows/Pixmaps/sparkleshare-folder.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 38 KiB |
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -290,4 +290,7 @@
|
|||
<Name>SparkleLib</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Pixmaps\sparkleshare-folder.ico" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
Loading…
Reference in a new issue