summaryrefslogtreecommitdiff
path: root/src/helper.h
diff options
context:
space:
mode:
authorLostDragonist <lost.dragonist@gmail.com>2018-12-25 03:51:32 -0600
committerLostDragonist <lost.dragonist@gmail.com>2018-12-25 03:51:32 -0600
commit85eb57eebb21e49d430fd8327b1074dcea2405be (patch)
tree8a75bc4853b693627282603066accfe171464192 /src/helper.h
parent22f40072cf7782e6f3484a58347381310b40c6cc (diff)
Relaunch MO as admin when elevation is required
Previously, a new process of MO would be created as administrator when elevation was required. This had some unwanted side effects. The GUI lock would not function. The virtual file system would likely break as the non-admin process could not access data from the new admin instance.
Diffstat (limited to 'src/helper.h')
-rw-r--r--src/helper.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/helper.h b/src/helper.h
index cd4b7883..f6667a84 100644
--- a/src/helper.h
+++ b/src/helper.h
@@ -26,7 +26,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
/**
* @brief Convenience functions to work with the external helper program.
- *
+ *
* The mo_helper program is used to make changes on the system that require administrative
* rights, so that ModOrganizer itself can run without special privileges
**/
@@ -34,7 +34,7 @@ namespace Helper {
/**
* @brief initialise the specified directory for use with mod organizer.
- *
+ *
* This will create all required sub-directories and give the user running ModOrganizer
* write-access
*
@@ -50,6 +50,14 @@ bool init(const std::wstring &moPath, const std::wstring &dataPath);
**/
bool backdateBSAs(const std::wstring &moPath, const std::wstring &dataPath);
+/**
+ * @brief waits for the current process to exit and restarts it as an administrator
+ * @param moPath absolute path to the modOrganizer base directory
+ * @param moFile file name of modOrganizer
+ * @param workingDir current working directory
+ **/
+bool adminLaunch(const std::wstring &moPath, const std::wstring &moFile, const std::wstring &workingDir);
+
}