From f67e91f07b8b5e8c491c44626a40750e14796c73 Mon Sep 17 00:00:00 2001 From: Victor Derks Date: Tue, 8 Oct 2024 10:34:13 +0200 Subject: [PATCH] Add setup application for x86 and x64 --- .github/workflows/msbuild.yml | 2 +- Directory.Build.props | 23 +++- Directory.Packages.props | 11 ++ README.md | 35 +++-- global.json | 5 + netpbm-wic-codec.sln | 28 ++++ netpbm-wic-codec.sln.DotSettings | 8 ++ setup/bootstrapper/Bundle.wxs | 125 ++++++++++++++++++ setup/bootstrapper/bootstrapper.wixproj | 20 +++ setup/installer/CodecComponents.wxs | 49 +++++++ setup/installer/Package.wxs | 27 ++++ setup/installer/installer.wixproj | 15 +++ .../installer/wic_file_type_registration.wxi | 30 +++++ setup/installer/wic_registration.wxi | 52 ++++++++ 14 files changed, 405 insertions(+), 25 deletions(-) create mode 100644 Directory.Packages.props create mode 100644 global.json create mode 100644 setup/bootstrapper/Bundle.wxs create mode 100644 setup/bootstrapper/bootstrapper.wixproj create mode 100644 setup/installer/CodecComponents.wxs create mode 100644 setup/installer/Package.wxs create mode 100644 setup/installer/installer.wixproj create mode 100644 setup/installer/wic_file_type_registration.wxi create mode 100644 setup/installer/wic_registration.wxi diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index e29a4e3..3586769 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -35,5 +35,5 @@ jobs: run: msbuild /v:m /m /p:Configuration=${{matrix.buildConfiguration}} /p:Platform=${{matrix.buildPlatform}} ${{env.SOLUTION_FILE_PATH}} /p:NETPBM_WIC_CODEC_ALL_WARNINGS=true - name: Test - working-directory: .\build\bin\${{matrix.buildPlatform}}\${{matrix.buildConfiguration}}\ + working-directory: .\build\binaries\${{matrix.buildPlatform}}\${{matrix.buildConfiguration}}\ run: vstest.console.exe /Platform:${{matrix.buildPlatform}} test.dll diff --git a/Directory.Build.props b/Directory.Build.props index f2407a4..196f1f8 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,11 +1,15 @@ - - $(MSBuildThisFileDirectory)build\bin\$(Platform)\$(Configuration)\ - $(MSBuildThisFileDirectory)build\bin\x86\$(Configuration)\ - $(MSBuildThisFileDirectory)build\intermediate\$(Platform)\$(Configuration)\$(MSBuildProjectName)\ - $(MSBuildThisFileDirectory)build\intermediate\x86\$(Configuration)\$(MSBuildProjectName)\ + + $(MSBuildThisFileDirectory)build\binaries\$(Platform)\$(Configuration)\ + $(MSBuildThisFileDirectory)build\binaries\x86\$(Configuration)\ + $(MSBuildThisFileDirectory)build\intermediates\$(Platform)\$(Configuration)\$(MSBuildProjectName)\ + $(MSBuildThisFileDirectory)build\intermediates\x86\$(Configuration)\$(MSBuildProjectName)\ + + + $(MSBuildThisFileDirectory)build\binaries\$(Configuration)\ + $(MSBuildThisFileDirectory)build\intermediates\$(MSBuildProjectName)\ 10.0 @@ -22,6 +26,15 @@ true true + + 0.2.0 + + + FourPartsVersion=$(Version).0; + true + + true + true diff --git a/Directory.Packages.props b/Directory.Packages.props new file mode 100644 index 0000000..f6466ad --- /dev/null +++ b/Directory.Packages.props @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/README.md b/README.md index 3ffcc6e..489af6a 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ This Windows Imaging Component (WIC) codec makes it possible to decode .pgm and It makes it possible to view Netpbm encoded images in Windows PhotoViewer, Windows Explorer (including thumbnails) and import these images in Microsoft Office documents. -It is a C++ 23 implementation based on the project. -It leverages the C++/WinRT framework to implement the classic COM components required for a WIC codec. +It is a C++ 23 implementation originally based on the [PNM WIC Image Codec project](https://github.com/chausner/PnmWicImageCodec). +It leverages the C++/WinRT framework to implement the classic COM components required for a WIC codec and uses Wix v5 for the installer. ## Introduction @@ -36,22 +36,18 @@ The Windows Imaging Component (WIC) is a built-in codec framework of Windows tha to create independent native image codecs that can be used by a large set of applications. WIC is implemented using COM technology. Image codecs for many popular formats are already pre-installed on Windows. -### Status +## Installing -This project is the development phase: +### Requirements -- Visual Studio 2022 17.11 or newer is needed to build the project. -- No installer with pre-built binaries is available, manually building and registering is required. -- Only .pgm P5 gray scale and P6 .ppm images can be decoded. -- All image files are considered single frame (the Netpbm standard also allows multi-frame) -- Only a decoder is available. +- Windows 11 or Windows 10 (version 22H2). +- x86, x64 or ARM64 processor -### Supported Operation Systems +### Via GitHub with EXE -The Netpbm WIC codec supports the following Windows operating systems: - -- Windows 11 and 10 -- Windows Server 2022 +Go to the [releases](https://github.com/team-charls/netpbm-wic-codec/releases) page and click on +Assets at the bottom to show the files available in the release. +Please use the appropriate installer that matches your machine's architecture. ### Applications that can use the Netpbm WIC codec @@ -63,7 +59,8 @@ The following application have been validated to work with the Netpbm WIC codec: is provided to restore this functionality. The standard Windows Registry Editor can be used to add import this .reg file. - WIC Explorer (sample application from Microsoft). An updated version of this application can be found at - ZackViewer . This viewer can also be used to convert from one image encoding format to another. -- Microsoft Office applications like Word, Excel, PowerPoint. These applications can, when the NetPbm codec is installed, import .pgm images in their documents. +- Microsoft Office applications like Word, Excel, PowerPoint. These applications can, when the NetPbm codec is installed, import .pgm images in their documents. The 32 bit version of Office +requires that the x86 version of the codec is installed. #### Windows 11\10 Microsoft Photos Application not supported @@ -101,13 +98,13 @@ The following table lists the formats that can be decoded: Note *: monochrome images with 10 or 12 bits per sample will be upscaled to 16 bits per sample. -## Build Instructions +## Manual Build Instructions 1. Clone this repro -1. Use Visual Studio and open the netpbm-wic-codec.sln. Batch build all projects. +1. Use Visual Studio 2022 17.11 or newer and open the netpbm-wic-codec.sln. Batch build all projects. 1. Or use a Developer Command Prompt and run use MSBuild in the root of the cloned repository. -## Installation +### Installation 1. Open a command prompt with elevated rights 1. Navigate to folder with the netpbm-wic-codec.dll @@ -117,7 +114,7 @@ Note *: monochrome images with 10 or 12 bits per sample will be upscaled to 16 b regsvr32 netpbm-wic-codec.dll ``` -## Uninstall +### Uninstall 1. Open a command prompt with elevated rights 1. Navigate to folder with the netpbm-wic-codec.dll diff --git a/global.json b/global.json new file mode 100644 index 0000000..1d23791 --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "msbuild-sdks": { + "WixToolset.Sdk": "5.0.2" + } +} diff --git a/netpbm-wic-codec.sln b/netpbm-wic-codec.sln index dd868c6..4405d84 100644 --- a/netpbm-wic-codec.sln +++ b/netpbm-wic-codec.sln @@ -20,6 +20,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "std-header-units", "std-header-units\std-header-units.vcxproj", "{DB8D6FC8-6F7B-446F-892A-0BA6C779E5F2}" EndProject +Project("{B7DD6F7E-DEF8-4E67-B5B7-07EF123DB6F0}") = "bootstrapper", "setup\bootstrapper\bootstrapper.wixproj", "{53E56BDE-5FC1-4C10-985E-609A34483B6A}" +EndProject +Project("{B7DD6F7E-DEF8-4E67-B5B7-07EF123DB6F0}") = "installer", "setup\installer\installer.wixproj", "{8A21B212-8135-4499-9E5D-A2B47E88E983}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|ARM64 = Debug|ARM64 @@ -66,6 +70,30 @@ Global {DB8D6FC8-6F7B-446F-892A-0BA6C779E5F2}.Release|x64.Build.0 = Release|x64 {DB8D6FC8-6F7B-446F-892A-0BA6C779E5F2}.Release|x86.ActiveCfg = Release|Win32 {DB8D6FC8-6F7B-446F-892A-0BA6C779E5F2}.Release|x86.Build.0 = Release|Win32 + {53E56BDE-5FC1-4C10-985E-609A34483B6A}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {53E56BDE-5FC1-4C10-985E-609A34483B6A}.Debug|ARM64.Build.0 = Debug|ARM64 + {53E56BDE-5FC1-4C10-985E-609A34483B6A}.Debug|x64.ActiveCfg = Debug|x64 + {53E56BDE-5FC1-4C10-985E-609A34483B6A}.Debug|x64.Build.0 = Debug|x64 + {53E56BDE-5FC1-4C10-985E-609A34483B6A}.Debug|x86.ActiveCfg = Debug|x86 + {53E56BDE-5FC1-4C10-985E-609A34483B6A}.Debug|x86.Build.0 = Debug|x86 + {53E56BDE-5FC1-4C10-985E-609A34483B6A}.Release|ARM64.ActiveCfg = Release|ARM64 + {53E56BDE-5FC1-4C10-985E-609A34483B6A}.Release|ARM64.Build.0 = Release|ARM64 + {53E56BDE-5FC1-4C10-985E-609A34483B6A}.Release|x64.ActiveCfg = Release|x64 + {53E56BDE-5FC1-4C10-985E-609A34483B6A}.Release|x64.Build.0 = Release|x64 + {53E56BDE-5FC1-4C10-985E-609A34483B6A}.Release|x86.ActiveCfg = Release|x86 + {53E56BDE-5FC1-4C10-985E-609A34483B6A}.Release|x86.Build.0 = Release|x86 + {8A21B212-8135-4499-9E5D-A2B47E88E983}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {8A21B212-8135-4499-9E5D-A2B47E88E983}.Debug|ARM64.Build.0 = Debug|ARM64 + {8A21B212-8135-4499-9E5D-A2B47E88E983}.Debug|x64.ActiveCfg = Debug|x64 + {8A21B212-8135-4499-9E5D-A2B47E88E983}.Debug|x64.Build.0 = Debug|x64 + {8A21B212-8135-4499-9E5D-A2B47E88E983}.Debug|x86.ActiveCfg = Debug|x86 + {8A21B212-8135-4499-9E5D-A2B47E88E983}.Debug|x86.Build.0 = Debug|x86 + {8A21B212-8135-4499-9E5D-A2B47E88E983}.Release|ARM64.ActiveCfg = Release|ARM64 + {8A21B212-8135-4499-9E5D-A2B47E88E983}.Release|ARM64.Build.0 = Release|ARM64 + {8A21B212-8135-4499-9E5D-A2B47E88E983}.Release|x64.ActiveCfg = Release|x64 + {8A21B212-8135-4499-9E5D-A2B47E88E983}.Release|x64.Build.0 = Release|x64 + {8A21B212-8135-4499-9E5D-A2B47E88E983}.Release|x86.ActiveCfg = Release|x86 + {8A21B212-8135-4499-9E5D-A2B47E88E983}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/netpbm-wic-codec.sln.DotSettings b/netpbm-wic-codec.sln.DotSettings index 8c44f4a..bad928c 100644 --- a/netpbm-wic-codec.sln.DotSettings +++ b/netpbm-wic-codec.sln.DotSettings @@ -4,24 +4,32 @@ DO_NOT_SHOW True True + True + True True True True True True True + True True True + True True + True True True + True True True True True True + True True True True True + True True \ No newline at end of file diff --git a/setup/bootstrapper/Bundle.wxs b/setup/bootstrapper/Bundle.wxs new file mode 100644 index 0000000..64350c8 --- /dev/null +++ b/setup/bootstrapper/Bundle.wxs @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/setup/bootstrapper/bootstrapper.wixproj b/setup/bootstrapper/bootstrapper.wixproj new file mode 100644 index 0000000..33e264a --- /dev/null +++ b/setup/bootstrapper/bootstrapper.wixproj @@ -0,0 +1,20 @@ + + + + + Bundle + NetpbmWicCodecSetup-$(Version)-$(Platform) + + + + + + + + + + + diff --git a/setup/installer/CodecComponents.wxs b/setup/installer/CodecComponents.wxs new file mode 100644 index 0000000..a128c4b --- /dev/null +++ b/setup/installer/CodecComponents.wxs @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/setup/installer/Package.wxs b/setup/installer/Package.wxs new file mode 100644 index 0000000..ea162a7 --- /dev/null +++ b/setup/installer/Package.wxs @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/setup/installer/installer.wixproj b/setup/installer/installer.wixproj new file mode 100644 index 0000000..7ae0d1d --- /dev/null +++ b/setup/installer/installer.wixproj @@ -0,0 +1,15 @@ + + + + + + + + + + + + diff --git a/setup/installer/wic_file_type_registration.wxi b/setup/installer/wic_file_type_registration.wxi new file mode 100644 index 0000000..71b003c --- /dev/null +++ b/setup/installer/wic_file_type_registration.wxi @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/setup/installer/wic_registration.wxi b/setup/installer/wic_registration.wxi new file mode 100644 index 0000000..52e12e5 --- /dev/null +++ b/setup/installer/wic_registration.wxi @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +