Skip to content

Commit

Permalink
feat: update lessmsi to use .NET Framework 4.8 or newer and be develo…
Browse files Browse the repository at this point in the history
…ped with Visual Studio 2022 (#189)

BREAKING CHANGE: Versions of .NET Framework before are no longer supported by lessmsi. If you want to use an older version use the version v1.11.3 of lessmsi or an earlier release. The lessmsi README (https://github.com/activescott/lessmsi) documents the support policy going forward, which is basically to support the oldest version of Windows that Microsoft officially supports (currently Windows 10) and a version of .NET Framework that is included with that oldest supported version of Windows.
  • Loading branch information
activescott authored May 5, 2024
1 parent e8c7b5c commit 33ce267
Show file tree
Hide file tree
Showing 11 changed files with 169 additions and 76 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*.suo
*.user
*.csproj.user
*.dtbcache.json
*.userprefs
*.wixpdb
*.wixobj
Expand All @@ -27,4 +28,5 @@ _Resharper*/
src/TestResult.xml
src/.build/nuget.exe
src/msbuild.log
src/.vs
src/.vs/
src/.temp/
118 changes: 92 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
# lessmsi #
[![Build Status](https://ci.appveyor.com/api/projects/status/github/activescott/lessmsi?branch=master&svg=true)](https://ci.appveyor.com/project/activescott/lessmsi)
[![Chocolatey Downloads](https://img.shields.io/chocolatey/dt/lessmsi.svg?style=popout)](https://chocolatey.org/packages/lessmsi)
# lessmsi

[![Build Status](https://ci.appveyor.com/api/projects/status/github/activescott/lessmsi?branch=master&svg=true)](https://ci.appveyor.com/project/activescott/lessmsi)
[![Chocolatey Downloads](https://img.shields.io/chocolatey/dt/lessmsi.svg?style=popout)](https://chocolatey.org/packages/lessmsi)
[![chocolatey](https://img.shields.io/chocolatey/v/lessmsi.svg?maxAge=2592000)](https://chocolatey.org/packages/lessmsi)
[![GitHub forks](https://img.shields.io/github/forks/activescott/lessmsi.svg)](https://github.com/activescott/lessmsi/network)
[![GitHub stars](https://img.shields.io/github/stars/activescott/lessmsi.svg)](https://github.com/activescott/lessmsi/stargazers)
[![tip for next commit](https://tip4commit.com/projects/316.svg)](https://tip4commit.com/projects/316)
[![tip for next commit](https://tip4commit.com/projects/316.svg)](https://tip4commit.com/projects/316)
[![GitHub issues](https://img.shields.io/github/issues/activescott/lessmsi.svg)](https://github.com/activescott/lessmsi/issues)

This is a utility with a graphical user interface and a command line interface that can be used to view and extract the contents of an MSI file.
This is a utility with a graphical user interface and a command line interface that can be used to view and extract the contents of an MSI file.

# Usage

# Usage #
To extract from the command line:

lessmsi x <msiFileName> [<outputDir>]

For more command line usage see [CommandLine](https://github.com/activescott/lessmsi/wiki/Command-Line).

# Installation #
# Installation

Install [via Chocolatey](https://chocolatey.org/packages/lessmsi) (or [download a zip](https://github.com/activescott/lessmsi/releases/latest)).

# Features #
## Windows Explorer Integration ##
# Features

## Windows Explorer Integration

Lessmsi also integrates with Windows Explorer so that you can right-click on a Windows Installer file (.msi file) and select "Extract Files" to extract it into a folder right there:

![lessmsi Explorer Integration screenshot](https://raw.github.com/activescott/lessmsi/master/misc/screenshot-explorerintegration.png)
Expand All @@ -29,47 +34,108 @@ Just select _Preferences_ from the _Edit_ menu to enable (or disable) the explor

![lessmsi Preferences Dialog screenshot](https://raw.github.com/activescott/lessmsi/master/misc/screenshot-preferences.png)

## GUI

## GUI ##
In addition to allowing you to extract files from the command line and from inside Windows Explorer, lessmsi has a graphical user interface that allows you to view detailed information about any MSI file.
In addition to allowing you to extract files from the command line and from inside Windows Explorer, lessmsi has a graphical user interface that allows you to view detailed information about any MSI file.

![lessmsi Files Tab screenshot](https://raw.github.com/activescott/lessmsi/master/misc/screenshot-filestab.png)

## MSI Table Viewer

## MSI Table Viewer ##
Windows Installer (.msi files) are based on an internal database of tables. Lessmsi features a viewer for those tables. Useful for people who work a lot with installers.

![lessmsi Table Tab screenshot](https://raw.github.com/activescott/lessmsi/master/misc/screenshot-tabletab.png)

# Suggestion? Problem? Comment? #
If you have a problem *please* submit it by clicking in the [Issue tracker](https://github.com/activescott/lessmsi/issues) and I'll look into it when I can.
# Suggestion? Problem? Comment?

If you have a problem _please_ submit it by clicking in the [Issue tracker](https://github.com/activescott/lessmsi/issues) and I'll look into it when I can.

# Donate to Support Open Source Contributors of lessmsi

You can **donate** in two ways:

- [Donate at Tip4Commit](https://tip4commit.com/github/activescott/lessmsi) (Bitcoin only) to fund a general fund. Each new commit to this repository receives a percentage of the available balance.
- [Donate at IssueHunt](https://issuehunt.io/r/activescott/lessmsi) to deposit your donation as a "bounty" against a specific issue or feature request. When a contributor resolves the issue they will earn the deposit for that issue.

# Contributing

# Contributions #
Pull requests are welcome! Just make sure the Travis-CI build (compile only) passes and you run unit tests and I'll merge your contributions ASAP! The Issues app has an indication of some of the plans.

## You Earn Bitcoin Tips for Contributing! ##
## You Earn Bitcoin Tips for Contributing!

We're now tipping committers with bitcoin: [![tip for next commit](http://tip4commit.com/projects/316.svg)](http://tip4commit.com/projects/316)

## You Earn a Bounty for Resolving Issues! ##
## You Earn a Bounty for Resolving Issues!

We're now [registered at IssueHunt](https://issuehunt.io/r/activescott/lessmsi) so contributors can earn the bounty on specific issues that users have deposited funds against.

## Development Environment

To set up a _free_ Windows development environment that works with Lessmsi:

1. Install [VMWare Fusion Player](https://www.vmware.com/products/fusion.html) (using free "Player" version, only needed if developing on MacOS - [homebrew also has a vmware-fusion formula](https://formulae.brew.sh/cask/vmware-fusion))
2. Download a Virtual Machine for Windows development that Microsoft provides at https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/. These VMs include virtual machine with the latest versions of Windows, the developer tools, SDKs, and samples ready to go.
3. Install chocolatey as described at https://chocolatey.org/install
4. Install some things using the "Command Prompt" (`cmd` rather than "Power Shell"/`ps`) and `winget` here):

```sh
# install git for windows (this also installs "bash" via "Git Bash")
$ winget install git.git

# Donate to Support Open Source Contributors of lessmsi #
You can **donate** in two ways:
* [Donate at Tip4Commit](https://tip4commit.com/github/activescott/lessmsi) (Bitcoin only) to fund a general fund. Each new commit to this repository receives a percentage of the available balance.
* [Donate at IssueHunt](https://issuehunt.io/r/activescott/lessmsi) to deposit your donation as a "bounty" against a specific issue or feature request. When a contributor resolves the issue they will earn the deposit for that issue.
# install chocolatey (this is required to run the MSBuild script and create the chocolatey package that is deployed by CI)
$ winget install chocolatey

# NOTE: you'll need to close this window and open a new one to get the cpack and git on the path
```

Then you can switch to bash by typing "bash" in the start menu and selecting "Git Bash" and follow these steps:

```sh
# in Git Bash..., generate and ssh key for github:
$ ssh-keygen
# follow prompts...

# Print *public* ssh key to console, and register the printed value at github at https://github.com/settings/ssh/new by copying the key printed from the prior step into that box
$ cat ~/.ssh/id_ed25519.pub

# create directories for code and clone the repo:
$ mkdir /c/src
$ cd /c/src
$ git clone [email protected]:activescott/lessmsi.git
```

Now I switch back to a "Developer Command Prompt for Visual Studio" (i.e. `cmd` with helpful PATH) to do a build since it is more CI-like:

```sh
$ cd \src\lessmsi\src
$ .\build.bat

# I usually start with 0.0.1 when prompted for a version number...

```

## Supported Windows Versions

The latest versions of Lessmsi should support the oldest version of Windows that Microsoft still officially supports according to https://learn.microsoft.com/en-us/windows/release-health/supported-versions-windows-client
That means we need to also target a .NET Framework version that is included in the oldest version Windows that Microsoft still supports which can be found at https://en.wikipedia.org/wiki/.NET_Framework_version_history

For example as of 2024, Windows 10 is the oldest version of Windows still supported and according to the Wikipedia article, .NET Framework 4.8 is included in Windows 10 (some reasonably current update to Windows 10), so targeting .NET Framework 4.8 is ideal since any reasonably up-to-date version of Windows 10 will have .NET Framework 4.8. Going further, as of April 2024, we see that while .NET Framework 4.8.1 is also available, it is only included in Widnows 11, and not included in any Windows 10 version, so we should *not* target .NET Framework 4.8.1 as some of our Windows 10 users may not yet have 4.8.1 installed.

## Deploying & Publishing New Versions

# Deploying & Publishing New Versions #
New versions are published to GitHub Releases and Chocolatey via [semantic-release](https://github.com/semantic-release/semantic-release) to consistently release [semver](https://semver.org/)-compatible versions. Only the master branch is deployed.

To trigger a release just commit (or merge) to the master branch. All commits in master should use the Conventional Commits following [Angular Commit Message Conventions](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines).

Then the CI script in the repo at [/appveyor.yml](https://github.com/activescott/lessmsi/blob/master/appveyor.yml) should build, test the code and if the build & tests succeed deploy it first to github and then to Chocolatey. Release configuration via semantic-release is in [/release.config.js](https://github.com/activescott/lessmsi/blob/master/release.config.js) and the `semantic-release-*.cmd` files in the [/src/.build](https://github.com/activescott/lessmsi/tree/master/src/.build) folder.

------
---

_Originally from Scott Willeke's blog http://blogs.pingpoet.com/overflow and http://blog.scott.willeke.com.
It was also called Less Msiérables as well as lessmsi._

_Was featured in the book [Windows Developer Power Tools](https://www.oreilly.com/library/view/windows-developer-power/0596527543/) as Less MSIérables._

*Originally from Scott Willeke's blog http://blogs.pingpoet.com/overflow and http://blog.scott.willeke.com.
It was also called Less Msiérables as well as lessmsi.*
```
*Was featured in the book [Windows Developer Power Tools](https://www.oreilly.com/library/view/windows-developer-power/0596527543/) as Less MSIérables.*
```
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# see http://www.appveyor.com/docs/appveyor-yml
# environment info: https://www.appveyor.com/docs/windows-images-software/#visual-studio-2015
image: Visual Studio 2015
image: Visual Studio 2022

environment:
# from https://github.com/settings/tokens encrypted at https://ci.appveyor.com/tools/encrypt
Expand Down
69 changes: 39 additions & 30 deletions src/.build/lessmsi.msbuild
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@
http://msdn.microsoft.com/en-us/library/vstudio/ms164313.aspx
-->

<PropertyGroup>
<MSBuildCommunityTasksPath>$(MSBuildProjectDirectory)</MSBuildCommunityTasksPath>
</PropertyGroup>
<Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.Targets" />

<!-- Some misc properties -->
<PropertyGroup>
<RootDir>..\</RootDir>
<TheDeployDir>$(RootDir)\.deploy</TheDeployDir>
<AssemblyCopyright>Copyright Scott Willeke © 2004-2013</AssemblyCopyright>
<TheTempDir>$(RootDir)\.temp</TheTempDir>
<AssemblyCopyright>Copyright Scott Willeke © 2004-$([System.DateTime]::Now.Year)</AssemblyCopyright>
<TheZipFileName>lessmsi-v$(TheVersion).zip</TheZipFileName>
<NugetPath>../.nuget/nuget.exe</NugetPath>
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
Expand Down Expand Up @@ -80,32 +77,37 @@
</Target>

<Target Name="SetProjectVersion">

<!-- This all from https://artemigos.github.io/coding/2017/07/10/assembly-versioning-with-msbuild.html - Thanks! -->
<ItemGroup>
<AssemblyInfoFiles Include="$(RootDir)\CommonAssemblyInfo.cs" />
<Attr Include="AssemblyVersion">
<_Parameter1>$(TheVersion)</_Parameter1>
</Attr>
<Attr Include="AssemblyFileVersion">
<_Parameter1>$(TheVersion)</_Parameter1>
</Attr>
<Attr Include="AssemblyCopyright">
<_Parameter1>$(AssemblyCopyright)</_Parameter1>
</Attr>
</ItemGroup>

<AssemblyInfo
OutputFile="@(AssemblyInfoFiles)"
CodeLanguage="C#"
AssemblyCopyright="$(AssemblyCopyright)"
AssemblyVersion="$(TheVersion)"
AssemblyFileVersion="$(TheVersion)"
>
</AssemblyInfo>
<WriteCodeFragment
AssemblyAttributes="@(Attr)"
Language="C#"
OutputFile="$(RootDir)\CommonAssemblyInfo.cs"
/>

</Target>

<Target Name="Clean">
<RemoveDir Directories="$(TheDeployDir)" />
<RemoveDir Directories="$(TheTempDir)" />
</Target>

<Target Name="EnsureDependencies" DependsOnTargets="Init">
<!-- Only download a new copy of nuget.exe if we don't have a copy available -->
<WebDownload Condition="!Exists('$(NugetPath)')" Filename="$(NugetPath)" FileUri="https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" />
<Target Name="EnsureDependencies" DependsOnTargets="Init">
<!-- Only download a new copy of nuget.exe if we don't have a copy available -->
<WebDownload Condition="!Exists('$(NugetPath)')" Filename="$(NugetPath)" FileUri="https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" />

<Exec Command='$(NugetPath) restore -Verbosity Detailed -NonInteractive -OutputDirectory $(RootDir)\packages\ -Source "https://api.nuget.org/v3/index.json" $(RootDir)\LessMsi.sln'></Exec>
</Target>
<Exec Command='$(NugetPath) restore -Verbosity Detailed -NonInteractive -OutputDirectory $(RootDir)\packages\ -Source "https://api.nuget.org/v3/index.json" $(RootDir)\LessMsi.sln'></Exec>
</Target>

<Target Name="Build" DependsOnTargets="Init;Validate;SetProjectVersion;EnsureDependencies">
<Message Text="Building version: $(TheVersion)" />
Expand Down Expand Up @@ -150,11 +152,16 @@
</Target>

<Target Name="Zip" DependsOnTargets="Deploy">
<!-- see https://github.com/loresoft/msbuildtasks/blob/master/Source/MSBuild.Community.Tasks/Zip.cs -->
<Zip
Files="@(DeployFiles)"
Flatten="True"
ZipFileName="$(TheDeployDir)\$(TheZipFileName)"
<!-- ZipDirectory built-in task: https://learn.microsoft.com/en-us/visualstudio/msbuild/zipdirectory-task?view=vs-2022 -->
<MakeDir Directories="$(TheTempDir)" />
<ZipDirectory
SourceDirectory="$(TheDeployDir)"
DestinationFile="$(TheTempDir)\$(TheZipFileName)"
/>
<!-- Now copy the temp zip file into the deploy directory -->
<Copy
SourceFiles="$(TheTempDir)\$(TheZipFileName)"
DestinationFolder="$(TheDeployDir)"
/>
</Target>

Expand Down Expand Up @@ -192,10 +199,12 @@
Query="//package/metadata/version"
Value="$(TheVersion)"
/>
<FileUpdate Files="$(PackageDir)\tools\chocolateyInstall.ps1"
Regex="__ZIP_FILE__"
ReplacementText="$(TheZipFileName)"
<WriteLinesToFile
File="$(PackageDir)\tools\chocolateyInstall.ps1"
Lines="$([System.IO.File]::ReadAllText($(PackageDir)\tools\chocolateyInstall.ps1).Replace('__ZIP_FILE__','$(TheZipFileName)'))"
Overwrite="true"
/>

<Exec
Command="choco pack $(PackageDir)\lessmsi.nuspec"
WorkingDirectory="$(PackageDir)"
Expand Down
6 changes: 4 additions & 2 deletions src/ExplorerShortcutHelper/ExplorerShortcutHelper.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
Expand All @@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Willeke.Scott.ExplorerShortcutHelper</RootNamespace>
<AssemblyName>AddWindowsExplorerShortcut</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<StartupObject>
</StartupObject>
Expand Down Expand Up @@ -44,6 +44,7 @@
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\Release\</OutputPath>
Expand All @@ -53,6 +54,7 @@
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\CommonAssemblyInfo.cs">
Expand Down
6 changes: 4 additions & 2 deletions src/LessMsi.Cli/LessMsi.Cli.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand All @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LessMsi.Cli</RootNamespace>
<AssemblyName>lessmsi</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
Expand All @@ -24,6 +24,7 @@
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\Release\</OutputPath>
Expand All @@ -33,6 +34,7 @@
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<StartupObject>LessMsi.Cli.Program</StartupObject>
Expand Down
Loading

0 comments on commit 33ce267

Please sign in to comment.