Giter Club home page Giter Club logo

rcedit's Introduction

rcedit

Continuous Integration

Command line tool to edit resources of exe file on Windows.

Executables

Prebuilt binaries can be found in the GitHub releases.

Building

To build you need CMake 3.15+ and Visual Studio 2015 or above.

  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

Show help:

$ rcedit -h

Set version string:

$ rcedit "path-to-exe-or-dll" --set-version-string "Comments" "This is an exe"

Use this option to change any supported properties, as described in the MSDN documentation here

Set file version:

$ rcedit "path-to-exe-or-dll" --set-file-version "10.7"

Set product version:

$ rcedit "path-to-exe-or-dll" --set-product-version "10.7"

Set icon:

$ rcedit "path-to-exe-or-dll" --set-icon "path-to-ico"

Set resource string:

$ rcedit "path-to-exe-or-dll" --set-resource-string id_number "new string value"

Set requested execution level (asInvoker | highestAvailable | requireAdministrator) in the manifest:

$ rcedit "path-to-exe-or-dll" --set-requested-execution-level "requireAdministrator"

Set application manifest:

$ rcedit "path-to-exe-or-dll" --application-manifest ./path/to/manifest/file

And you can change multiple things in one command:

$ rcedit "path-to-exe-or-dll" --set-icon "path-to-ico" --set-file-version "10.7"

Get version string:

$ rcedit "path-to-exe-or-dll" --get-version-string "property"

Use the same properties as --set-version-string. Use "FileVersion" to get the results of --set-file-version and "ProductVersion" to get the results of --get-product-version.

Get resource string:

$ rcedit "path-to-exe-or-dll" --get-resource-string id_number

rcedit's People

Contributors

actboy168 avatar aniskyworker avatar arnavb avatar barkingfoodog avatar ckerr avatar dependabot[bot] avatar develar avatar dmascord avatar dsanders11 avatar geertvanhorrik avatar kevinsawicki avatar lnsooxd avatar malept avatar raptdept avatar robi-wan avatar rversteegen avatar sam651 avatar skyline75489 avatar thmaterna avatar tilkinsc avatar treestec avatar zcbenz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rcedit's Issues

Fatal error: Unexpected trailing arguments

I tried changing the resource string from RCEDIT
rcedit --set-resource-string 65201 "This is a test"

It always says Unexpected trailing argument, also I tried same thing with .net exe and other machine language exe compiled through C++ or python, still the same thing. Also other functions like setting execution level is also not working. Can't figure out the solution.

Any Help or Suggestion ! THANKS IN ADVANCE

manifest always applied to resourcename [1]

As according to MS Manifest Tool, dll should be MAKEINTRESOURCEW(2) and only exe that use MAKEINTRESOURCEW(1)

rescle.cc :

    (ru.Get()
      , RT_MANIFEST
      , MAKEINTRESOURCEW(1)
      , 1033 // this is hardcoded at 1033, ie, en-us, as that is what RT_MANIFEST default uses
      , &stringSection.at(0), sizeof(char) * stringSection.size())) {

      return false;
    }

Rcedit command not found

here is what i did
cloned that repositories
ran that gyp command
did that rcedit command to change the icon and
here is what i get

"rcedit :command not found"

i didnt build the .sln file
what do i do

Add AppVeyor support

This repository needs CI, to ensure that it compiles correctly. A side effect would be that it can be set up to auto-deploy precompiled binaries in tagged releases.

(It also needs tests to make sure it changes an executable as intended, but perhaps that should be addressed in a separate issue.)

Changing anything on electron.exe breaks camera

The app uses navigator.mediaDevices.getUserMedia to the camera. The App is copied to the prebuilt files and working, as long as I change anything on the electron.exe file.
After that the internal camera can not be used anymore.
Any possible solution? Or at least an explanation?

"Unable to parse version string" is not a specific enough error for win32 targets

I had some problems using electron-packager reporting it was "unable to parse version string", and it took me a while to find the cause. I believe that "Unable to parse version string" is too vague of an error message.

This error message should be improved to tell me which property it was trying to parse and the value it received and tried to parse, such as:

Unable to parse version string for 'build-version': 'private'
or
The value provided for 'build-version' is not a valid version: 'private'

For reference, the values I use are:

