Open terremoth opened 1 year ago
I like this idea. But I think instead of a command V should just automatically check if a file exists in the directory being compiled. If executable_icon.ico
exists, then add it. If not, proceed as normal.
I use these steps to create an Icon file, a resource file and add them all to the exe. Then the Details page of the exe file is also filled:
ID ICON "Full path to your icon file/ICON.ico"
1 VERSIONINFO
FILEVERSION 2023, 8, 25, 0
PRODUCTVERSION 2023, 8, 25, 0
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "CompanyName", "H. F."
VALUE "FileDescription", "Tool collection"
VALUE "FileVersion", "1.0.1.1"
VALUE "InternalName", "HFTools"
VALUE "LegalCopyright", "(c) H. F. Copyright 2023"
VALUE "OriginalFilename", "HFTools.exe"
VALUE "ProductName", "HFTools"
VALUE "ProductVersion", "1.0.1.0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0, 1200
END
END
It would be cool if someone added a PR for examples/ folder doing this. I suppose the solution above only makes sense on Windows. But it's only there where executables have icons as far as I know. Linux uses .desktop files which is metadata collection referencing the icon data outside the ELF binary itself.
Mac OS?
Describe the feature
Pass a parameter via terminal/cmd -icon= or --icon= or --seticon= to set a .ico or .png into/within the .exe file.
Use Case
./v --icon=my_icon.ico file.v
Proposed Solution
Idk if this will help, but Nim lang and Python's Pyinstaller and Nuitka do this, rcedit maybe looking how they do can give insights
Acknowledgements
Version used
weekly.2023.33
Environment details (OS name and version, etc.)
OS: windows, Microsoft Windows 10 Pro v19045 64 bits Processor: 6 cpus, 64bit, little endian,
getwd: C:\Users\dutr4\Desktop\v vexe: C:\Users\dutr4\Desktop\v\v.exe vexe mtime: 2023-08-15 23:36:18
vroot: OK, value: C:\Users\dutr4\Desktop\v VMODULES: OK, value: C:\Users\dutr4.vmodules VTMP: OK, value: C:\Users\dutr4\AppData\Local\Temp\v_0
Git version: git version 2.35.1.windows.1 Git vroot status: Error: fatal: not a git repository (or any of the parent directories): .git .git/config present: false
CC version: Error: exec failed (CreateProcess) with code 2: O sistema não pode encontrar o arquivo especificado. cmd: cc --version thirdparty/tcc: N/A