mirror of
https://github.com/QB64Official/qb64.git
synced 2024-07-07 19:10:25 +00:00
Tweaks to $EXEICON implementation
No error message if not Windows, proper error message if icon.o can't be generated.
This commit is contained in:
parent
127c4acd88
commit
26a6c94f63
|
@ -3190,19 +3190,21 @@ DO
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
IF LEFT$(a3u$, 8) = "$EXEICON" THEN
|
IF LEFT$(a3u$, 8) = "$EXEICON" THEN
|
||||||
IF INSTR(_OS$, "WIN") THEN
|
'Basic syntax check. Multi-platform.
|
||||||
IF ExeIconSet THEN a$ = "$EXEICON already defined": GOTO errmes
|
IF ExeIconSet THEN a$ = "$EXEICON already defined": GOTO errmes
|
||||||
FirstDelimiter = INSTR(a3u$, "'")
|
FirstDelimiter = INSTR(a3u$, "'")
|
||||||
IF FirstDelimiter = 0 THEN
|
IF FirstDelimiter = 0 THEN
|
||||||
a$ = "Expected $EXEICON:'filename'": GOTO errmes
|
a$ = "Expected $EXEICON:'filename'": GOTO errmes
|
||||||
ELSE
|
ELSE
|
||||||
SecondDelimiter = INSTR(FirstDelimiter + 1, a3u$, "'")
|
SecondDelimiter = INSTR(FirstDelimiter + 1, a3u$, "'")
|
||||||
IF SecondDelimiter = 0 THEN a$ = "Expected $EXEICON:'filename'": GOTO errmes
|
IF SecondDelimiter = 0 THEN a$ = "Expected $EXEICON:'filename'": GOTO errmes
|
||||||
END IF
|
END IF
|
||||||
ExeIconFile$ = RTRIM$(LTRIM$(MID$(a3$, FirstDelimiter + 1, SecondDelimiter - FirstDelimiter - 1)))
|
ExeIconFile$ = RTRIM$(LTRIM$(MID$(a3$, FirstDelimiter + 1, SecondDelimiter - FirstDelimiter - 1)))
|
||||||
IF LEN(ExeIconFile$) = 0 THEN a$ = "Expected $EXEICON:'filename'": GOTO errmes
|
IF LEN(ExeIconFile$) = 0 THEN a$ = "Expected $EXEICON:'filename'": GOTO errmes
|
||||||
layout$ = "$EXEICON:'" + ExeIconFile$ + "'" + MID$(a3$, SecondDelimiter + 1)
|
layout$ = "$EXEICON:'" + ExeIconFile$ + "'" + MID$(a3$, SecondDelimiter + 1)
|
||||||
|
|
||||||
|
IF INSTR(_OS$, "WIN") THEN
|
||||||
|
'Actual metacommand processing. Windows only.
|
||||||
'Expand relative path to full path:
|
'Expand relative path to full path:
|
||||||
IconPath$ = ""
|
IconPath$ = ""
|
||||||
IF LEFT$(ExeIconFile$, 2) = "./" OR LEFT$(ExeIconFile$, 2) = ".\" THEN
|
IF LEFT$(ExeIconFile$, 2) = "./" OR LEFT$(ExeIconFile$, 2) = ".\" THEN
|
||||||
|
@ -3245,12 +3247,10 @@ DO
|
||||||
CLOSE #iconfilehandle
|
CLOSE #iconfilehandle
|
||||||
IF E = 1 THEN a$ = "Error creating icon resource file": GOTO errmes
|
IF E = 1 THEN a$ = "Error creating icon resource file": GOTO errmes
|
||||||
ON ERROR GOTO qberror
|
ON ERROR GOTO qberror
|
||||||
|
|
||||||
ExeIconSet = linenumber
|
|
||||||
END IF
|
END IF
|
||||||
ELSE
|
|
||||||
a$ = "Feature not available (Windows only)": GOTO errmes
|
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
|
ExeIconSet = linenumber
|
||||||
GOTO finishednonexec
|
GOTO finishednonexec
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
|
@ -11506,7 +11506,7 @@ IF os$ = "WIN" THEN
|
||||||
CLOSE #ffh
|
CLOSE #ffh
|
||||||
SHELL _HIDE tmpdir$ + "call_windres.bat"
|
SHELL _HIDE tmpdir$ + "call_windres.bat"
|
||||||
IF _FILEEXISTS(tmpdir$ + "icon.o") = 0 THEN
|
IF _FILEEXISTS(tmpdir$ + "icon.o") = 0 THEN
|
||||||
a$ = "Error creating icon resource file": GOTO errmes
|
a$ = "Bad icon file": GOTO errmes
|
||||||
END IF
|
END IF
|
||||||
END IF
|
END IF
|
||||||
END IF
|
END IF
|
||||||
|
|
Loading…
Reference in a new issue