Skip to content

Commit

Permalink
Fix dev-setup target in current Wine.
Browse files Browse the repository at this point in the history
The "uninstaller" exe now prints the list to stdout, making it not
really scriptable. This can probably be worked around, but handling
it in a Windows exe should be more reliable anyway.
  • Loading branch information
Esme Povirk committed Jan 27, 2024
1 parent 053ff18 commit 1a05dc8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ help:

include llvm.make

dev-setup:
for i in `$(WINE) uninstaller --list|grep '|||Wine Mono'|sed -e 's/|||.*$$//'`; do $(WINE) uninstaller --remove "$$i"; done
dev-setup: build/removeuserinstalls-x86.exe
$(WINE) build/removeuserinstalls-x86.exe -a
$(WINE) msiexec /i '$(shell $(WINE) winepath -w $(IMAGEDIR)/support/winemono-support.msi)'
$(WINE) reg add 'HKCU\Software\Wine\Mono' /v RuntimePath /d '$(shell $(WINE) winepath -w $(IMAGEDIR))' /f

Expand Down
13 changes: 9 additions & 4 deletions tools/removeuserinstalls/removeuserinstalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <windows.h>
#include <msi.h>

void remove_user_install(const WCHAR* upgrade_code)
void remove_user_install(const WCHAR* upgrade_code, BOOL include_system)
{
WCHAR productcode[39];
MSIHANDLE hproduct;
Expand All @@ -21,7 +21,7 @@ void remove_user_install(const WCHAR* upgrade_code)
if (MsiOpenProductW(productcode, &hproduct) != ERROR_SUCCESS)
return;

if (MsiGetProductPropertyW(hproduct, L"ALLUSERS", allusers, &allusers_len) == ERROR_SUCCESS)
if (!include_system && MsiGetProductPropertyW(hproduct, L"ALLUSERS", allusers, &allusers_len) == ERROR_SUCCESS)
{
if (allusers[0])
{
Expand All @@ -38,13 +38,18 @@ void remove_user_install(const WCHAR* upgrade_code)

int wmain(int argc, wchar_t **argv)
{
BOOL include_system = FALSE;

static const WCHAR* runtime_upgrade_code = L"{DF105CC2-8FA2-4367-B1D3-95C63C0941FC}";
static const WCHAR* support_upgrade_code = L"{DE624609-C6B5-486A-9274-EF0B854F6BC5}";

if (argc >= 2 && !wcscmp(argv[1], L"-a"))
include_system = TRUE;

CoInitialize(NULL);

remove_user_install(runtime_upgrade_code);
remove_user_install(support_upgrade_code);
remove_user_install(runtime_upgrade_code, include_system);
remove_user_install(support_upgrade_code, include_system);

CoUninitialize();

Expand Down

0 comments on commit 1a05dc8

Please sign in to comment.