Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[issue]: ventoy.json not working, always says "syntax error" no matter what I write #1125

Closed
1 task done
MrQuasar173 opened this issue Oct 7, 2021 · 20 comments
Closed
1 task done

Comments

@MrQuasar173
Copy link

Official FAQ

  • I have checked the official FAQ.

Ventoy Version

1.0.53

What about latest release

Yes. I have tried the latest release, but the bug still exist.

BIOS Mode

Both

Partition Style

MBR

Disk Capacity

256GB

Disk Manufacturer

SanDisk

Image file checksum (if applicable)

No response

Image file download link (if applicable)

No response

What happened?

note: I don't know whether this is on MBR or GPT so I said MBR

When I boot into ventoy, it says there is a syntax error in ventoy.json. I have tried copying and pasting examples directly from ventoy.net , and using IDE's to look for errors and fix them, but it still doesn't work. When I press enter ventoy launches with default settings. I have tried both BIOS and UEFI modes.

@MrQuasar173
Copy link
Author

update: I copied json file into jsonparseronline and it had no errors

@steve6375
Copy link

Sorry, but I cannot see the file from here and I don't have my crystal ball. Maybe you could attach the file to your post?

@ventoy
Copy link
Owner

ventoy commented Oct 8, 2021

@MrQuasar173
Please attach ventoy.json for check.

@MrQuasar173
Copy link
Author

It won't allow me to attach a JSON file. Here is is copied and pasted

{
    "password": {
        "bootpwd": "test"
    },
    "theme_legacy":{
        "file":"/ventoy/themes/Vimix/theme.txt",
        "gfxmode":"1024x768"
    },
    "theme_uefi":{
        "file":"/ventoy/themes/Vimix/theme.txt",
        "gfxmode":"1366x768"
    }
}

@ventoy
Copy link
Owner

ventoy commented Oct 9, 2021

I test this and it does not report syntax error.
You can change the suffix or compress it and attach the file (e.g. ventoy.json.txt/ventoy.json.zip)

@MrQuasar173
Copy link
Author

Ventoy_json.zip
Sorry for late response here you go

@ventoy
Copy link
Owner

ventoy commented Oct 12, 2021

The ventoy.json you attach is different from what you pasted before and has too many syntax errors:

{
    "theme_legacy": [
	{
        "file": "/ventoy/themes/Ventoy-Dark/theme.txt",
        "gfxmode": "1024x768"       
		},
    "theme_uefi": {
        "file": "/ventoy/themes/Ventoy-Dark/theme.txt",
        "gfxmode": "1366x768"
		},
    "theme_ia32": {
        "file": "/ventoy/themes/Ventoy-Dark/theme.txt",
        "gfxmode": "1366x768"
		},
    "theme_aa64": {
        "file": "/ventoy/themes/Ventoy-Dark/theme.txt",
        "gfxmode": "1366x768"
		},
    "theme_mips": {
        "file": "/ventoy/themes/Ventoy-Dark/theme.txt",
        "gfxmode": "1366x768"
		}
	],
	
	"injection": [
        {
            "image": "04._Windows_XP_Professional_SP3_32bit.iso",
            "archive": "ventoy/drivers/DPMS_XP/DPMS.7z"
			},
		{
            "image": "07._Windows_8.1_Update_1_32bit.iso",
            "archive": "ventoy/drivers/EI/ei.zip"
			},
		{
            "image": "08._Windows_8.1_Update_1_64bit.iso",
            "archive": "ventoy/drivers/EI/ei.zip"
			}
    ],
	
	    "auto_install": [
        {
            "image": "08._Windows_8.1_Update_1_64bit.iso",
            "template": [
                "/ventoy/unattended/unattended_w81_64bit.xml",
            ]
        },
		{
		    "image": "08._Windows_8.1_Update_1_32bit.iso",
            "template": [
                "/ventoy/unattended/unattended_w81_32bit.xml",
            ],
		}
    ]

}

This is the correct content:

