From fe9a768f29e5a9837b7be5976e74a46fed2f3a42 Mon Sep 17 00:00:00 2001 From: Rohan Garg Date: Tue, 4 Nov 2014 17:57:44 +0100 Subject: [PATCH] Use pkexec to execute calamares with the right permissions --- CMakeLists.txt | 8 ++++++++ calamares.desktop | 3 ++- com.github.calamares.calamares.bin | 22 ++++++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 com.github.calamares.calamares.bin diff --git a/CMakeLists.txt b/CMakeLists.txt index 51a813bde..b2f77dc6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,7 @@ set( QT_VERSION 5.3.0 ) find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Core Gui Widgets LinguistTools Svg ) find_package( YamlCpp 0.5.1 REQUIRED ) +find_package( PolkitQt5-1 REQUIRED ) option( WITH_PYTHON "Enable Python modules support." ON ) @@ -178,3 +179,10 @@ install( DESTINATION share/calamares ) + +install( + FILES + com.github.calamares.calamares.bin + DESTINATION + "${POLKITQT-1_POLICY_FILES_INSTALL_DIR}" +) diff --git a/calamares.desktop b/calamares.desktop index 06df67598..776d26359 100644 --- a/calamares.desktop +++ b/calamares.desktop @@ -4,8 +4,9 @@ Version=1.0 Name=Calamares GenericName=System Installer TryExec=calamares -Exec=calamares +Exec=pkexec /usr/bin/calamares Comment=Calamares — System Installer Icon=calamares Terminal=false +StartupNotify=false Categories=Qt;System; diff --git a/com.github.calamares.calamares.bin b/com.github.calamares.calamares.bin new file mode 100644 index 000000000..6bc250e3b --- /dev/null +++ b/com.github.calamares.calamares.bin @@ -0,0 +1,22 @@ + + + + + Calamares + https://github.com/calamares + + + Run Installer + Authentication is required to run the installation program + drive-harddisk + + no + no + auth_admin + + /usr/bin/calamares + true + + \ No newline at end of file