06-17-2023, 01:40 PM
I said I was going to do this back on 3.7 Here it is on 3.8 Simply put. Drag and drop a list of EXE file(s) in my window and a script to mass compile them will appear in QB64pe folder. You can upgrade all your bas files to the new release. Or recompile sources after recreating a new qb64pe folder. aka I screwed up qb64pe and it doesn't compile right anymore.
Best practices you should create a new qb64pe folder and recompile every new release. There are many reasons why to do this. Behind the scenes changes could corrupt an upgrade in place attempt. So a quick step by step. Doesn't take long and original folder remains intact but only renamed.
1. Rename "qb64pe" folder to "qb64pe-org"
2. Extract new qb64 into new folder. Suggest leaving "Archive name" QB64pe alone
3. Copy your source "bas" folder to the new qb64pe location. << COPY NOT MOVE!! >>
4. Copy any .bin .h .inc .ico files into new qb64pe location. Or any others you want to keep.
5. Copy your .exe files into new qb64pe location. What ever you do DON'T COPY QB64pe.exe
Step 5 is only to keep a place holder of exe's which will be overwritten by my doit.cmd script.
6. After you are satisfied everything is right. Suggest waiting a week or two. QB64pe-org folder and all can be deleted.
If you have not done so already. Run the new version of QB64pe. Set any compiler options you want, Position and resize.
If you have not done so yet, load and compile the code provided here. On the next version release it will not be needed to recompile my code.
You can, but I am not using extravagant coding requiring recompile.
There is a limited number reasons for the script to fail. All of them fall on your head. re: sources not found, forgot to copy .bin, .h .ico ETC ....
This is open source, using it as you see fit, don't use it. I DON'T CARE. If you want to help and expand the code to include the option of QB64pe compiling the EXE near sources. I assumed your source would be in QB64pe folder and EXE 's would be there too. I tried to explain using remarks through out.
There could be only one change required. source$ must be in the path off QB64pe folder. AND INCLUDE A "\" on the end.
Enjoy
Best practices you should create a new qb64pe folder and recompile every new release. There are many reasons why to do this. Behind the scenes changes could corrupt an upgrade in place attempt. So a quick step by step. Doesn't take long and original folder remains intact but only renamed.
1. Rename "qb64pe" folder to "qb64pe-org"
2. Extract new qb64 into new folder. Suggest leaving "Archive name" QB64pe alone
3. Copy your source "bas" folder to the new qb64pe location. << COPY NOT MOVE!! >>
4. Copy any .bin .h .inc .ico files into new qb64pe location. Or any others you want to keep.
5. Copy your .exe files into new qb64pe location. What ever you do DON'T COPY QB64pe.exe
Step 5 is only to keep a place holder of exe's which will be overwritten by my doit.cmd script.
6. After you are satisfied everything is right. Suggest waiting a week or two. QB64pe-org folder and all can be deleted.
If you have not done so already. Run the new version of QB64pe. Set any compiler options you want, Position and resize.
If you have not done so yet, load and compile the code provided here. On the next version release it will not be needed to recompile my code.
You can, but I am not using extravagant coding requiring recompile.
There is a limited number reasons for the script to fail. All of them fall on your head. re: sources not found, forgot to copy .bin, .h .ico ETC ....
This is open source, using it as you see fit, don't use it. I DON'T CARE. If you want to help and expand the code to include the option of QB64pe compiling the EXE near sources. I assumed your source would be in QB64pe folder and EXE 's would be there too. I tried to explain using remarks through out.
There could be only one change required. source$ must be in the path off QB64pe folder. AND INCLUDE A "\" on the end.
Enjoy
Code: (Select All)
_Title "QB64pe Bas Upgrader v1.0"
Width 80, 10
_ScreenMove 10, 10
Cls
'
' I always use q$ to use quotes, just how I am
Q$ = Chr$(34)
'
' define where sources are <<< change variable to your directory >>>
' remember to slap a "\" to your source path end
'
source$ = "My Programs\"
'
' get home path
' noramlly this would be in the root of qb64pe
' screwy things could happen if it isn't
'
hp$ = Command$(0)
hp$ = Left$(hp$, _InStrRev(hp$, "\"))
' assume homepath + source is one path from here on out.
ChDir hp$
_AcceptFileDrop 'enables drag/drop functionality
Print "Drag the EXE file(s) and drop in this window... or x to exit"
Do
_Limit 3
x$ = InKey$
If UCase$(x$) = "X" Then
Cls
Print "I don't plan to open a command prompt"
Print "for you. doit.cmd script is in " + hp$
Print "folder. You can examime / execute / observe."
hitenter
System
End If
Loop Until _TotalDroppedFiles <> 0
Open "doit.cmd" For Output As #1
Do
Print
f$ = _DroppedFile
If f$ = "" Then Exit Do
'
' take out all path info and test for source available.
' also scrap off extention
'
f$ = Right$(f$, Len(f$) - _InStrRev(f$, "\"))
f$ = Left$(f$, Len(f$) - 4)
Print "Using "; f$
'
' ok do we have source bas ?
'
If _FileExists(hp$ + source$ + f$ + ".bas") = 0 Then
Print "Sorry I can not compile the above file. The source does not"
Print "exist in paths provided. Suggest exclude the file(s)"
Print "next time in selection and drop again."
hitenter
End If
'
' if you got this far a doit.cmd line can be generated
'
Print #1, hp$ + "qb64pe.exe -c " + Q$ + hp$ + source$ + f$ + ".bas" + Q$
Loop
Close
'
' another chance to do over or exit
'
Print "doit.cmd created and closed"
Print "Hit enter, followed by x"
Print "to exit or drop files again"
hitenter
Run
Sub hitenter
Input "Hit <enter> to continue "; bad
End Sub