From 58950f03704eda3a226f3d953c48698038bfa986 Mon Sep 17 00:00:00 2001 From: Fredrik Orderud Date: Tue, 29 Aug 2023 22:22:57 +0200 Subject: [PATCH 1/4] Start on MSI sample projects for testing reboot handling. Doc: https://learn.microsoft.com/en-us/windows/win32/msi/error-codes --- MsiQuery.sln | 8 +++++- ScheduleReboot/.gitignore | 2 ++ ScheduleReboot/Product.wxs | 28 ++++++++++++++++++++ ScheduleReboot/ScheduleReboot.wixproj | 37 +++++++++++++++++++++++++++ 4 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 ScheduleReboot/.gitignore create mode 100644 ScheduleReboot/Product.wxs create mode 100644 ScheduleReboot/ScheduleReboot.wixproj diff --git a/MsiQuery.sln b/MsiQuery.sln index 8f0d4cf..3133abe 100644 --- a/MsiQuery.sln +++ b/MsiQuery.sln @@ -5,7 +5,9 @@ VisualStudioVersion = 17.4.33927.135 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MsiQuery", "MsiQuery\MsiQuery.vcxproj", "{0C6B0F58-DAAE-4E82-9F1B-B1C6F9ECD490}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MsixQuery", "MsixQuery\MsixQuery.csproj", "{79881CF3-6FE8-48CE-8346-AFA275322030}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MsixQuery", "MsixQuery\MsixQuery.csproj", "{79881CF3-6FE8-48CE-8346-AFA275322030}" +EndProject +Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "ScheduleReboot", "ScheduleReboot\ScheduleReboot.wixproj", "{311008EE-B26A-4D88-8249-94103288D156}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -21,6 +23,10 @@ Global {79881CF3-6FE8-48CE-8346-AFA275322030}.Debug|x64.Build.0 = Debug|Any CPU {79881CF3-6FE8-48CE-8346-AFA275322030}.Release|x64.ActiveCfg = Release|Any CPU {79881CF3-6FE8-48CE-8346-AFA275322030}.Release|x64.Build.0 = Release|Any CPU + {311008EE-B26A-4D88-8249-94103288D156}.Debug|x64.ActiveCfg = Debug|x64 + {311008EE-B26A-4D88-8249-94103288D156}.Debug|x64.Build.0 = Debug|x64 + {311008EE-B26A-4D88-8249-94103288D156}.Release|x64.ActiveCfg = Release|x64 + {311008EE-B26A-4D88-8249-94103288D156}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/ScheduleReboot/.gitignore b/ScheduleReboot/.gitignore new file mode 100644 index 0000000..fba4e61 --- /dev/null +++ b/ScheduleReboot/.gitignore @@ -0,0 +1,2 @@ +/obj +/bin diff --git a/ScheduleReboot/Product.wxs b/ScheduleReboot/Product.wxs new file mode 100644 index 0000000..1842ca7 --- /dev/null +++ b/ScheduleReboot/Product.wxs @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ScheduleReboot/ScheduleReboot.wixproj b/ScheduleReboot/ScheduleReboot.wixproj new file mode 100644 index 0000000..950df57 --- /dev/null +++ b/ScheduleReboot/ScheduleReboot.wixproj @@ -0,0 +1,37 @@ + + + + Debug + x64 + 3.10 + 311008ee-b26a-4d88-8249-94103288d156 + 2.0 + ScheduleReboot + Package + + + bin\$(Configuration)\ + obj\$(Configuration)\ + Debug + + + bin\$(Configuration)\ + obj\$(Configuration)\ + + + + + + + + + + + \ No newline at end of file From 12fec6f16a10128a4a2c70f00e989cb0de157bb7 Mon Sep 17 00:00:00 2001 From: Fredrik Orderud Date: Wed, 30 Aug 2023 09:35:15 +0200 Subject: [PATCH 2/4] Add a README.txt file to the installer, so that it's no empty. --- ScheduleReboot/Product.wxs | 5 ++++- ScheduleReboot/README.txt | 1 + ScheduleReboot/ScheduleReboot.wixproj | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 ScheduleReboot/README.txt diff --git a/ScheduleReboot/Product.wxs b/ScheduleReboot/Product.wxs index 1842ca7..339a8d3 100644 --- a/ScheduleReboot/Product.wxs +++ b/ScheduleReboot/Product.wxs @@ -15,7 +15,7 @@ - + @@ -23,6 +23,9 @@ + + + diff --git a/ScheduleReboot/README.txt b/ScheduleReboot/README.txt new file mode 100644 index 0000000..efb3d21 --- /dev/null +++ b/ScheduleReboot/README.txt @@ -0,0 +1 @@ +Dummy application for testing of reboot handling. \ No newline at end of file diff --git a/ScheduleReboot/ScheduleReboot.wixproj b/ScheduleReboot/ScheduleReboot.wixproj index 950df57..c32b0a0 100644 --- a/ScheduleReboot/ScheduleReboot.wixproj +++ b/ScheduleReboot/ScheduleReboot.wixproj @@ -21,6 +21,9 @@ + + + From cb174f4a681964e0042ce3b8ced5ca7ad0188429 Mon Sep 17 00:00:00 2001 From: Fredrik Orderud Date: Wed, 30 Aug 2023 09:12:21 +0200 Subject: [PATCH 3/4] Schedule reboot after installation is complete. --- ScheduleReboot/Product.wxs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ScheduleReboot/Product.wxs b/ScheduleReboot/Product.wxs index 339a8d3..a7a15d8 100644 --- a/ScheduleReboot/Product.wxs +++ b/ScheduleReboot/Product.wxs @@ -11,6 +11,11 @@ + + + + + From 768462702aa4a0267b374535b77caebf5a0106d9 Mon Sep 17 00:00:00 2001 From: Fredrik Orderud Date: Wed, 30 Aug 2023 09:48:59 +0200 Subject: [PATCH 4/4] Mention project in top-level README file. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f52d1b3..74dc98a 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,8 @@ It's possible to use the `Get-WmiObject Win32_Product` command to list all MSI-i ### ParseMSI script The [ParseMSI.ps1](./ParseMSI.ps1) script can be used to detect installed MSI applications through the [WindowsInstaller](https://learn.microsoft.com/en-us/windows/win32/msi/installer-object) COM interfaces. +### ScheduleReboot Installer +Sample project for testing of installers that rquire rebooting to complete the installation. ## MSIX packages Microsoft is recommending to migrate to the newer [MSIX](https://learn.microsoft.com/en-us/windows/msix/overview) installer format. However, it's more restrictive with limitations on inter-app communication. Also, tooling support is lagging behind - at least for Qt (see [How to package a Win32 desktop app in MSIX?](https://bugreports.qt.io/browse/QTBUG-97088)). Adoption can therefore be challenging.