{
    dir: ".artifacts/app",
    platform: "win32",
    arch: "ia32",
    out: ".artifacts/package",
    name: "MyApp",
    version: "1.3.1",
    "build-version": "private",
    "app-version": "0.8.7",
    icon: "icon",
    "app-bundle-id": "com.microsoft.MyApp",
    "helper-bundle-id": "com.microsoft.MyAppHelper",
    "version-string": {
        CompanyName: "MyCompany",
        LegalCopyright: "Copywrite (C) 2015 MyCompany. All rights reserved",
        ProductName: "My Application",
        FileDescription: "My Application",
        OriginalFilename: "MyApp.exe",
        InternalName: "MyApp"
    }
}

See also electron/packager#552

Set Language Info from CLI

By default, the language is set as English US.

For those of us that are outside of the US, is there a way to set the language from the CLI, assuming we know the language / sub_lang hex codes ?

Currently, the locale code is hardcoded in rcedit.rc

BLOCK "VarFileInfo"
BEGIN
    VALUE "Translation", 0x409, 1200
END

Where 0x0409 == 1033 == en_us and 1200 == 1.2.0.0 version.

SetVersionString() is only exposing the1200 part (i.e. the version) in main.cc, but there is the an extended version of the function SetVersionString() in rescle.cc.

Please allow us to pass locale codes from CLI (in hex or decimal or en_au format doesn't matter).

If there is already a way to do this, please explain. Thanks !

Page fault

Running rcedit on Ubuntu 12.04.5 LTS server with wine-1.4 causes page fault.

asar version: v0.11.0

/usr/lib/node_modules/electron-packager/node_modules/rcedit/bin/rcedit.exe
Application tried to create a window, but no driver could be loaded.
Make sure that your X server is running and that $DISPLAY is set correctly.
err:systray:initialize_systray Could not create tray window
fixme:advapi:EventRegister {5eec90ab-c022-44b2-a5dd-fd716a222a15}, 0x404aa7, 0x486060, 0x486078
wine: Unhandled page fault on read access to 0x00000000 at address 0x7b849941 (thread 0009), starting debugger...
Application tried to create a window, but no driver could be loaded.
Make sure that your X server is running and that $DISPLAY is set correctly.
Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x7b849941).
Register dump:
 CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b
 EIP:7b849941 ESP:0032f078 EBP:0032f0f0 EFLAGS:00010246(  R- --  I  Z- -P- )
 EAX:00000000 EBX:7b894ff4 ECX:00000080 EDX:0032f21c
 ESI:00000000 EDI:0032f11c
Stack dump:
0x0032f078:  00110014 0032f0cc 7bc46923 000fc6c0
0x0032f088:  656c6966 20726f20 65726964 726f7463
0x0032f098:  f7480079 00000040 00000050 00000064
0x0032f0a8:  00110000 7bca6ff4 0032f21c 00000050
0x0032f0b8:  00000006 001239a2 7bca6ff4 00110000
0x0032f0c8:  7bca6ff4 0032f12c 7bc472f3 c2bb5000
Backtrace:
=>0 0x7b849941 in kernel32 (+0x39941) (0x0032f0f0)
  1 0x7b84ab01 LocaleNameToLCID+0x40() in kernel32 (0x0032f350)
  2 0x00453004 in rcedit (+0x53003) (0x0032f368)
  3 0x00452f8a in rcedit (+0x52f89) (0x0032f394)
  4 0x00464430 in rcedit (+0x6442f) (0x0032f5e8)
  5 0x00464603 in rcedit (+0x64602) (0x0032f624)
  6 0x0045ba6d in rcedit (+0x5ba6c) (0x0032fd98)
  7 0x0045c01d in rcedit (+0x5c01c) (0x0032fdd0)
  8 0x0045bc0c in rcedit (+0x5bc0b) (0x0032fdf8)
  9 0x0045bcfd in rcedit (+0x5bcfc) (0x0032fe1c)
  10 0x0044d729 in rcedit (+0x4d728) (0x0032fe30)
  11 0x00415dbc in rcedit (+0x15dbb) (0x0032fe70)
  12 0x7b859cdc call_process_entry+0xb() in kernel32 (0x0032fe88)
  13 0x7b85af4f in kernel32 (+0x4af4e) (0x0032fec8)
  14 0x7bc71db0 call_thread_func_wrapper+0xb() in ntdll (0x0032fed8)
  15 0x7bc7486d call_thread_func+0x7c() in ntdll (0x0032ffa8)
  16 0x7bc71d8e RtlRaiseException+0x21() in ntdll (0x0032ffc8)
  17 0x7bc49f4e call_dll_entry_point+0x61d() in ntdll (0x0032ffe8)
0x7b849941: movzwl  0x0(%esi),%eax
Modules:
Module  Address         Debug info  Name (34 modules)
PE    400000-  492000   Export          rcedit
ELF 7b800000-7ba15000   Dwarf           kernel32<elf>
  \-PE  7b810000-7ba15000   \               kernel32
