Skip to content

Commit

Permalink
Merge branch 'sched-reboot'
Browse files Browse the repository at this point in the history
  • Loading branch information
Fredrik Orderud committed Aug 30, 2023
2 parents c5788fe + 7684627 commit f3c5015
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 1 deletion.
8 changes: 7 additions & 1 deletion MsiQuery.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions ScheduleReboot/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/obj
/bin
36 changes: 36 additions & 0 deletions ScheduleReboot/Product.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="ScheduleReboot" Language="1033" Version="1.0.0.0" Manufacturer="MsiQuery project" UpgradeCode="0d2456ba-6b7e-46aa-bec2-428f174081cf">
<Package InstallerVersion="500" Compressed="yes" InstallScope="perMachine" />

<!-- Disable downgrades, prevent side-by-side installations of same version -->
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." AllowSameVersionUpgrades="yes"/>
<!-- Embed binaries inside MSI instead of separate CAB files -->
<MediaTemplate EmbedCab="yes"/>

<Feature Id="ProductFeature" Title="ScheduleReboot" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>

<InstallExecuteSequence>
<!-- https://learn.microsoft.com/en-us/windows/win32/msi/schedulereboot-action -->
<ScheduleReboot After="InstallFinalize"/>
</InstallExecuteSequence>
</Product>

<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="INSTALLFOLDER" Name="ScheduleReboot" />
</Directory>
</Directory>
</Fragment>

<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="README.txt" Guid="*">
<File Id="README.txt" KeyPath="yes" Source="README.txt" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
1 change: 1 addition & 0 deletions ScheduleReboot/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dummy application for testing of reboot handling.
40 changes: 40 additions & 0 deletions ScheduleReboot/ScheduleReboot.wixproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x64</Platform>
<ProductVersion>3.10</ProductVersion>
<ProjectGuid>311008ee-b26a-4d88-8249-94103288d156</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>ScheduleReboot</OutputName>
<OutputType>Package</OutputType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Include="Product.wxs" />
</ItemGroup>
<ItemGroup>
<Content Include="README.txt" />
</ItemGroup>
<Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " />
<Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
<Error Text="The WiX Toolset v3.11 build tools must be installed to build this project. To download the WiX Toolset, see https://wixtoolset.org/releases/v3.11/stable" />
</Target>
<!--
To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Wix.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

0 comments on commit f3c5015

Please sign in to comment.