mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-07-06 05:50:22 +00:00
Make $EXEICON errors only a warning when compiling via command line.
This commit is contained in:
parent
cca11e8f90
commit
6ac4f79294
|
@ -1,4 +1,4 @@
|
||||||
$EXEICON:'.\qb64.ico'
|
''$EXEICON:'.\qb64.ico'
|
||||||
'All variables will be of type LONG unless explicitly defined
|
'All variables will be of type LONG unless explicitly defined
|
||||||
DEFLNG A-Z
|
DEFLNG A-Z
|
||||||
|
|
||||||
|
@ -3234,7 +3234,13 @@ DO
|
||||||
IF MID$(ExeIconFile$, i, 1) = "/" OR MID$(ExeIconFile$, i, 1) = "\" THEN
|
IF MID$(ExeIconFile$, i, 1) = "/" OR MID$(ExeIconFile$, i, 1) = "\" THEN
|
||||||
IconPath$ = LEFT$(ExeIconFile$, i)
|
IconPath$ = LEFT$(ExeIconFile$, i)
|
||||||
ExeIconFile$ = MID$(ExeIconFile$, i + 1)
|
ExeIconFile$ = MID$(ExeIconFile$, i + 1)
|
||||||
IF _DIREXISTS(IconPath$) = 0 THEN a$ = "File '" + ExeIconFile$ + "' not found": GOTO errmes
|
IF _DIREXISTS(IconPath$) = 0 THEN
|
||||||
|
IF idemode THEN
|
||||||
|
a$ = "File '" + ExeIconFile$ + "' not found": GOTO errmes
|
||||||
|
ELSE
|
||||||
|
GOTO ExeIconWarning
|
||||||
|
END IF
|
||||||
|
END IF
|
||||||
currentdir$ = _CWD$
|
currentdir$ = _CWD$
|
||||||
CHDIR IconPath$
|
CHDIR IconPath$
|
||||||
IconPath$ = _CWD$
|
IconPath$ = _CWD$
|
||||||
|
@ -3246,11 +3252,15 @@ DO
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
IF _FILEEXISTS(ExeIconFile$) = 0 THEN
|
IF _FILEEXISTS(ExeIconFile$) = 0 THEN
|
||||||
|
IF idemode THEN
|
||||||
IF LEN(IconPath$) THEN
|
IF LEN(IconPath$) THEN
|
||||||
a$ = "File '" + MID$(ExeIconFile$, LEN(IconPath$) + 2) + "' not found": GOTO errmes
|
a$ = "File '" + MID$(ExeIconFile$, LEN(IconPath$) + 2) + "' not found": GOTO errmes
|
||||||
ELSE
|
ELSE
|
||||||
a$ = "File '" + ExeIconFile$ + "' not found": GOTO errmes
|
a$ = "File '" + ExeIconFile$ + "' not found": GOTO errmes
|
||||||
END IF
|
END IF
|
||||||
|
ELSE
|
||||||
|
GOTO ExeIconWarning
|
||||||
|
END IF
|
||||||
ELSE
|
ELSE
|
||||||
iconfilehandle = FREEFILE
|
iconfilehandle = FREEFILE
|
||||||
E = 0
|
E = 0
|
||||||
|
@ -3258,13 +3268,26 @@ DO
|
||||||
OPEN tmpdir$ + "icon.rc" FOR OUTPUT AS #iconfilehandle
|
OPEN tmpdir$ + "icon.rc" FOR OUTPUT AS #iconfilehandle
|
||||||
PRINT #iconfilehandle, "0 ICON " + QuotedFilename$(StrReplace$(ExeIconFile$, "\", "/"))
|
PRINT #iconfilehandle, "0 ICON " + QuotedFilename$(StrReplace$(ExeIconFile$, "\", "/"))
|
||||||
CLOSE #iconfilehandle
|
CLOSE #iconfilehandle
|
||||||
IF E = 1 THEN a$ = "Error creating icon resource file": GOTO errmes
|
IF E = 1 THEN
|
||||||
|
IF idemode THEN
|
||||||
|
a$ = "Error creating icon resource file": GOTO errmes
|
||||||
|
ELSE
|
||||||
|
GOTO ExeIconWarning
|
||||||
|
END IF
|
||||||
|
END IF
|
||||||
ON ERROR GOTO qberror
|
ON ERROR GOTO qberror
|
||||||
END IF
|
END IF
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
ExeIconSet = linenumber
|
ExeIconSet = linenumber
|
||||||
GOTO finishednonexec
|
GOTO finishednonexec
|
||||||
|
|
||||||
|
ExeIconWarning:
|
||||||
|
'If compiling via command line, just give a warning
|
||||||
|
'about the missing icon file:
|
||||||
|
PRINT
|
||||||
|
PRINT "WARNING: File '" + ExeIconFile$ + "' not found. $EXEICON disabled."
|
||||||
|
GOTO finishednonexec
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
END IF 'QB64 Metacommands
|
END IF 'QB64 Metacommands
|
||||||
|
@ -11511,7 +11534,14 @@ IF os$ = "WIN" THEN
|
||||||
E = 0
|
E = 0
|
||||||
ON ERROR GOTO qberror_test
|
ON ERROR GOTO qberror_test
|
||||||
KILL tmpdir$ + "icon.o"
|
KILL tmpdir$ + "icon.o"
|
||||||
IF E = 1 OR _FILEEXISTS(tmpdir$ + "icon.o") = -1 THEN a$ = "Error creating icon resource file": GOTO errmes
|
IF E = 1 OR _FILEEXISTS(tmpdir$ + "icon.o") = -1 THEN
|
||||||
|
IF idemode THEN
|
||||||
|
a$ = "Error creating icon resource file": GOTO errmes
|
||||||
|
ELSE
|
||||||
|
ExeIconSet = 0
|
||||||
|
GOTO ExeIconWarning2
|
||||||
|
END IF
|
||||||
|
END IF
|
||||||
ON ERROR GOTO qberror
|
ON ERROR GOTO qberror
|
||||||
END IF
|
END IF
|
||||||
ffh = FREEFILE
|
ffh = FREEFILE
|
||||||
|
@ -11520,10 +11550,22 @@ 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
|
||||||
|
IF idemode THEN
|
||||||
a$ = "Bad icon file": GOTO errmes
|
a$ = "Bad icon file": GOTO errmes
|
||||||
|
ELSE
|
||||||
|
ExeIconSet = 0
|
||||||
|
GOTO ExeIconWarning2
|
||||||
END IF
|
END IF
|
||||||
END IF
|
END IF
|
||||||
END IF
|
END IF
|
||||||
|
GOTO SkipWarning2
|
||||||
|
ExeIconWarning2:
|
||||||
|
'If compiling via command line, just give a warning
|
||||||
|
'about the missing icon file:
|
||||||
|
PRINT
|
||||||
|
PRINT "WARNING: Icon injection failed. $EXEICON disabled."
|
||||||
|
SkipWarning2:
|
||||||
|
END IF
|
||||||
|
|
||||||
'Update dependencies
|
'Update dependencies
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue