The problem being solved is that the first-time initialization of Wine displays a dialog saying it is Wine. If a custom packaged application uses its own prefix directory and wants to appear native, that dialog can appear surprising.
When the environment variable `WINEBOOTRESOURCEMODULE` is set, use it to load the dialog and icon on the first application run. If that module does not exist or does not supply the appropriate resources, fall back to the default ones.
From: Dan Mondrik dan.mondrik@ni.com
--- programs/wineboot/wineboot.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c index 4de20705224..a8ff140aa56 100644 --- a/programs/wineboot/wineboot.c +++ b/programs/wineboot/wineboot.c @@ -1307,7 +1307,16 @@ static INT_PTR CALLBACK wait_dlgproc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp DWORD len; WCHAR *buffer, text[1024]; const WCHAR *name = (WCHAR *)lp; - HICON icon = LoadImageW( 0, (LPCWSTR)IDI_WINLOGO, IMAGE_ICON, 48, 48, LR_SHARED ); + HICON icon = 0; + const WCHAR *overrideModule = _wgetenv(L"WINEBOOTRESOURCEMODULE"); + if (overrideModule) + { + icon = LoadImageW( LoadLibraryW(overrideModule), (LPCWSTR)IDI_WINLOGO, IMAGE_ICON, 48, 48, LR_SHARED ); + } + if (!icon) + { + icon = LoadImageW( 0, (LPCWSTR)IDI_WINLOGO, IMAGE_ICON, 48, 48, LR_SHARED ); + } SendDlgItemMessageW( hwnd, IDC_WAITICON, STM_SETICON, (WPARAM)icon, 0 ); SendDlgItemMessageW( hwnd, IDC_WAITTEXT, WM_GETTEXT, 1024, (LPARAM)text ); len = lstrlenW(text) + lstrlenW(name) + 1; @@ -1323,8 +1332,18 @@ static INT_PTR CALLBACK wait_dlgproc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp
static HWND show_wait_window(void) { - HWND hwnd = CreateDialogParamW( GetModuleHandleW(0), MAKEINTRESOURCEW(IDD_WAITDLG), 0, - wait_dlgproc, (LPARAM)prettyprint_configdir() ); + HWND hwnd = 0; + const WCHAR *overrideModule = _wgetenv(L"WINEBOOTRESOURCEMODULE"); + if (overrideModule) + { + hwnd = CreateDialogParamW( LoadLibraryW(overrideModule), MAKEINTRESOURCEW(IDD_WAITDLG), 0, + wait_dlgproc, (LPARAM)prettyprint_configdir() ); + } + if (!hwnd) + { + hwnd = CreateDialogParamW( GetModuleHandleW(0), MAKEINTRESOURCEW(IDD_WAITDLG), 0, + wait_dlgproc, (LPARAM)prettyprint_configdir() ); + } ShowWindow( hwnd, SW_SHOWNORMAL ); return hwnd; }
@julliard I see you are the one who has accepted `wineboot` merges in mainline before. Am I as a submitter expected to do anything other than post here and wait? Thanks.