Commit d72e7af9 authored by Alexandre Julliard's avatar Alexandre Julliard

shell32: Specify the full application path when starting winemenubuilder.exe.

parent c4ebf368
......@@ -105,31 +105,6 @@ static const char * DumpEvent( LONG event )
#undef DUMPEV
}
static BOOL RefreshFileTypeAssociations(void)
{
static WCHAR szWinemenubuilder[] = {
'w','i','n','e','m','e','n','u','b','u','i','l','d','e','r','.','e','x','e',
' ','-','a',0 };
STARTUPINFOW si;
PROCESS_INFORMATION pi;
BOOL ret;
TRACE("starting %s\n",debugstr_w(szWinemenubuilder));
memset(&si, 0, sizeof(si));
si.cb = sizeof(si);
ret = CreateProcessW( NULL, szWinemenubuilder, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi );
if (ret)
{
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
}
return ret;
}
static const char * NodeName(const NOTIFICATIONLIST *item)
{
const char *str;
......@@ -425,10 +400,11 @@ void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID
if (wEventId & SHCNE_ASSOCCHANGED)
{
static const WCHAR args[] = {' ','-','a',0 };
TRACE("refreshing file type associations\n");
RefreshFileTypeAssociations();
run_winemenubuilder( args );
}
/* if we allocated it, free it. The ANSI flag is also set in its Unicode sibling. */
if ((typeFlag & SHCNF_PATHA) || (typeFlag & SHCNF_PRINTERA))
{
......
......@@ -197,6 +197,8 @@ BOOL UNIXFS_is_rooted_at_desktop(void);
extern const GUID CLSID_UnixFolder;
extern const GUID CLSID_UnixDosFolder;
extern BOOL run_winemenubuilder( const WCHAR *args );
/* Default shell folder value registration */
HRESULT SHELL_RegisterShellFolders(void);
......
......@@ -395,30 +395,33 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile* iface, LPCOLESTR pszFile
return r;
}
static BOOL StartLinkProcessor( LPCOLESTR szLink )
BOOL run_winemenubuilder( const WCHAR *args )
{
static const WCHAR szFormat[] = {
'w','i','n','e','m','e','n','u','b','u','i','l','d','e','r','.','e','x','e',
' ','-','w',' ','"','%','s','"',0 };
static const WCHAR menubuilder[] = {'\\','w','i','n','e','m','e','n','u','b','u','i','l','d','e','r','.','e','x','e',0};
LONG len;
LPWSTR buffer;
STARTUPINFOW si;
PROCESS_INFORMATION pi;
BOOL ret;
WCHAR app[MAX_PATH];
len = sizeof(szFormat) + lstrlenW( szLink ) * sizeof(WCHAR);
GetSystemDirectoryW( app, MAX_PATH - sizeof(menubuilder)/sizeof(WCHAR) );
strcatW( app, menubuilder );
len = (strlenW( app ) + strlenW( args ) + 1) * sizeof(WCHAR);
buffer = HeapAlloc( GetProcessHeap(), 0, len );
if( !buffer )
return FALSE;
wsprintfW( buffer, szFormat, szLink );
strcpyW( buffer, app );
strcatW( buffer, args );
TRACE("starting %s\n",debugstr_w(buffer));
memset(&si, 0, sizeof(si));
si.cb = sizeof(si);
ret = CreateProcessW( NULL, buffer, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi );
ret = CreateProcessW( app, buffer, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi );
HeapFree( GetProcessHeap(), 0, buffer );
......@@ -431,6 +434,24 @@ static BOOL StartLinkProcessor( LPCOLESTR szLink )
return ret;
}
static BOOL StartLinkProcessor( LPCOLESTR szLink )
{
static const WCHAR szFormat[] = {' ','-','w',' ','"','%','s','"',0 };
LONG len;
LPWSTR buffer;
BOOL ret;
len = sizeof(szFormat) + lstrlenW( szLink ) * sizeof(WCHAR);
buffer = HeapAlloc( GetProcessHeap(), 0, len );
if( !buffer )
return FALSE;
wsprintfW( buffer, szFormat, szLink );
ret = run_winemenubuilder( buffer );
HeapFree( GetProcessHeap(), 0, buffer );
return ret;
}
static HRESULT WINAPI IPersistFile_fnSave(IPersistFile* iface, LPCOLESTR pszFileName, BOOL fRemember)
{
IShellLinkImpl *This = impl_from_IPersistFile(iface);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment