diff --git a/installer/actions/actions.c b/installer/actions/actions.c index 9669437..56e91e6 100644 --- a/installer/actions/actions.c +++ b/installer/actions/actions.c @@ -243,9 +243,10 @@ __declspec(dllexport) UINT __stdcall EvaluateFrpServices(MSIHANDLE installer) record = MsiCreateRecord(5); if (!record) continue; + BOOL start = services[i].ServiceStatusProcess.dwWin32ExitCode == ERROR_FAIL_NOACTION_REBOOT; MsiRecordSetStringW(record, 1, identifier); MsiRecordSetStringW(record, 2, services[i].lpServiceName); - MsiRecordSetInteger(record, 3, msidbServiceControlEventStop | msidbServiceControlEventUninstallStop | (legacy == 0 ? msidbServiceControlEventDelete : 0) | msidbServiceControlEventUninstallDelete); + MsiRecordSetInteger(record, 3, (start ? msidbServiceControlEventStart : msidbServiceControlEventStop) | msidbServiceControlEventUninstallStop | (legacy == 0 ? msidbServiceControlEventDelete : 0) | msidbServiceControlEventUninstallDelete); MsiRecordSetStringW(record, 4, L"frpmgr.exe"); MsiRecordSetInteger(record, 5, 1); ret = MsiViewExecute(view, record); diff --git a/installer/build.bat b/installer/build.bat index 1fc059e..d20bcbf 100644 --- a/installer/build.bat +++ b/installer/build.bat @@ -43,8 +43,8 @@ if not defined TARGET_%ARCH% ( :build_actions %WINDRES% -DVERSION_ARRAY=%VERSION:.=,% -DVERSION_STR=%VERSION% -o %PLAT_DIR%\actions.res.obj -i actions\version.rc -O coff -c 65001 || exit /b 1 - set CFLAGS=-O3 -Wall -std=gnu11 -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -municode -DUNICODE -D_UNICODE -DNDEBUG - set LDFLAGS=-shared -s -Wl,--kill-at -Wl,--major-os-version=6 -Wl,--minor-os-version=1 -Wl,--major-subsystem-version=6 -Wl,--minor-subsystem-version=1 -Wl,--tsaware -Wl,--dynamicbase -Wl,--nxcompat -Wl,--export-all-symbols + set CFLAGS=-O3 -Wall -std=gnu11 -DWINVER=0x0602 -D_WIN32_WINNT=0x0602 -municode -DUNICODE -D_UNICODE -DNDEBUG + set LDFLAGS=-shared -s -Wl,--kill-at -Wl,--major-os-version=6 -Wl,--minor-os-version=2 -Wl,--major-subsystem-version=6 -Wl,--minor-subsystem-version=2 -Wl,--tsaware -Wl,--dynamicbase -Wl,--nxcompat -Wl,--export-all-symbols set LDLIBS=-lmsi -lole32 -lshlwapi -lshell32 -ladvapi32 %CC% %CFLAGS% %LDFLAGS% -o %PLAT_DIR%\actions.dll actions\actions.c %PLAT_DIR%\actions.res.obj %LDLIBS% || exit /b 1 goto :eof @@ -83,9 +83,9 @@ if not defined TARGET_%ARCH% ( echo ERROR: UpgradeCode was not found. exit /b 1 ) - set CFLAGS=-O3 -Wall -std=gnu11 -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -municode -DUNICODE -D_UNICODE -DNDEBUG -DUPGRADE_CODE=L\"{%UPGRADE_CODE%}\" -DVERSION=L\"%VERSION%\" - set LDFLAGS=-s -Wl,--major-os-version=6 -Wl,--minor-os-version=1 -Wl,--major-subsystem-version=6 -Wl,--minor-subsystem-version=1 -Wl,--tsaware -Wl,--dynamicbase -Wl,--nxcompat -mwindows - set LDLIBS=-lmsi -lole32 -lshlwapi -ladvapi32 -luser32 + set CFLAGS=-O3 -Wall -std=gnu11 -DWINVER=0x0602 -D_WIN32_WINNT=0x0602 -municode -DUNICODE -D_UNICODE -DNDEBUG -DUPGRADE_CODE=L\"{%UPGRADE_CODE%}\" -DVERSION=L\"%VERSION%\" + set LDFLAGS=-s -Wl,--major-os-version=6 -Wl,--minor-os-version=2 -Wl,--major-subsystem-version=6 -Wl,--minor-subsystem-version=2 -Wl,--tsaware -Wl,--dynamicbase -Wl,--nxcompat -mwindows + set LDLIBS=-lmsi -lole32 -lshlwapi -ladvapi32 -luser32 -lcomctl32 %CC% %CFLAGS% %LDFLAGS% -o %PLAT_DIR%\setup.exe setup\setup.c %PLAT_DIR%\setup.res.obj %LDLIBS% || exit /b 1 goto :eof diff --git a/installer/msi/frpmgr.wxs b/installer/msi/frpmgr.wxs index 0652029..6507686 100644 --- a/installer/msi/frpmgr.wxs +++ b/installer/msi/frpmgr.wxs @@ -42,7 +42,7 @@ Detect previous install folder if it's a upgrade --> - WIX_UPGRADE_DETECTED + PREVINSTALLFOLDER @@ -125,7 +125,7 @@ --> - NOT (UPGRADINGPRODUCTCODE AND (REMOVE="ALL")) + NOT ((UPGRADINGPRODUCTCODE OR SAVESTATE) AND (REMOVE="ALL"))