rcedit

repository·main·Indexed 24 days ago

https://github.com/electron/rcedit

A command-line utility for editing resources in Windows executable (.exe) and DLL files. It allows users to modify icons, version strings, file and product versions, application manifests, and resource strings, as well as replace RCDATA by integer ID.

Tokens
1.4K
Snippets
4
Records
12
Agent score
35%

What's inside rcedit

  1. Use rcedit CLI to edit Windows executable resources

    main
    rcedit is a command-line tool used to edit resources of .exe or .dll files on Windows. You can perform various operations such as setting icons, version strings, and application manifests. Many options can be combined in a single command.
  2. Build rcedit from source

    main

    To build rcedit manually, you must have CMake 3.15+ and Visual Studio 2015 or above installed. Follow these steps:

    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 . --config RelWithDebInfo
    cmake -E make_directory build
    cd build
    cmake ..
    cmake --build . --config RelWithDebInfo
  3. Use the rcedit CLI to edit executable resources

    main

    rcedit is a command-line tool used to edit the resources of Windows executables (.exe) and dynamic link libraries (.dll). The basic usage pattern is to provide the filename as the first argument, followed by one or more options to modify the file.

    Usage:

    rcedit <filename> [options...]

    Note: Changes are only applied to the file when the command completes successfully (the Commit phase).

    rcedit <filename> [options...]
  4. Set application execution level or manifest

    main

    You can control how the Windows OS handles the application's privileges using one of two methods:

    1. Execution Level: Use --set-requested-execution-level <level> with one of the following values:

      • asInvoker
      • highestAvailable
      • requireAdministrator
    2. Manifest File: Use --application-manifest <path-to-file> to point to a specific .manifest file.

    Warning: If you provide an --application-manifest, the --set-requested-execution-level option will be ignored.

  5. Set FileVersion and ProductVersion

    main

    You can update the versioning information of an executable using --set-file-version or --set-product-version. These commands accept a version string in dot-separated format (e.g., 1.2.3.4, 1.2.3, 1.2, or 1).

    When using these commands, rcedit updates both the numeric version values and the corresponding FileVersion or ProductVersion version strings automatically.

    Example:

    rcedit myapp.exe --set-file-version 1.2.3.4
    rcedit myapp.exe --set-product-version 2.0
  6. Manage resource strings and RCDATA

    main

    rcedit allows you to manipulate specific resource IDs within the executable.

    Set/Get Resource Strings

    Use --set-resource-string to update a string resource. The <key> must be an integer ID. Use --get-resource-string to retrieve it.

    Example:

    rcedit myapp.exe --set-resource-string 101 "Hello World"
    rcedit myapp.exe --get-resource-string 101

    Replace RCDATA

    Use --set-rcdata to replace an RCDATA resource with the contents of a file. The <key> must be an integer ID.

    Example:

    rcedit myapp.exe --set-rcdata 200 ./new_data.bin
  7. Set icon, resource strings, and manifests

    main

    Modify other executable properties using these commands:

    • Set icon: Use --set-icon <path-to-ico>.
    • Set resource string: Use --set-resource-string <id_number> <new_string_value>.
    • Set requested execution level: Use --set-requested-execution-level <level> with one of: asInvoker, highestAvailable, or requireAdministrator.
    • Set application manifest: Use --application-manifest <path/to/manifest/file>.
  8. Get version strings and resource strings

    main

    Retrieve existing resource values using these commands:

    • Get version string: Use --get-version-string <property>. Use FileVersion to retrieve the value set by --set-file-version and ProductVersion for --set-product-version.
    • Get resource string: Use --get-resource-string <id_number>.
  9. Set version strings and file/product versions

    main

    Use the following commands to modify versioning information in the executable:

    • Set a specific version string property: Use --set-version-string <property> <value>. Properties follow MSDN documentation (e.g., Comments).
    • Set file version: Use --set-file-version <version>.
    • Set product version: Use --set-product-version <version>.
  10. Reference the rcedit CLI options

    main

    The following options are available for the rcedit command-line interface:

    OptionAliasDescription
    --help-hShow this message
    --set-version-string <key> <value>Set version string for a specific key
    --get-version-string <key>--get-version-string <key>Print version string for a specific key
    --set-file-version <version>--set-file-version <version>Set FileVersion (expects dot-separated numbers)
    --set-product-version <version>--set-product-version <version>Set ProductVersion (expects dot-separated numbers)
    --set-icon <path-to-icon>--set-icon <path-to-icon>Set file icon
    --set-requested-execution-level <level>--set-requested-execution-level <level>Set execution level (asInvoker, highestAvailable, or requireAdministrator)
    --application-manifest <path-to-file>--application-manifest <path-to-file>Set manifest file
    --set-resource-string <key> <value>--set-resource-string <key> <value>Set resource string (key must be an integer ID)
    --get-resource-string <key>--get-resource-string <key>Get resource string (key must be an integer ID)
    --set-rcdata <key> <path-to-file>--set-rcdata <key> <path-to-file>Replace RCDATA by integer id

    Note: --set-requested-execution-level is ignored if --application-manifest is already set.

    rcedit <filename> [options...]