-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLoadSaveBase.cpp
More file actions
62 lines (51 loc) · 1.44 KB
/
LoadSaveBase.cpp
File metadata and controls
62 lines (51 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/////////////////////////////////////////////////////////////////////////////
// Name: LoadSaveBase.cpp
// Purpose:
// Author: Richard W. Allen
// Modified by:
// Created: 11/04/2017 17:45:05
// RCS-ID:
// Copyright: Richard W. Allen 2017
// Licence: GPL 2
/////////////////////////////////////////////////////////////////////////////
#include "LoadSaveBase.hpp"
#include "win10tweakapp.hpp"
LoadSaveBase::LoadSaveBase()
: m_settings(wxGetApp().GetSettings())
{
}
LoadSaveBase::~LoadSaveBase()
{
}
//////////////////////////////////////////////////////////////////////////
// Protected
//////////////////////////////////////////////////////////////////////////
bool LoadSaveBase::Execute( wxString exe )
{
wxArrayString output;
return Execute(exe, output);
}
bool LoadSaveBase::Execute( wxString exe, wxArrayString& output )
{
bool rtn = true;
wxArrayString errors;
wxExecute(exe, output, errors);
if (errors.GetCount() > 0)
{
rtn = false;
wxMessageOutputDebug().Printf(exe);
for (unsigned int count = 0; count < errors.GetCount(); count++)
wxMessageOutputDebug().Printf(errors.Item(count));
}
return rtn;
}
void LoadSaveBase::RemoveDir( wxString dir )
{
if (wxFileExists(dir))
wxRemoveFile(dir);
}
bool LoadSaveBase::PowerShell(wxString ps)
{
wxString exe = "powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden -Command \'" + ps + "\'";
return Execute(exe);
}