ELF 7bc00000-7bcc3000   Dwarf           ntdll<elf>
  \-PE  7bc10000-7bcc3000   \               ntdll
ELF 7bf00000-7bf04000   Deferred        <wine-loader>
ELF 7e80c000-7e813000   Deferred        libxdmcp.so.6
ELF 7e813000-7e817000   Deferred        libxau.so.6
ELF 7e817000-7e838000   Deferred        libxcb.so.1
ELF 7e858000-7e98c000   Deferred        libx11.so.6
ELF 7e98c000-7e99e000   Deferred        libxext.so.6
ELF 7ea3a000-7ea50000   Deferred        libz.so.1
ELF 7ea50000-7eaeb000   Deferred        libfreetype.so.6
ELF 7eaeb000-7eb0a000   Deferred        libtinfo.so.5
ELF 7eb0a000-7eb2c000   Deferred        libncurses.so.5
ELF 7eb2c000-7eb45000   Deferred        version<elf>
  \-PE  7eb30000-7eb45000   \               version
ELF 7eb45000-7eba5000   Deferred        advapi32<elf>
  \-PE  7eb50000-7eba5000   \               advapi32
ELF 7eba5000-7ec62000   Deferred        gdi32<elf>
  \-PE  7ebb0000-7ec62000   \               gdi32
ELF 7ec62000-7eda2000   Deferred        user32<elf>
  \-PE  7ec70000-7eda2000   \               user32
ELF 7efa2000-7efae000   Deferred        libnss_files.so.2
ELF 7efae000-7efba000   Deferred        libnss_nis.so.2
ELF 7efba000-7efd4000   Deferred        libnsl.so.1
ELF 7efd4000-7f000000   Deferred        libm.so.6
ELF f7402000-f740b000   Deferred        libnss_compat.so.2
ELF f740c000-f7411000   Deferred        libdl.so.2
ELF f7411000-f75ba000   Deferred        libc.so.6
ELF f75bb000-f75d6000   Deferred        libpthread.so.0
ELF f75e4000-f7726000   Dwarf           libwine.so.1
ELF f7728000-f774a000   Deferred        ld-linux.so.2
ELF f774a000-f774b000   Deferred        [vdso].so
Threads:
process  tid      prio (all id:s are in hex)
00000008 (D) Z:\usr\lib\node_modules\electron-packager\node_modules\rcedit\bin\rcedit.exe
    00000009    0 <==
0000000c winemenubuilder.exe
    0000000d    0
0000000e services.exe
    0000001f    0
    0000001e    0
    0000001d    0
    00000017    0
    00000015    0
    00000010    0
    0000000f    0
00000012 winedevice.exe
    0000001b    0
    00000018    0
    00000014    0
    00000013    0
00000019 plugplay.exe
    00000020    0
    0000001c    0
    0000001a    0
00000021 explorer.exe
    00000022    0

Old icon remains in .NET binaries after SetIcon

If you view a .NET binary in ResourceHacker after calling --set-icon, you'll see that the old icons are still in the binary while the new ones sit in a separate icon bundle. If the old icon bundle has more icons than the new one, some of the old icons won't be overridden.

How to run on centos with wine?

I run rcedit.exe with wine64 on centos7,
but there are some error messages:

ixme:service:scmdatabase_autostart_services Auto-start service L"MountMgr" failed to start: 2
wine: Bad EXE format for Z:\home\gitlab-runner\builds\07620694\0\web\admin\node_modules\rcedit\bin\rcedit.exe.
[root@localhost admin]# err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder
err:wincodecs:PngEncoder_CreateInstance Trying to save PNG picture, but PNG support is not compiled in.
fixme:ole:CoCreateInstanceEx no instance created for interface {00000103-a8f2-4877-ba0a-fd2b6645fb94} of class {27949969-876a-41d7-9447-568f6a35a4dc}, hres is 0x80004005
err:menubuilder:convert_to_native_icon error 0x80004005 creating bitmap encoder

what should I do?

'Unable to set icon'

Using the current rcedit artifact leads to the above mentioned error: 'Unable to set icon'.

