JavaPackager icon indicating copy to clipboard operation
JavaPackager copied to clipboard

Garbled code

Open lhDream opened this issue 3 years ago • 19 comments

When ${project. Description} is in Chinese, the process displays garbled code

- JavaPackager version: 1.6.6
- OS version: windows Server 2019 Datacenter 1809
- JDK version: 1.8
- Build tool: Maven 3.8

image

lhDream avatar May 25 '22 03:05 lhDream

Hi @lhDream! Please, have a look at this related issue.

fvarrui avatar May 27 '22 15:05 fvarrui

Hi @lhDream! Did you manage to fix this issue? JavaPackager is using rcedit-x64.exe command line tool to customize WinRun4j and Why launchers (EXE files) ... maybe you can try it with the EXE generated by Launch4j.

fvarrui avatar Jun 08 '22 22:06 fvarrui

Hi @fvarrui I tried to use launch4j, but it was also garbled code.

lhDream avatar Jun 09 '22 07:06 lhDream

I mean use rcedit-x64.exe command tool by your own to modify the description of the EXE generated with Launch4j

fvarrui avatar Jun 09 '22 08:06 fvarrui

@fvarrui rcedit-x64.exe does modify the EXE file description, but it cannot be executed.

lhDream avatar Jun 09 '22 09:06 lhDream

Could you give a try to Resource Hacker? It also can be used as a command line tool, and if it works fine, maybe you can automate the "set-exe-description" process calling it from Maven.

I'm sorry I can't help you much more

fvarrui avatar Jun 09 '22 09:06 fvarrui

I'll try

lhDream avatar Jun 09 '22 09:06 lhDream

The Resource Hacker GUI can use

lhDream avatar Jun 09 '22 10:06 lhDream

Hi @fvarrui If the project path contains CJK, the project will fail to package. Example:

D:/test/测试/testProject

lhDream avatar Jun 10 '22 08:06 lhDream

Hi @lhDream! sorry for my late reply! I'll do some research about this, but I'm not really sure if I can reproduce your issue on my Spanish Windows.

fvarrui avatar Jun 16 '22 12:06 fvarrui

hi @fvarrui It doesn't matter. It's not a big problem. If you can't reproduce it, you can try the virtual machine.

lhDream avatar Jun 23 '22 08:06 lhDream

Let's keep this issue opened until we can find a solution. Thanks!

hi @fvarrui It doesn't matter. It's not a big problem. If you can't reproduce it, you can try the virtual machine.

fvarrui avatar Jun 23 '22 12:06 fvarrui

The Resource Hacker GUI can use

Did you manage to automate the "set description" process using Resource Hacker?

fvarrui avatar Jun 23 '22 12:06 fvarrui

hi @fvarrui Tried, but failed. Maybe I used it the wrong way

lhDream avatar Jun 30 '22 01:06 lhDream

Hi @lhDream! I'll give it a try and tell you something ASAP.

fvarrui avatar Jul 11 '22 12:07 fvarrui

Hi @fvarrui Thanks.

lhDream avatar Jul 18 '22 07:07 lhDream

Hi @fvarrui !

ResourceHacker.exe version V5.1.8

demo.rc

1 VERSIONINFO
FILEVERSION 3,1,4,1592
PRODUCTVERSION 2,7,1,8
FILEOS 0x4
FILETYPE 0x1
{
BLOCK "StringFileInfo"
{
    BLOCK "040904E4"
    {
        VALUE "CompanyName", "测试0\0"
        VALUE "FileDescription", "测试1\0"
        VALUE "FileVersion", "测试2\0"
        VALUE "ProductName", "测试3\0"
        VALUE "InternalName", "测试4\0"
        VALUE "LegalCopyright", "测试5\0"
        VALUE "OriginalFilename", "测试6\0"
        VALUE "ProductVersion", "测试7\0"
    }
}

BLOCK "VarFileInfo"
{
    VALUE "Translation", 0x0409 0x04E4  
}
}

ResourceHacker.exe -open demo.rc -save demo.res -action compile

ResourceHacker.exe -open demo.exe -save newDemo.exe -action addoverwrite -resource demo.res

image image

lhDream avatar Aug 16 '22 10:08 lhDream

Hi @lhDream! So, is ResourceHacker command line tool working as expected?

fvarrui avatar Sep 03 '22 09:09 fvarrui

Hi @fvarrui ! Yes!

lhDream avatar Sep 03 '22 12:09 lhDream

JavaPackager 1.7.0 released to Maven Central

fvarrui avatar Feb 08 '23 02:02 fvarrui