[linux] Set .desktop permissions using Mono.Unix
This commit is contained in:
parent
fd90f69da2
commit
29e797a9ba
|
@ -15,7 +15,6 @@
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
using Mono.Unix;
|
using Mono.Unix;
|
||||||
using Mono.Unix.Native;
|
|
||||||
using SparkleLib;
|
using SparkleLib;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
@ -60,7 +59,8 @@ namespace SparkleShare {
|
||||||
writer.Close ();
|
writer.Close ();
|
||||||
|
|
||||||
// Give the launcher the right permissions so it can be launched by the user
|
// Give the launcher the right permissions so it can be launched by the user
|
||||||
Syscall.chmod (desktopfile_path, FilePermissions.S_IRWXU);
|
UnixFileInfo file_info = new UnixFileInfo (desktopfile_path);
|
||||||
|
file_info.Create (FileAccessPermissions.UserReadWriteExecute);
|
||||||
|
|
||||||
SparkleHelpers.DebugInfo ("Controller", "Created: " + desktopfile_path);
|
SparkleHelpers.DebugInfo ("Controller", "Created: " + desktopfile_path);
|
||||||
|
|
||||||
|
@ -80,7 +80,6 @@ namespace SparkleShare {
|
||||||
if (!File.Exists (desktopfile_path)) {
|
if (!File.Exists (desktopfile_path)) {
|
||||||
|
|
||||||
if (!Directory.Exists (apps_path))
|
if (!Directory.Exists (apps_path))
|
||||||
|
|
||||||
Directory.CreateDirectory (apps_path);
|
Directory.CreateDirectory (apps_path);
|
||||||
|
|
||||||
TextWriter writer = new StreamWriter (desktopfile_path);
|
TextWriter writer = new StreamWriter (desktopfile_path);
|
||||||
|
@ -95,7 +94,8 @@ namespace SparkleShare {
|
||||||
writer.Close ();
|
writer.Close ();
|
||||||
|
|
||||||
// Give the launcher the right permissions so it can be launched by the user
|
// Give the launcher the right permissions so it can be launched by the user
|
||||||
Syscall.chmod (desktopfile_path, FilePermissions.S_IRWXU);
|
UnixFileInfo file_info = new UnixFileInfo (desktopfile_path);
|
||||||
|
file_info.Create (FileAccessPermissions.UserReadWriteExecute);
|
||||||
|
|
||||||
SparkleHelpers.DebugInfo ("Controller", "Created '" + desktopfile_path + "'");
|
SparkleHelpers.DebugInfo ("Controller", "Created '" + desktopfile_path + "'");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue