From 1d4b906c1104185b1d0912cad6c4be3d9ab58f46 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Wed, 8 Nov 2023 15:45:24 -0800 Subject: [PATCH 1/6] feat!: build with CMake and release with semantic-release BREAKING CHANGE: Drops Windows XP support --- .appveyor.yml | 42 ----------------- .github/workflows/ci.yml | 81 +++++++++++++++++++++++++++++++++ .github/workflows/semantic.yml | 26 +++++++++++ .gitignore | 1 + .releaserc.json | 18 ++++++++ CMakeLists.txt | 12 +++++ README.md | 22 +++++---- rcedit.gyp | 40 ----------------- rcedit.sln | 19 -------- rcedit.vcxproj | 82 ---------------------------------- rcedit.vcxproj.filters | 32 ------------- src/main.cc | 62 ++++++++++++++++++++++--- src/rcedit.rc | 8 ++-- src/version.h | 28 ------------ 14 files changed, 209 insertions(+), 264 deletions(-) delete mode 100644 .appveyor.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/semantic.yml create mode 100644 .releaserc.json create mode 100644 CMakeLists.txt delete mode 100644 rcedit.gyp delete mode 100644 rcedit.sln delete mode 100644 rcedit.vcxproj delete mode 100644 rcedit.vcxproj.filters delete mode 100644 src/version.h diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 7d86882..0000000 --- a/.appveyor.yml +++ /dev/null @@ -1,42 +0,0 @@ -image: Visual Studio 2017 - -configuration: Default - -platform: - - x64 - - Win32 - -before_build: - - cmd: | - git clone --depth 1 https://chromium.googlesource.com/external/gyp - gyp\gyp rcedit.gyp --depth . - -build: - project: rcedit.sln - parallel: true - verbosity: minimal - -after_build: - - cmd: if %PLATFORM%==Win32 (move Default\rcedit.exe Default\rcedit-x86.exe) - - cmd: if %PLATFORM%==x64 (move Default\rcedit.exe Default\rcedit-x64.exe) - -branches: - only: - - master - -artifacts: - - path: Default\*.exe - -deploy: - - provider: GitHub - release: Rcedit $(APPVEYOR_REPO_TAG_NAME) - tag: $(APPVEYOR_REPO_TAG_NAME) - description: '(placeholder)' - auth_token: - secure: lVaYho+MDDKAQH4aImQub/L5ORlENgZ4utufxWAetovWnIsWiwFCkgFRIcIRMWz5 - artifact: /.*\.exe/ - draft: true - force_update: true - prerelease: false - on: - appveyor_repo_tag: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..37ec512 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,81 @@ +name: Continuous Integration + +on: + push: + branches: + - master + pull_request: + branches: + - master + +permissions: + contents: read + +jobs: + build: + name: Build + runs-on: windows-2022 + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + fetch-depth: 1 + - name: Build + run: | + cmake -E make_directory build/x64 + cmake -E make_directory build/Win32 + cd build/x64 + cmake -A x64 ../../ + cmake --build . --config RelWithDebInfo + cd ../../build/Win32 + cmake -A Win32 ../../ + cmake --build . --config RelWithDebInfo + - name: Copy to dist + run: | + cmake -E make_directory dist + cmake -E copy build/x64/RelWithDebInfo/rcedit.exe dist/rcedit-x64.exe + cmake -E copy build/Win32/RelWithDebInfo/rcedit.exe dist/rcedit-x86.exe + - name: Upload artifacts + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 + with: + name: dist + path: dist/ + + release: + name: Release + runs-on: windows-2022 + needs: build + if: github.ref == 'refs/heads/master' + permissions: + contents: write + steps: + - name: Checkout + id: checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 + with: + name: dist + path: dist/ + - name: Print help + run: | + dist/rcedit-x86.exe -h + dist/rcedit-x64.exe -h + - run: npm install -g semantic-release@22.0.6 semantic-release-export-data@v1.0.1 + - run: npx semantic-release@22.0.6 --dry-run + id: get-next-version + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Stamp version + if: steps.get-next-version.outputs.new-release-published == 'true' + run: | + set -eo pipefail + dist/rcedit-x64.exe dist/rcedit-x86.exe --set-product-version $VERSION --set-file-version $VERSION + dist/rcedit-x86.exe -h | grep -q Rcedit v$VERSION + dist/rcedit-x86.exe dist/rcedit-x64.exe --set-product-version $VERSION --set-file-version $VERSION + dist/rcedit-x64.exe -h | grep -q Rcedit v$VERSION + env: + VERSION: ${{ steps.get-next-version.outputs.new-release-version }} + - name: Run semantic release + run: npx semantic-release@22.0.6 --dry-run + if: steps.get-next-version.outputs.new-release-published == 'true' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/semantic.yml b/.github/workflows/semantic.yml new file mode 100644 index 0000000..1a7dad3 --- /dev/null +++ b/.github/workflows/semantic.yml @@ -0,0 +1,26 @@ +name: "Check Semantic Commit" + +on: + pull_request: + types: + - opened + - edited + - synchronize + +permissions: + contents: read + +jobs: + main: + permissions: + pull-requests: read # for amannn/action-semantic-pull-request to analyze PRs + statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR + name: Validate PR Title + runs-on: ubuntu-latest + steps: + - name: semantic-pull-request + uses: amannn/action-semantic-pull-request@e9fabac35e210fea40ca5b14c0da95a099eff26f # v5.4.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + validateSingleCommit: false diff --git a/.gitignore b/.gitignore index dceecf0..7fa43b2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ Default/ ipch/ +build/ *.swp *.sdf diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 0000000..85926dc --- /dev/null +++ b/.releaserc.json @@ -0,0 +1,18 @@ +{ + "plugins": [ + "semantic-release-export-data", + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + [ + "@semantic-release/github", + { + "assets": [ + { "path": "dist/rcedit-x64.exe" }, + { "path": "dist/rcedit-x86.exe" } + ], + "draftRelease": true + } + ] + ], + "branches": [ "master" ] +} diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..439d838 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) + +set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded") + +# /Ox, full optimization +# /Os, favour small code +add_compile_options(/Ox /Os) + +project(rcedit) + +add_executable(rcedit src/main.cc src/rescle.cc src/rcedit.rc) +target_link_libraries(rcedit version.lib) diff --git a/README.md b/README.md index a96e485..c4957a6 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,22 @@ -# rcedit [![Build status](https://ci.appveyor.com/api/projects/status/99eokln2emhidcej?svg=true)](https://ci.appveyor.com/project/zcbenz/rcedit/branch/master) +# rcedit + +[![Continuous Integration](https://github.com/electron/rcedit/actions/workflows/ci.yml/badge.svg)](https://github.com/electron/rcedit/actions/workflows/ci.yml) Command line tool to edit resources of exe file on Windows. ## Executables -Prebuilt binaries can be found in the artifacts of appveyor jobs. +Prebuilt binaries can be found in the releases. ## Building -1. Clone the repository -2. Open `rcedit.sln` with Visual Studio 2015 or above -3. Build - -## Generate solution files +To build you need CMake 3.15+ and Visual Studio 2015 or above. -If you have modified the gyp files, you should regenerate the solution files: - -1. Make sure you have gyp configured on your system. If not, clone gyp from - https://chromium.googlesource.com/external/gyp -2. Run `gyp rcedit.gyp --depth .` +1. Clone the repository +2. Create a build directory: `cmake -E make_directory build` +3. Change to the build directory: `cd build` +4. Make the CMake project: `cmake ..` +5. Build: `cmake --build .` ## Docs diff --git a/rcedit.gyp b/rcedit.gyp deleted file mode 100644 index 49e03be..0000000 --- a/rcedit.gyp +++ /dev/null @@ -1,40 +0,0 @@ -{ - 'targets': [ - { - 'target_name': 'rcedit', - 'type': 'executable', - 'sources': [ - 'src/main.cc', - 'src/rescle.cc', - 'src/rescle.h', - 'src/rcedit.rc', - 'src/version.h', - ], - 'msvs_settings': { - 'VCLinkerTool': { - 'SubSystem': 1, # console executable - }, - 'VCCLCompilerTool': { - 'Optimization': 3, # /Ox, full optimization - 'FavorSizeOrSpeed': 1, # /Os, favour small code - 'RuntimeLibrary': 0, # /MT, for statically linked runtime - }, - }, - 'conditions': [ - ['MSVS_VERSION=="2015"', { - 'msbuild_toolset': 'v140_xp', - }], - ['MSVS_VERSION=="2017"', { - 'msbuild_toolset': 'v141_xp', - }], - ], - 'configurations': { - 'Default': { - }, - 'Default_x64': { - 'msvs_configuration_platform': 'x64', - }, - } - }, - ], -} diff --git a/rcedit.sln b/rcedit.sln deleted file mode 100644 index 3de061f..0000000 --- a/rcedit.sln +++ /dev/null @@ -1,19 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2015 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rcedit", "rcedit.vcxproj", "{3609DBE4-DFE6-667B-C659-D6913E25C767}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Default|x64 = Default|x64 - Default|Win32 = Default|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {3609DBE4-DFE6-667B-C659-D6913E25C767}.Default|x64.ActiveCfg = Default|x64 - {3609DBE4-DFE6-667B-C659-D6913E25C767}.Default|x64.Build.0 = Default|x64 - {3609DBE4-DFE6-667B-C659-D6913E25C767}.Default|Win32.ActiveCfg = Default|Win32 - {3609DBE4-DFE6-667B-C659-D6913E25C767}.Default|Win32.Build.0 = Default|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/rcedit.vcxproj b/rcedit.vcxproj deleted file mode 100644 index aabf1b3..0000000 --- a/rcedit.vcxproj +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Default - Win32 - - - Default - x64 - - - - {3609DBE4-DFE6-667B-C659-D6913E25C767} - Win32Proj - rcedit - true - - - - Application - - - v140_xp - - - - - - - - - $(ExecutablePath);$(MSBuildProjectDirectory)\.\bin\;$(MSBuildProjectDirectory)\.\bin\ - $(Configuration)\obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)\ - $(ProjectName) - $(OutDir)\$(ProjectName)$(TargetExt) - - - - false - Speed - Full - NotUsing - MultiThreaded - - - - $(OutDir)$(ProjectName)$(TargetExt) - Console - - - - - false - Speed - Full - NotUsing - MultiThreaded - - - - $(OutDir)$(ProjectName)$(TargetExt) - Console - - - - - - - - - - - - - - - - - - diff --git a/rcedit.vcxproj.filters b/rcedit.vcxproj.filters deleted file mode 100644 index bc7aacb..0000000 --- a/rcedit.vcxproj.filters +++ /dev/null @@ -1,32 +0,0 @@ - - - - - {8CDEE807-BC53-E450-C8B8-4DEBB66742D4} - - - {8CDEE807-BC53-E450-C8B8-4DEBB66742D4} - - - {8CDEE807-BC53-E450-C8B8-4DEBB66742D4} - - - {8CDEE807-BC53-E450-C8B8-4DEBB66742D4} - - - - - src - - - src - - - src - - - src - - - - diff --git a/src/main.cc b/src/main.cc index c7763b8..108d97a 100644 --- a/src/main.cc +++ b/src/main.cc @@ -4,14 +4,53 @@ #include +#include +#include + #include "rescle.h" -#include "version.h" namespace { -void print_help() { +LPVOID get_file_version_info() { + DWORD zero = 0; + DWORD filename_buffer_size = MAX_PATH; + LPWSTR filename = nullptr; + SetLastError(ERROR_SUCCESS); + + do { + filename = new wchar_t[filename_buffer_size]; + + GetModuleFileNameW(NULL, filename, filename_buffer_size); + + // Double the buffer size in case the path is longer + filename_buffer_size *= 2; + } while (GetLastError() == ERROR_INSUFFICIENT_BUFFER); + + if (GetLastError() != ERROR_SUCCESS) { + return nullptr; + } + + DWORD file_ver_info_size = GetFileVersionInfoSizeW(filename, &zero); + if (file_ver_info_size == 0) { + free(filename); + return nullptr; + } + + LPVOID file_ver_info = operator new(file_ver_info_size); + if (!GetFileVersionInfoW(filename, NULL, file_ver_info_size, file_ver_info)) { + free(file_ver_info); + free(filename); + return nullptr; + } + + free(filename); + + return file_ver_info; +} + +void print_help(VS_FIXEDFILEINFO* file_info) { fprintf(stdout, -"Rcedit " RCEDIT_VERSION ": Edit resources of exe.\n\n" +"Rcedit %d.%d.%d: Edit resources of exe.\n\n" "Usage: rcedit [options...]\n\n" "Options:\n" " -h, --help Show this message\n" @@ -24,7 +63,10 @@ void print_help() { " --application-manifest Set manifest file\n" " --set-resource-string Set resource string\n" " --get-resource-string Get resource string\n" -" --set-rcdata Replace RCDATA by integer id\n"); +" --set-rcdata Replace RCDATA by integer id\n", +(file_info->dwProductVersionMS >> 16) & 0xff, +(file_info->dwProductVersionMS >> 0) & 0xff, +(file_info->dwProductVersionLS >> 16) & 0xff); } bool print_error(const char* message) { @@ -54,7 +96,17 @@ int wmain(int argc, const wchar_t* argv[]) { if (argc == 1 || (argc == 2 && wcscmp(argv[1], L"-h") == 0) || (argc == 2 && wcscmp(argv[1], L"--help") == 0)) { - print_help(); + UINT ignored = 0; + VS_FIXEDFILEINFO* file_info = nullptr; + LPVOID file_version_info = get_file_version_info(); + + if (file_version_info == nullptr || !VerQueryValueW(file_version_info, L"\\", (LPVOID*) &file_info, &ignored)) { + free(file_version_info); + return print_error("Could not determine version of rcedit"); + } + + print_help(file_info); + free(file_version_info); return 0; } diff --git a/src/rcedit.rc b/src/rcedit.rc index 84920c8..79ca01d 100644 --- a/src/rcedit.rc +++ b/src/rcedit.rc @@ -20,8 +20,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,1,1,0 - PRODUCTVERSION 1,1,1,0 + FILEVERSION 0,0,0,0 + PRODUCTVERSION 0,0,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -38,10 +38,10 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc" VALUE "FileDescription", "Edit resources of exe" - VALUE "FileVersion", "1.1.1" + VALUE "FileVersion", "0.0.0" VALUE "LegalCopyright", "Copyright (C) 2013 GitHub, Inc. All rights reserved." VALUE "ProductName", "rcedit" - VALUE "ProductVersion", "1.1.1" + VALUE "ProductVersion", "0.0.0" END END BLOCK "VarFileInfo" diff --git a/src/version.h b/src/version.h deleted file mode 100644 index 474585c..0000000 --- a/src/version.h +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2017 GitHub, Inc. All rights reserved. -// Use of this source code is governed by MIT license that can be found in the -// LICENSE file. - -#ifndef SRC_VERSION_H_ -#define SRC_VERSION_H_ - -#define RCEDIT_MAJOR_VERSION 1 -#define RCEDIT_MINOR_VERSION 1 -#define RCEDIT_PATCH_VERSION 1 - -#ifndef RCEDIT_TAG -# define RCEDIT_TAG "" -#endif - -#ifndef RCEDIT_STRINGIFY -#define RCEDIT_STRINGIFY(n) RCEDIT_STRINGIFY_HELPER(n) -#define RCEDIT_STRINGIFY_HELPER(n) #n -#endif - -#define RCEDIT_VERSION_STRING RCEDIT_STRINGIFY(RCEDIT_MAJOR_VERSION) "." \ - RCEDIT_STRINGIFY(RCEDIT_MINOR_VERSION) "." \ - RCEDIT_STRINGIFY(RCEDIT_PATCH_VERSION) \ - RCEDIT_TAG - -#define RCEDIT_VERSION "v" RCEDIT_VERSION_STRING - -#endif // SRC_VERSION_H_ From 6f1395a6eb532fb977c68c1c1a4cbad34254b031 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Thu, 9 Nov 2023 16:12:20 -0800 Subject: [PATCH 2/6] refactor: code review suggestion --- src/main.cc | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/main.cc b/src/main.cc index 108d97a..8bc0781 100644 --- a/src/main.cc +++ b/src/main.cc @@ -13,38 +13,31 @@ namespace { LPVOID get_file_version_info() { DWORD zero = 0; - DWORD filename_buffer_size = MAX_PATH; - LPWSTR filename = nullptr; + std::vector filename(MAX_PATH); SetLastError(ERROR_SUCCESS); do { - filename = new wchar_t[filename_buffer_size]; - - GetModuleFileNameW(NULL, filename, filename_buffer_size); + GetModuleFileNameW(NULL, filename.data(), filename.size()); // Double the buffer size in case the path is longer - filename_buffer_size *= 2; + filename.resize(filename.size() * 2); } while (GetLastError() == ERROR_INSUFFICIENT_BUFFER); if (GetLastError() != ERROR_SUCCESS) { return nullptr; } - DWORD file_ver_info_size = GetFileVersionInfoSizeW(filename, &zero); + DWORD file_ver_info_size = GetFileVersionInfoSizeW(filename.data(), &zero); if (file_ver_info_size == 0) { - free(filename); return nullptr; } LPVOID file_ver_info = operator new(file_ver_info_size); - if (!GetFileVersionInfoW(filename, NULL, file_ver_info_size, file_ver_info)) { + if (!GetFileVersionInfoW(filename.data(), NULL, file_ver_info_size, file_ver_info)) { free(file_ver_info); - free(filename); return nullptr; } - free(filename); - return file_ver_info; } From 93e4a3292ec22e4d21ba91aac48a3607b64baf63 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Thu, 9 Nov 2023 16:16:38 -0800 Subject: [PATCH 3/6] ci: move print help to build job --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 37ec512..6e74c89 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,6 +34,10 @@ jobs: cmake -E make_directory dist cmake -E copy build/x64/RelWithDebInfo/rcedit.exe dist/rcedit-x64.exe cmake -E copy build/Win32/RelWithDebInfo/rcedit.exe dist/rcedit-x86.exe + - name: Print help + run: | + dist/rcedit-x86.exe -h + dist/rcedit-x64.exe -h - name: Upload artifacts uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 with: @@ -55,10 +59,6 @@ jobs: with: name: dist path: dist/ - - name: Print help - run: | - dist/rcedit-x86.exe -h - dist/rcedit-x64.exe -h - run: npm install -g semantic-release@22.0.6 semantic-release-export-data@v1.0.1 - run: npx semantic-release@22.0.6 --dry-run id: get-next-version From 04590bc8dfd5607bf7be2f8fe3b7236d04db8bd2 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Thu, 9 Nov 2023 16:21:38 -0800 Subject: [PATCH 4/6] refactor: code review suggestion --- src/main.cc | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/main.cc b/src/main.cc index 8bc0781..3ac8fc3 100644 --- a/src/main.cc +++ b/src/main.cc @@ -3,6 +3,7 @@ // LICENSE file. #include +#include #include #include @@ -11,7 +12,7 @@ namespace { -LPVOID get_file_version_info() { +std::vector get_file_version_info() { DWORD zero = 0; std::vector filename(MAX_PATH); SetLastError(ERROR_SUCCESS); @@ -24,18 +25,17 @@ LPVOID get_file_version_info() { } while (GetLastError() == ERROR_INSUFFICIENT_BUFFER); if (GetLastError() != ERROR_SUCCESS) { - return nullptr; + return std::vector(); } DWORD file_ver_info_size = GetFileVersionInfoSizeW(filename.data(), &zero); if (file_ver_info_size == 0) { - return nullptr; + return std::vector(); } - LPVOID file_ver_info = operator new(file_ver_info_size); - if (!GetFileVersionInfoW(filename.data(), NULL, file_ver_info_size, file_ver_info)) { - free(file_ver_info); - return nullptr; + std::vector file_ver_info(file_ver_info_size); + if (!GetFileVersionInfoW(filename.data(), NULL, file_ver_info.size(), file_ver_info.data())) { + return std::vector(); } return file_ver_info; @@ -91,15 +91,13 @@ int wmain(int argc, const wchar_t* argv[]) { (argc == 2 && wcscmp(argv[1], L"--help") == 0)) { UINT ignored = 0; VS_FIXEDFILEINFO* file_info = nullptr; - LPVOID file_version_info = get_file_version_info(); + std::vector file_version_info = get_file_version_info(); - if (file_version_info == nullptr || !VerQueryValueW(file_version_info, L"\\", (LPVOID*) &file_info, &ignored)) { - free(file_version_info); + if (file_version_info.size() == 0 || !VerQueryValueW(file_version_info, L"\\", (LPVOID*) &file_info, &ignored)) { return print_error("Could not determine version of rcedit"); } print_help(file_info); - free(file_version_info); return 0; } From 2309cf71c550328f9ccb2ca24e114d9d3cb8ef0f Mon Sep 17 00:00:00 2001 From: David Sanders Date: Thu, 9 Nov 2023 16:34:52 -0800 Subject: [PATCH 5/6] build: fix --- src/main.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cc b/src/main.cc index 3ac8fc3..663fb01 100644 --- a/src/main.cc +++ b/src/main.cc @@ -93,7 +93,7 @@ int wmain(int argc, const wchar_t* argv[]) { VS_FIXEDFILEINFO* file_info = nullptr; std::vector file_version_info = get_file_version_info(); - if (file_version_info.size() == 0 || !VerQueryValueW(file_version_info, L"\\", (LPVOID*) &file_info, &ignored)) { + if (file_version_info.size() == 0 || !VerQueryValueW(file_version_info.data(), L"\\", (LPVOID*) &file_info, &ignored)) { return print_error("Could not determine version of rcedit"); } From 32c49ddbcae2d8d5a888f0c1f0507b6299c31039 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Thu, 9 Nov 2023 16:45:00 -0800 Subject: [PATCH 6/6] docs: clarify where releases are --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c4957a6..d3f0c63 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Command line tool to edit resources of exe file on Windows. ## Executables -Prebuilt binaries can be found in the releases. +Prebuilt binaries can be found in the [GitHub releases](https://github.com/electron/rcedit/releases). ## Building