mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-13 07:53:23 -05:00
Embed manifest in FireflyShell to avoid compatibility dingus on vista, switch execute method in starting and stopping services from CreateProcess to ShellExecute to allow the annoying f-ing UAC permissings thing to pop up.
This commit is contained in:
parent
4547e93785
commit
bb7cc3fdf9
@ -5,4 +5,11 @@
|
|||||||
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>
|
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<security>
|
||||||
|
<requestedPrivileges>
|
||||||
|
<requestedExecutionLevel level="asInvoker" />
|
||||||
|
</requestedPrivileges>
|
||||||
|
</security>
|
||||||
|
</trustInfo>
|
||||||
</assembly>
|
</assembly>
|
@ -321,6 +321,10 @@
|
|||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<File
|
||||||
|
RelativePath=".\FireflyShell.exe.manifest"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\README.txt"
|
RelativePath=".\README.txt"
|
||||||
>
|
>
|
||||||
|
@ -19,35 +19,37 @@
|
|||||||
#include "DosPath.h"
|
#include "DosPath.h"
|
||||||
|
|
||||||
bool Service::ExecHelper(const TCHAR *szAction) {
|
bool Service::ExecHelper(const TCHAR *szAction) {
|
||||||
PROCESS_INFORMATION pi;
|
SHELLEXECUTEINFO si;
|
||||||
STARTUPINFO si;
|
|
||||||
CString commandline;
|
|
||||||
CDosPath path = CDosPath::AppPath();
|
|
||||||
CDosPath filename(_T("svcctrl.exe"));
|
|
||||||
DWORD dwResult;
|
|
||||||
LPTSTR cmd;
|
|
||||||
|
|
||||||
filename |= path;
|
|
||||||
commandline.Format(_T("%s %s \"%s\""),filename.GetPath(),szAction,m_name);
|
|
||||||
cmd = commandline.GetBuffer(commandline.GetLength() + 1);
|
|
||||||
ZeroMemory(&si,sizeof(si));
|
ZeroMemory(&si,sizeof(si));
|
||||||
si.cb = sizeof(si);
|
|
||||||
|
|
||||||
ZeroMemory(&pi,sizeof(pi));
|
si.cbSize = sizeof(si);
|
||||||
|
si.fMask = SEE_MASK_FLAG_NO_UI | SEE_MASK_NOCLOSEPROCESS;
|
||||||
|
si.hwnd = NULL;
|
||||||
|
si.lpVerb = _T("open");
|
||||||
|
|
||||||
BOOL bStarted = CreateProcess(NULL,cmd,NULL,NULL,
|
CDosPath path = CDosPath::AppPath();
|
||||||
FALSE,0,NULL,NULL,&si,&pi);
|
CString strPath = path.GetPathOnly();
|
||||||
|
si.lpDirectory = static_cast<LPCTSTR>(strPath);
|
||||||
|
|
||||||
commandline.ReleaseBuffer();
|
CDosPath filename = CDosPath(_T("svcctrl.exe"));
|
||||||
|
filename |= path;
|
||||||
|
CString strFilename = filename.GetPath();
|
||||||
|
|
||||||
if(!bStarted)
|
si.lpFile = static_cast<LPCTSTR>(strFilename);
|
||||||
|
|
||||||
|
CString strParams;
|
||||||
|
strParams.Format(_T("%s \"%s\""),szAction,m_name);
|
||||||
|
si.lpParameters = static_cast<LPCTSTR>(strParams);
|
||||||
|
|
||||||
|
si.nShow = 0;
|
||||||
|
|
||||||
|
if(!ShellExecuteEx(&si))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
WaitForSingleObject(si.hProcess, INFINITE);
|
||||||
|
|
||||||
GetExitCodeProcess(pi.hProcess,&dwResult);
|
DWORD dwResult;
|
||||||
CloseHandle(pi.hProcess);
|
GetExitCodeProcess(si.hProcess,&dwResult);
|
||||||
CloseHandle(pi.hThread);
|
|
||||||
|
|
||||||
if(dwResult)
|
if(dwResult)
|
||||||
return false;
|
return false;
|
||||||
|
@ -170,7 +170,6 @@ NoProgramItems:
|
|||||||
File "${CONFIG_SOURCE}\FireflyShell-1d.dll"
|
File "${CONFIG_SOURCE}\FireflyShell-1d.dll"
|
||||||
File "${CONFIG_SOURCE}\FireflyShell-11.dll"
|
File "${CONFIG_SOURCE}\FireflyShell-11.dll"
|
||||||
File "${CONFIG_SOURCE}\FireflyShell-10.dll"
|
File "${CONFIG_SOURCE}\FireflyShell-10.dll"
|
||||||
File "${CONFIG_SOURCE}\..\FireflyShell.exe.manifest"
|
|
||||||
File "${CONFIG_SOURCE}\svcctrl.exe"
|
File "${CONFIG_SOURCE}\svcctrl.exe"
|
||||||
File "${DLL_SOURCE}\gnu_regex.dll"
|
File "${DLL_SOURCE}\gnu_regex.dll"
|
||||||
File "${DLL_SOURCE}\pthreadVC2.dll"
|
File "${DLL_SOURCE}\pthreadVC2.dll"
|
||||||
|
Loading…
Reference in New Issue
Block a user