The error was introduced in commit af37f5f.
(I verified this with artifacts from https://ci.appveyor.com/project/electron-bot/rcedit/build/1.0.23/job/bc57s50clgkbab7x/artifacts and https://ci.appveyor.com/project/electron-bot/rcedit/build/1.0.22/job/brndccen9f9ovdc2/artifacts. The artifact from the previous commit - d65120c - worked.)

The changes to the function SetIcon may have caused this.

Here is the test output from https://github.com/electron/node-rcedit with the artifact from https://ci.appveyor.com/project/electron-bot/rcedit/build/1.0.23/job/bc57s50clgkbab7x/artifacts:

>npm run test

> [email protected] test c:\development\work\rcedit\node-rcedit
> mocha test/*.js && npm run lint



  rcedit(exePath, options, callback)
    1) updates the information in the executable
    √ supports non-ASCII characters in the .exe path (703ms)
    2) supports a product version of 1
    3) supports a product version of 1.0
    √ supports setting requestedExecutionLevel to requireAdministrator (3250ms)
    √ supports replacing the manifest with a specified manifest file (3125ms)
    √ reports an error when the .exe path does not exist
    √ reports an error when the icon path does not exist
    √ reports an error when the file version is invalid (47ms)
    √ reports an error when the product version is invalid


  7 passing (26s)
  3 failing

  1) rcedit(exePath, options, callback) updates the information in the executable:
     Error: rcedit.exe failed with exit code 1. Fatal error: Unable to set icon
      at ChildProcess.<anonymous> (lib\rcedit.js:68:16)
      at maybeClose (internal/child_process.js:862:16)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:222:5)

  2) rcedit(exePath, options, callback) supports a product version of 1:
     Uncaught TypeError: Cannot read property 'trim' of undefined
      at node_modules\rcinfo\lib\index.js:32:27
      at Array.forEach (native)
      at node_modules\rcinfo\lib\index.js:27:15
      at ChildProcess.exithandler (child_process.js:207:5)
      at maybeClose (internal/child_process.js:862:16)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:222:5)

  3) rcedit(exePath, options, callback) supports a product version of 1.0:
     Uncaught TypeError: Cannot read property 'trim' of undefined
      at node_modules\rcinfo\lib\index.js:32:27
      at Array.forEach (native)
      at node_modules\rcinfo\lib\index.js:27:15
      at ChildProcess.exithandler (child_process.js:207:5)
      at maybeClose (internal/child_process.js:862:16)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:222:5)




npm ERR! Windows_NT 5.2.3790
npm ERR! argv "C:\\development\\tools\\nodejs\\node.exe" "C:\\development\\tools\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run
" "test"
npm ERR! node v4.8.4
npm ERR! npm  v2.15.11
npm ERR! code ELIFECYCLE
npm ERR! [email protected] test: `mocha test/*.js && npm run lint`
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the [email protected] test script 'mocha test/*.js && npm run lint'.
npm ERR! This is most likely a problem with the rcedit package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     mocha test/*.js && npm run lint
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs rcedit
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls rcedit
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     c:\development\work\rcedit\node-rcedit\npm-debug.log

This output is from running the node-rcedit tests with a current artifact:

>npm run test

> [email protected] test c:\development\work\rcedit\node-rcedit
> mocha test/*.js && npm run lint



  rcedit(exePath, options, callback)
    1) updates the information in the executable
    √ supports non-ASCII characters in the .exe path (454ms)
    √ supports a product version of 1 (578ms)
    √ supports a product version of 1.0 (532ms)
    √ supports setting requestedExecutionLevel to requireAdministrator (2969ms)
    √ supports replacing the manifest with a specified manifest file (3016ms)
    √ reports an error when the .exe path does not exist
    √ reports an error when the icon path does not exist
    √ reports an error when the file version is invalid
    √ reports an error when the product version is invalid (62ms)


  9 passing (25s)
  1 failing

  1) rcedit(exePath, options, callback) updates the information in the executable:
     Error: rcedit.exe failed with exit code 1. Fatal error: Unable to set icon
      at ChildProcess.<anonymous> (lib\rcedit.js:68:16)
      at maybeClose (internal/child_process.js:862:16)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:222:5)




npm ERR! Windows_NT 5.2.3790
npm ERR! argv "C:\\development\\tools\\nodejs\\node.exe" "C:\\development\\tools\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run
" "test"
npm ERR! node v4.8.4
npm ERR! npm  v2.15.11
npm ERR! code ELIFECYCLE
npm ERR! [email protected] test: `mocha test/*.js && npm run lint`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test script 'mocha test/*.js && npm run lint'.
npm ERR! This is most likely a problem with the rcedit package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     mocha test/*.js && npm run lint
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs rcedit
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls rcedit
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     c:\development\work\rcedit\node-rcedit\npm-debug.log

Wrong version number?

When I do

rcedit the.exe --set-file-version "1.2.6075.6043" --set-product-version "1.2.6075.6043"

I get these sub numbers that are wrong:

FILEVERSION     1,2,187,155
PRODUCTVERSION  1,2,187,155

This is a .Net executable.
Is there a fix? Maybe the version numbers are too high?

PE checksum not updated

After successful operation I think rcedit should update the PE checksum, because some nitpick machine learning antivirus often flag it as malicious/unsafe because they think the executable being "tampered".

Release new version

The current executable is over two years out of date. Can there be a version bump along with a new binary release? Thanks.

--set-version-string and --set-product-version doesn't work on Firefox's exe

When I try to modify Firefox's exe with rcedit, I found that --set-version-string and --set-product-version doesn't work: instead of modifying version strings or production version, rcedit remove them (right click -> property shows empty fields for the modified exe).

Example command: rcedit.exe "updater.exe" --set-version-string "Comments" "This is an exe".

I installed rcedit.exe via npm install rcedit, and downloaded Firefox binary here: http://archive.mozilla.org/pub/firefox/releases/45.0/win32/en-US/sdk/firefox-45.0.sdk.zip

rcedit for x64: Unable to change version string

When I build rcedit-win64, I use it change Exe file version string,
It's report: Unable to change version string

But rcedit-x86 success.

Reson:

auto keySize = (wcslen(entry->szKey) + 1) * sizeof(WCHAR);

auto keySize = (wcslen(entry->szKey) + 1) * sizeof(WCHAR);

Visual Studio Report: Access violation reading location

Appveyor configuration problem?

The console output shows:

Uploading artifacts...
[1/1] Default\rcedit-x64.exe (1,297,920 bytes)...100%
"GitHub" deployment has been skipped as environment variable has not matched ("appveyor_repo_tag" is "false", should be "true")

Is this a warning that should be fixed?

"Unable to load file" with a relative path

A simple directory structure

root
+-- a
¦   +-- rcedit.exe
+-- b
¦   +-- foo.exe

Now with CWD = root, the command fails

a\rcedit.exe b\foo.exe
Fatal error: Unable to load file
# exit status = 1

But if CWD = root\a, the command success

rcedit.exe ..\b\foo.exe
# exit status = 0

rcedit version = v0.1.0

Another build

I have a few questions

  1. When will another release be made?
  2. I do not use Visual Studio (I use SharpDevelop) and I would like a build of the current sources.

Is this possible?

Unable to set icon on an exe which doesn't have an icon currently set

Hi there,

I can't seem to be able to change the icon on an exe that is using the Windows default exe icon.

To repro the issue:

  1. Open the rcedit solution file
  2. Go to Project Properties->C/C++->Code Generation->Runtime Library and change it to "Multi threaded Debug /Mtd"
  3. Build from source
  4. Set debugging arguments to:

C:\some_path_to_exe\testexe.exe --set-icon "C:\some_path_to_icon\icon.ico"

Note how you get:

Debug Assertion Failed!

Program: C:\Users\gbfieldst\Downloads\rcedit-master\Default\rcedit.exe
File: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xtree
Line: 238

Expression: map/set iterator not dereferencable

Callstack:

rcedit.exe!std::_Debug_message(const wchar_t * message, const wchar_t * file, unsigned int line) Line 17 C++
rcedit.exe!std::_Tree_const_iterator<std::_Tree_val<std::_Tree_simple_types<std::pair<unsigned short const ,rescle::ResourceUpdater::IconResInfo> > > >::operator*() Line 239 C++
[Inline Frame] rcedit.exe!std::_Tree_iterator<std::_Tree_val<std::_Tree_simple_types<std::pair<unsigned short const ,rescle::ResourceUpdater::IconResInfo> > > >::operator*() C++
[Inline Frame] rcedit.exe!std::_Tree_iterator<std::_Tree_val<std::_Tree_simple_types<std::pair<unsigned short const ,rescle::ResourceUpdater::IconResInfo> > > >::operator->() C++
rcedit.exe!rescle::ResourceUpdater::SetIcon(const wchar_t * path) Line 640 C++
rcedit.exe!wmain(int argc, const wchar_t * * argv) Line 83 C++

This is because ResourceUpdater::SetIcon(const WCHAR* path) does:

auto& langId = iconBundleMap.begin()->first;

but the map is empty!

The executable I used is attached. It's 01_vertex_program.exe from the NVIDIA Cg toolkit install.
01_vertex_program.zip

Any ideas how this might be fixed?

Regards,
Tom

One test of node-rcedit 0.9.0 fails with rcedit 1.0.0 because of changed error message

Running the test of github.com/electron/node-rcedit v0.9.0 with rcedit.exe v1.0.0 produces this result:

c:\development\work\rcedit\node-rcedit>npm run test

> [email protected] test c:\development\work\rcedit\node-rcedit
> mocha test/*.js && npm run lint



  rcedit(exePath, options, callback)
    v updates the information in the executable (937ms)
    v supports non-ASCII characters in the .exe path (859ms)
    v supports a product version of 1 (890ms)
    v supports a product version of 1.0 (1094ms)
    v supports setting requestedExecutionLevel to requireAdministrator (4984ms)
    v supports replacing the manifest with a specified manifest file (4766ms)
    1) reports an error when the .exe path does not exist
    v reports an error when the icon path does not exist
    v reports an error when the file version is invalid
    v reports an error when the product version is invalid


  9 passing (38s)
  1 failing

  1) rcedit(exePath, options, callback) reports an error when the .exe path does not exist:

      Uncaught AssertionError: -1 != -1
      + expected - actual


      at test\rcedit-test.js:156:14
      at ChildProcess.<anonymous> (lib\rcedit.js:68:7)
      at maybeClose (internal/child_process.js:862:16)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:222:5)

The test fails because the error message of rcedit was changed.
Prior this change the error message was something like rcedit.exe failed with exit code 1. Fatal error: Unable to load file.
After the change the error message reads rcedit.exe failed with exit code 1. Unable to load file: "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\node-rcedit-11795-6132-1wa6nwa\does-n ot-exist.exe"

The failing test expects this error message/output: 'Fatal error: Unable to load file'
(After the change the part Fatal error: is missing and thus the test fails.)

Solution 1:
Tweak the output of rcedit:

diff --git a/src/main.cc b/src/main.cc
index 7944303..58bb498 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -155,13 +155,13 @@ int wmain(int argc, const wchar_t* argv[]) {

     } else {
       if (loaded) {
-        fprintf(stderr, "Unrecognized argument: \"%ls\"\n", argv[i]);
+        fprintf(stderr, "Fatal error: Unrecognized argument: \"%ls\"\n", argv[i]);
         return 1;
       }

       loaded = true;
       if (!updater.Load(argv[i])) {
-        fprintf(stderr, "Unable to load file: \"%ls\"\n", argv[i]);
+        fprintf(stderr, "Fatal error: Unable to load file: \"%ls\"\n", argv[i]);
         return 1;
       }

Solution 2:
Adapt the node-rcedit test for the new error message/output (when updating the rcedit artifact in the node-rcedit repository).

diff --git a/test/rcedit-test.js b/test/rcedit-test.js
index 9af20fd..7c0b876 100644
--- a/test/rcedit-test.js
+++ b/test/rcedit-test.js
@@ -153,7 +153,7 @@ describe('rcedit(exePath, options, callback)', function () {
     rcedit(path.join(tempPath, 'does-not-exist.exe'), {'file-version': '3.4.5.6'}, function (error) {
       assert.ok(error instanceof Error)
       assert.notEqual(error.message.indexOf('rcedit.exe failed with exit code 1.'), -1)
-      assert.notEqual(error.message.indexOf('Fatal error: Unable to load file'), -1)
+      assert.notEqual(error.message.indexOf('Unable to load file: '), -1)

       done()
     })

ScopedResourceUpdater::EndUpdate and ResourceUpdater::GetResourcePointer don't expose the error

I was getting a pretty generic failure message from rcedit, and I had no error object to look into further. Looking at the code, there's two places in rescle.cc that call GetLastError, but don't expose or throw the error.

ScopedResourceUpdater::EndUpdate:

bool ScopedResourceUpdater::EndUpdate(const bool& doesCommit) {
  BOOL fDiscard = doesCommit ? FALSE : TRUE;
  BOOL bResult = EndUpdateResourceW(handle, fDiscard);
  DWORD e = GetLastError();
  return bResult ? true : false;
}

ResourceUpdater::GetResourcePointer

...
  HRSRC hRsrc = FindResourceExW(hModule, type, MAKEINTRESOURCEW(id), languageId);
  if (hRsrc == NULL) {
    DWORD e = GetLastError();
    return false;
  }
...

I wasn't sure if there might be reason we shouldn't just throw the error in these cases.

Unhandled Exception in rescle.cc:"CALLBACK ResourceUpdater::OnEnumResourceManifest"

Hi

The problem is observable when executing in debug. prior to application exit a "std::out_of_range" exception is thrown. The error source is in rescle.cc line 908. The behavior of "size_t start = manifestStringLocal.find(L"<?xml");" is poor at fault. Documentation for "std::string.find" states that if the search string is not found the return value is "basic_string::npos" == "-1". Unfortunately the return value of ::find" is type "unsigned int" and so the test "if (start < 0)" fails, passing an out of range start value to "manifestStringLocal = manifestStringLocal.substr(start);".

//if (start > 0) {
if ((start > 0) && (start < manifestStringLocal.size())) {

fixes the problem.

Regards

Chris LaRocque

FR: Add option to apply the ressource changes to multiple files

Currently only one file may be changed per invocation, if you want to change multiple files you need to call rcedit multiple times.

Ideally we could use some wildcards, something like

rcedit -f "%USERPROFILE%\dev\project\bin\abc*.dll" --set-icon "path-to-ico" --set-file-version "10.7"

Maybe allowing multiple --file parameters, too

rcedit -f "%USERPROFILE%\dev\project\bin\abc*.dll" -f "%USERPROFILE%\dev\project\bin\D??5000.dll" --set-icon "path-to-ico" --set-file-version "10.7"

Add binary resource from file

Add binary files.

It would be helpful if you could add binary files to the resources. So you could, for example Insert CAB or ZIP files into the resources.

Change other fields like "CompanyName"

Hi,

Rcedit works very well for me but is it possible to change the other fields in a executable like the CompanyName, the FileDescription or ProductName ?

RcEdit destroys application without relocation table

One of the future in EurekaLog is to reduce file size by removing relocation table.
When I set resources in such file RcEdit destroys application file.

In attachment I prepared simple application orginal with removed relocation table and one with resources applied via RcEdit (rcedit.exe EurekaLogRcEditTest.exe --set-version-string Test Test)

EurekaLogRcEditTest.zip

"Unable to load file" when the exe in a Chinese name :(

2016-05-19 6 38 35

as the screenshot said:

i tried to edit a electron-built exe by rcedit, but i get "Unable to load file" if the filename is in Chinese.

and then i rename the exe to ep.exe, rcedit stop complaining.

any idea?

thanks in advanced.

Port to linux ?

Hi !
Is there a way to port this to linux ? I see it depends on windows.h, but perhaps there would be a way to use rcedit on linux without any windows dependencies ?

I'd like to set an icon to an exe file, usually I go with ResHacker and Wine. I'd like to use rcedit instead. I think I must use Wine on linux, but if there was another way or if rcedit could be portable, please let me know.

File version and product version fields are erroneously truncated to 8 bits

The file version and product version fields in a PE executable are 64-bit values, each consisting of four 16-bit unsigned values.

rcedit erroneously truncates these 16-bit values to 8 bits when the --set-file-version or --set-product-version switches are used. For example, a version number 12345.6789.9876.5432 is changed to 57.133.148.56.

This is the root cause of Squirrel issue 545 and any similar issues in other products that use rcedit.

PR on its way in a moment...

Bitdefender is says that rcedit.exe is a virus

The message I get from Bitdefender is "Hyper Detect has detected a threat. There was no action taken on the file. ...\AppData\Roaming\npm\node_modules\electron-packager\node_modules\rcedit\bin\rcedit.exe is malware of type Gen:Illusion.ML.Miata.C.2.17.3010101. To take an action on the threat, please contact your system administrator.

Any clue as to why this is registering as such? I'm not particularly trusting Bitdefender's finding, however this is software my company just recently installed and now I'm encountering this issue.

Also another source:
https://www.isthisfilesafe.com/sha1/7B566345D20980E117127013A4990251052EEB46_details.aspx

When using rcedit on 7-Zip created archive, file gets corrupted

I am trying to change the resources of an sfx exe archive created with 7-Zip. When I do so however, the content of the archive is replaced with the files for the resources. Yes I said replaced. If I do this with a large archive, the file size of the file is reduced dramatically. See below for details.

  1. With 7-Zip installed, create an sfx archive with the GUI or the following command.
    "C:\Program Files\7-Zip\7z.exe" a -sfx7z.sfx "<path of archive to create ending in .exe>" "<path of file or folder to archive>"
  2. Use the 7-Zip GUI to open the archive and view its contents which should be as expected. Then close the GUI.
  3. Run the following command.
    rcedit-x64.exe "<path of archive>" --set-version-string "LegalCopyright" "Copyright (c) 2017 <name>"
  4. Again use the 7-Zip GUI to open the archive. Where is the original file or folder that was archived?

Expose ChangeString functionality

Handy little tool. I added in a bit of code to expose the ChangeString function, to make it a little more versatile. I'll set up a pull request if that's ok.

[FYI] Compile errors in Visual Studio 2012

I wanted to compile the sources in Visual Studio 2012 and got these compile errors:
compile_error_vs2012

Error	1	error C2864: 'rescle::ResourceUpdater::IconResInfo::MaxIconId' : only static const integral data members can be initialized within a class	c:\dev\work\rcedit_vs2012\src\rescle.h	112	1	rcedit
Error	2	error C2864: 'rescle::ResourceUpdater::IconResInfo::MaxIconId' : only static const integral data members can be initialized within a class	c:\dev\work\rcedit_vs2012\src\rescle.h	112	1	rcedit
Error	3	error C2065: 'LOAD_LIBRARY_SEARCH_SYSTEM32' : undeclared identifier	C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include\atlcore.h	632	1	rcedit
Error	4	error C2864: 'rescle::`anonymous-namespace'::VersionStampValue::wLength' : only static const integral data members can be initialized within a class	C:\dev\work\rcedit_vs2012\src\rescle.cc	94	1	rcedit
Error	5	error C2864: 'rescle::`anonymous-namespace'::VersionStampValue::wValueLength' : only static const integral data members can be initialized within a class	C:\dev\work\rcedit_vs2012\src\rescle.cc	95	1	rcedit
Error	6	error C2864: 'rescle::`anonymous-namespace'::VersionStampValue::wType' : only static const integral data members can be initialized within a class	C:\dev\work\rcedit_vs2012\src\rescle.cc	96	1	rcedit
Error	7	error C2039: 'make_unique' : is not a member of 'std'	C:\dev\work\rcedit_vs2012\src\rescle.cc	583	1	rcedit
Error	8	error C2065: 'make_unique' : undeclared identifier	C:\dev\work\rcedit_vs2012\src\rescle.cc	583	1	rcedit
Error	9	error C2275: 'rescle::IconsValue' : illegal use of this type as an expression	C:\dev\work\rcedit_vs2012\src\rescle.cc	583	1	rcedit
Error	10	error C2059: syntax error : ')'	C:\dev\work\rcedit_vs2012\src\rescle.cc	583	1	rcedit

The error only static const integral data members can be initialized within a class seems to be caused by the limited C++11 support of Visual Studio 2012.

Maybe update the READEM with a note/hint for the minimal required Visual Studio version ( => 2013).

(The project compiles in all newer Visual Studio versions - 2013, 2015 and 2017.)

Version String Parsing Suggestion

Just some back story to give context to this issue: I've been studying Electron the past few weeks, and I finally decided to package my app. I use electron-packager to build the executable until I stumbled upon an error from rcedit.exe. Apparently, it was Unable to parse version string. It took me a while to realize that the fault was in the version key of my app's package.json, which resolved to v0.2.3-pre-alpha.

The current algorithm for parsing version strings fails to recognize semver-compliant version strings that begin with v. So to fix my problem, I had to change my version to 0.2.3-pre-alpha, and the app was successfully built.

Is there any reason behind disregarding the v in the beginning of version strings?

rcedit/src/main.cc

Lines 39 to 45 in 452c0c3

bool parse_version_string(const wchar_t* str, unsigned short *v1, unsigned short *v2, unsigned short *v3, unsigned short *v4) {
*v1 = *v2 = *v3 = *v4 = 0;
return (swscanf_s(str, L"%hu.%hu.%hu.%hu", v1, v2, v3, v4) == 4) ||
(swscanf_s(str, L"%hu.%hu.%hu", v1, v2, v3) == 3) ||
(swscanf_s(str, L"%hu.%hu", v1, v2) == 2) ||
(swscanf_s(str, L"%hu", v1) == 1);
}

doesn't work on fresh install of windows 10

I don't know if this will really help, but I couldn't get to make rcedit work on a fresh install of windows 10 (in parallel desktop)

  • first I had messages that MSVCP100.dll is missing, and MSVCR100.dll is missing as well. I found them somewhere else in the windows folder, copied them to SYSWOW64 folder;
  • the next error was a The application was unable to start correctly (0xc000007b)

I have installed all the c++ and whatnot windows SDK I could find... without success

I gave up at this stage because at this point most of the day had gone, and I switched to resourcehacker. It's less elegant solution but does the job.

Unable to change CopyRight and Original File Name.

Hi,

We are unable to edit the resources like copyright and Original file Name information .

In associated vc project i can see the concerned macro #define RU_VS_ORIGINAL_FILENAME L"OriginalFilename".

Do you have plan to update the rcedit to support other properties as well.

Regards,
Shivani Pahuja

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.