{
    "theme_legacy": 
	{
        "file": "/ventoy/themes/Ventoy-Dark/theme.txt",
        "gfxmode": "1024x768"       
		},
    "theme_uefi": {
        "file": "/ventoy/themes/Ventoy-Dark/theme.txt",
        "gfxmode": "1366x768"
		},
    "theme_ia32": {
        "file": "/ventoy/themes/Ventoy-Dark/theme.txt",
        "gfxmode": "1366x768"
		},
    "theme_aa64": {
        "file": "/ventoy/themes/Ventoy-Dark/theme.txt",
        "gfxmode": "1366x768"
		},
    "theme_mips": {
        "file": "/ventoy/themes/Ventoy-Dark/theme.txt",
        "gfxmode": "1366x768"
		}
	,
	
	"injection": [
        {
            "image": "04._Windows_XP_Professional_SP3_32bit.iso",
            "archive": "ventoy/drivers/DPMS_XP/DPMS.7z"
			},
		{
            "image": "07._Windows_8.1_Update_1_32bit.iso",
            "archive": "ventoy/drivers/EI/ei.zip"
			},
		{
            "image": "08._Windows_8.1_Update_1_64bit.iso",
            "archive": "ventoy/drivers/EI/ei.zip"
			}
    ],
	
	    "auto_install": [
        {
            "image": "08._Windows_8.1_Update_1_64bit.iso",
            "template": [
                "/ventoy/unattended/unattended_w81_64bit.xml"
            ]
        },
		{
		    "image": "08._Windows_8.1_Update_1_32bit.iso",
            "template": [
                "/ventoy/unattended/unattended_w81_32bit.xml"
            ]
		}
    ]

}

@ventoy
Copy link
Owner

ventoy commented Oct 12, 2021

In pretty style

{
    "theme_legacy":{
        "file":"/ventoy/themes/Ventoy-Dark/theme.txt",
        "gfxmode":"1024x768"
    },
    "theme_uefi":{
        "file":"/ventoy/themes/Ventoy-Dark/theme.txt",
        "gfxmode":"1366x768"
    },
    "theme_ia32":{
        "file":"/ventoy/themes/Ventoy-Dark/theme.txt",
        "gfxmode":"1366x768"
    },
    "theme_aa64":{
        "file":"/ventoy/themes/Ventoy-Dark/theme.txt",
        "gfxmode":"1366x768"
    },
    "theme_mips":{
        "file":"/ventoy/themes/Ventoy-Dark/theme.txt",
        "gfxmode":"1366x768"
    },
    "injection":[
        {
            "image":"04._Windows_XP_Professional_SP3_32bit.iso",
            "archive":"ventoy/drivers/DPMS_XP/DPMS.7z"
        },
        {
            "image":"07._Windows_8.1_Update_1_32bit.iso",
            "archive":"ventoy/drivers/EI/ei.zip"
        },
        {
            "image":"08._Windows_8.1_Update_1_64bit.iso",
            "archive":"ventoy/drivers/EI/ei.zip"
        }
    ],
    "auto_install":[
        {
            "image":"08._Windows_8.1_Update_1_64bit.iso",
            "template":[
                "/ventoy/unattended/unattended_w81_64bit.xml"
            ]
        },
        {
            "image":"08._Windows_8.1_Update_1_32bit.iso",
            "template":[
                "/ventoy/unattended/unattended_w81_32bit.xml"
            ]
        }
    ]
}

@ventoy
Copy link
Owner

ventoy commented Oct 17, 2021

@MrQuasar173 Any update?

@MrQuasar173
Copy link
Author

Here is updated json file with just the themes following your syntax. It still doesn't work
ventoy.zip

@steve6375
Copy link

What do you mean by 'doesn't work'?

@ventoy
Copy link
Owner

ventoy commented Oct 18, 2021

@MrQuasar173 It still report syntax error?

@MrQuasar173
Copy link
Author

Yes

@ventoy
Copy link
Owner

ventoy commented Oct 18, 2021

OK, after the report, you can still boot into Ventoy's main menu.
Here you press c to enter grub shell and run

md5sum  $vtoy_iso_part/ventoy/ventoy.json

It will output the md5 of the ventoy.json you use. Take a photo about it and upload the photo.

@MrQuasar173

@ventoy
Copy link
Owner

ventoy commented Oct 20, 2021

@MrQuasar173 Any update?

@MrQuasar173
Copy link
Author

image

Here is the screenshot

@MrQuasar173
Copy link
Author

@ventoy any idea what's going on here?

@ventoy
Copy link
Owner

ventoy commented Nov 8, 2021

The problem is that the ventoy.json you give is in UCS-2 encoding, Ventoy need UTF-8 no BOM encoding.
So you need to convert it to UTF-8 no BOM
I will add a check in the next release for this.

@MrQuasar173
Copy link
Author

Ok, Thanks! I will look up how to change the encoding and then close this issue if it works

ventoy added a commit that referenced this issue Nov 8, 2021
ventoy.json must in UTF-8 encoding. The BOM is auto skipped if exist.
@ventoy
Copy link
Owner

ventoy commented Nov 10, 2021

@MrQuasar173 Any update?

@ventoy ventoy closed this as completed Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants