-
twinBasic "installer"
I did this for myself (because clicking links is hard :lol:) and thought I'd share it. It is very simplistic, select where to download the zip file, select where twinBasic is locally, select what to do with the zip file once downloaded, click download. It finds the latest available and does what is asked.
Do with it as you will.
https://github.com/jdelano0310/GettbZip
Thank you wqweto for cZipArchive.cls
**no error trapping currently as using On Error Goto causes the project to no longer work https://github.com/twinbasic/twinbasic/issues/1911
-
Re: twinBasic "installer"
-
Re: twinBasic "installer"
Small update to add the change log and switched to using HTMLDocument, string was fine for just getting the version, https://imgur.com/a/j9Qn5ho
-
Re: twinBasic "installer"
Perhaps one day, twinbasic will become an NPM package that gives vba,vb6 Compile 64-bit DLL, exe, you only need a command line, it can automatically download, automatically you can be compiled into PE files.
In the Linux world, only the command line is not installed. Next step, next step, there is no need to download manually.
-
Re: twinBasic "installer"
Quote:
Originally Posted by
xiaoyao
Perhaps one day, twinbasic will become an NPM package that gives vba,vb6 Compile 64-bit DLL, exe, you only need a command line, it can automatically download, automatically you can be compiled into PE files.
In the Linux world, only the command line is not installed. Next step, next step, there is no need to download manually.
Anything is possible.
-
1 Attachment(s)
Re: twinBasic "installer"
Added the change log to the screen. There is a local copy of the releases page being used here, why it says debug in the status, as there isn't a newer version than what I am using.
-
Re: twinBasic "installer"
Video with new options to check for a newer version on load of the utility and launch the new version of twinBASIC after it is extracted to the folder.
https://1drv.ms/v/c/7b44a6c9bbfcba41...s7lZQ?e=CKOwuw
-
Re: twinBasic "installer"
Updated to now grab the current version number from build.js.
-
1 Attachment(s)
Re: twinBasic "installer"
Added code to return the change log of each version between the currently installed version and the current release.
-
Re: twinBasic "installer"
So, I've added a few things to this, renamed it tBHelper and a new repo where I upload the exported files from the source folder instead of the twinproj file, I can upload that if requested.
Here is the new repo https://github.com/jdelano0310/tbHelper
-
Re: twinBasic "installer"
Thank you, I use this excellent utility daily!
-
Re: twinBasic "installer"
I am happy that you find it useful.
I'm working on a GUI rework; I was doing that first but then pivoted to just a few feature updates.
-
Re: twinBasic "installer"
Since you're working on the UI, one feature request would be to allow for font size adjustments on the Change Log window. My old eyes have a hard time with the font at the current size. :bigyello:
-
1 Attachment(s)
Re: twinBasic "installer"
Good call.
edit: better???
-
1 Attachment(s)
Re: twinBasic "installer"
Hey AAraya, would you be willing to help me test this new GUI in the next week or two (ish)??
Currently this form is just the GUI with test data, I'm getting closer to adding the code into it. I've been creating user controls to create this version. Sans the revert and view log buttons from Krool's collection.
-
Re: twinBasic "installer"
Absolutely would be willing to help test that!
-
Re: twinBasic "installer"
excellent, thank you. I'll keep you posted.
-
Re: twinBasic "installer"
-
Re: twinBasic "installer"
thank you! coming from the master creator that means a lot.
-
Re: twinBasic "installer"
I know an nice interface when I see one. Just because it isn't steampunk/diesel doesn't reduce its usability/ attractiveness to my eyes.
Making VB6 do more than it should be naturally able to, always impresses me.
PS. Do you release your code or just a binary? I'd like to dig into it for examples, if you are happy with that.
-
Re: twinBasic "installer"
It'll be here https://github.com/jdelano0310/tbHelper, I'll post the exported files - I'll make a sub folder for this GUI project that will then become the next tbHelper app.
-
1 Attachment(s)
Re: twinBasic "installer"
-
Re: twinBasic "installer"
That blue in the upper portion looks to be a fairly standard Windows blue so that's not so out of place.
I'm not an artist but the violet blue filter colors is the one that seems to clash with the blue on top
-
Re: twinBasic "installer"
Quote:
Originally Posted by
jdelano
Too blue?
twinbasic herhangi bir kütüphaneye ba?l? m?? mesela .net framework gibi zorunluluklar? var m? ?
VB6 Kodlar? ile %100 uyumluluk devam ediyor mu .
-
Re: twinBasic "installer"
Quote:
That blue in the upper portion looks to be a fairly standard Windows blue so that's not so out of place.
I'm not an artist but the violet blue filter colors is the one that seems to clash with the blue on top
Indeed and agreed.
-
Re: twinBasic "installer"
Quote:
Originally Posted by
saraybilisim
twinbasic herhangi bir kütüphaneye ba?l? m?? mesela .net framework gibi zorunluluklar? var m? ?
VB6 Kodlar? ile %100 uyumluluk devam ediyor mu .
This is an English language forum, you couldn't be the one to put your comment through a translator? It's also not about this specific community project.
To answer your question, no, there's no library dependencies for twinBASIC-compiled exes beyond the standard OS components that exist on all Windows computers (currently back to Windows XP; Windows 2000 may be supported in the future, but Windows 95/98/ME/NT4 will not).
The twinBASIC IDE depends on WebView2, which requires Windows 7.
100% compatibility with the VB6 language and documented features/behaviors is the goal, and it's nearly there, but as the "BETA" status suggests, there's still some bugs and a handful of unimplemented features, although many large and complicated VB6 projects run without modification right now.
Please post future questions and comments in their own thread or at least the main twinBASIC thread.
-
Re: twinBasic "installer"
Still plugging away, learning GDI+ is a fickle beast, when you have a few custom controls, there are hoops and many other considerations.
-
Re: twinBasic "installer"
I used GDI+ extensively in a tool I recently worked on and found AI invaluable at providing the correct API definitions, GDI+ calls, ensuring all objects were properly cleaned up. I couldn't have done the work without it - other than spending 10x the amount of time and effort on it.
-
Re: twinBasic "installer"
Am using copilot, it has been a learning experience. I'm an old function over form developer, emphasis on old. Good to keep the grey matter malleable.
-
Re: twinBasic "installer"
Quote:
Originally Posted by
AAraya
I used GDI+ extensively in a tool I recently worked on and found AI invaluable at providing the correct API definitions, GDI+ calls, ensuring all objects were properly cleaned up. I couldn't have done the work without it - other than spending 10x the amount of time and effort on it.
It's ok for common API defs in 32bit only, but mistakes go up quickly when there's no existing def or no x64 supporting def in its training. I'm not perfect either but WinDevLib is going to have a far lower error rate for API definitions, and it's even more efficient almost never needing to worry about them again. It's a whole different ballgame from old VB6 libs like winu.tlb that only covered a small fraction... WDL has complete coverage of hundreds of SDK headers for everything common. GDI+ is covered 100%.
.
For VB6 you'd need to remove PtrSafe and a couple other tB enhancements but a centralized source is nice.
-
Re: twinBasic "installer"
Nice, I was reading that thread recently too. As I feel like the time is nigh to rethink the user control GDI processing in my project, I'll revisit it. Thank you.
-
Re: twinBasic "installer"
@fafalone - thanks for the WinDevLib, it has been a value add for sure!
@AARaya - if you'd like to take this beta for a spin, let me know what all breaks.
Known
The download button state is incorrect if the setting is to look for a new version at launch and there isn't one (it is disabled and blank)
If twinBASIC is reverted, there is no visual indication that the process was successful or not.
If twinBASIC is reverted to an older version, the main form isn't properly updated to the proper installed version
Looking at these 3 tomorrow and that'll move the version to beta 2, if you think of something you'd like, let me know. One thing I'm adding is a resource feature with links to websites that a relative (twinBASICs, VBForums twinBASIC, and nolongerset.com, maybe report a bug with most of the template prefilled)
The images will be added as a resource as well, and the awful disabled cursor is going away.
EDIT: the zip https://1drv.ms/u/c/7b44a6c9bbfcba41...FSIiA?e=cmfEwr
my quota is exceeded again LOL
-
Re: twinBasic "installer"
If anyone is particularly adventurous a new zip starting with beta 2 https://1drv.ms/u/c/7b44a6c9bbfcba41...zexAA?e=oQCB0z
-
Re: twinBasic "installer"
I look forward to playing with this new version. It'll be much easier when regular tB updates are being released. Initial impressions are that the UI looks much improved.
I'd suggest possibly pre-populating the download location with the default Downloads folder
-
Re: twinBasic "installer"
Quote:
Originally Posted by
AAraya
I look forward to playing with this new version. It'll be much easier when regular tB updates are being released. Initial impressions are that the UI looks much improved.
I'd suggest possibly pre-populating the download location with the default Downloads folder
Good idea!
EDIT: this beta 2 version auto finds the user download folder (even if it has been moved) and twinBASIC folder, if there is no settings file to read it from.
https://1drv.ms/u/c/7b44a6c9bbfcba41...GpUdw?e=W940dE
-
Re: twinBasic "installer"
Now that a new version of tB has been released I've had a chance to run the new version.
Two issues:
1. Still deletes the install folder and doesn't install the new version when not run as an administrator. Install folder is C:\Program Files\TwinBasic
2. I'm at 150% DPI and this appears to cause issues with the confirmation messages (text too small) and the grid on the main window - both images and text (both cut off).
I can provide screenshots but it should be easy enough for you to reproduce.
Other than that, so far so good!
-
Re: twinBasic "installer"
Awesome, thank you. I have been working on the DPI, I haven't had the time to upload it. Absolutely, yes on then require admin rights for certain folders. I haven't revisited it in this version as of yet.
Thank you for testing it.
Latest exe: https://1drv.ms/u/c/7b44a6c9bbfcba41...3pncw?e=l0P7F5
-
Re: twinBasic "installer"
Does that EXE address either of the issues I reported?
-
Re: twinBasic "installer"
-
Re: twinBasic "installer"
Which makes more sense to you, regarding extracting to a folder in the Program Files folders.
1) Once you select the location of tB and it is in one of those folders, the app alerts you that elevated rights will be required, it sets itself as requiring it to run, you're asked to relaunch the app, Windows will alert you it is requesting admin rights each time going forward.
2) There is an associated exe that is responsible for extracting the files to the tB location (only used if the location is in one of those folders) it is already set up to ask for admin rights to execute. This only runs if an extraction is required (getting a new version or reverting to an older version)
-
Re: twinBasic "installer"
Sorry for the delay in responding - only seeing this today.
I think option #1 is the one I've seen most often. As to which is BEST or industry-standard, I don't know.
I did not test your last EXE as Windows Defender was flagging it as a virus and didn't allow me to download it. I can work around it but just haven't done so yet. But thought you should know that something is different in your latest version. The previous version had no download issues while the current one does.
-
Re: twinBasic "installer"
I got the latest version (beta 2) downloaded and have several issues. Note that this is on a different computer than all the other tests I've done so these may have been here even in an earlier version. The earlier tests were on a Desktop while these tests are on a laptop:
1. The folder path selector buttons don't work. Clicking on them does nothing.
2. Neither the Revert or View Log History buttons do anything. I see a spinner/busy cursor but nothing appears. It appears like maybe secondary Forms/Windows are not appearing on screen? I tried deleting the SETTINGS file but that didn't help.
3. Log shows that an error happened but it provides no details. It says only "Error:" in red but nothing else
4. If the ZIP file already exists, the log contains a message "The zip exists in the download folder, redownload it?" But there's no way I can see to select a YES or a NO.
5. DPI issues seem better - at least the grid/list icons and text
6. Grid/list control column header captions have an issue with higher DPI. They bleed over each other.
-
Re: twinBasic "installer"
hmmm, thank you for testing it.
EDIT: of course, it works here LMAO. What is the date of the EXE? Is it 10/4?
screen recording
https://1drv.ms/v/c/7b44a6c9bbfcba41..._i1Uw?e=7Z2pMh
-
Re: twinBasic "installer"
Mine is Beta 2 dated 10/1. Can I have a link to the latest version? The last link you posted doesn't seem to work any longer.
-
Re: twinBasic "installer"
-
Re: twinBasic "installer"
Thanks. Same problems that I reported previously.
I'm testing this one a different laptop at 250 DPI. If you need to create a diagnostic EXE which outputs debug info to a log, I'd be happy to run that for you.
-
Re: twinBasic "installer"
Oh okay, I'll do some testing at that DPI level.
-
Re: twinBasic "installer"
If it helps you, let me have your twin project file and I can debug it for you, if you'd like.
-
Re: twinBasic "installer"
Here you go https://1drv.ms/u/c/7b44a6c9bbfcba41...iNhw?e=aqu2dM; recommend a couple asprin before trying to read this stuff.
-
Re: twinBasic "installer"
Haha, no worries - I understand and have lots of code like that too.
Immediately I notice a few of these issues don't happen when I run it from the IDE so there's a clue there (the folder selection buttons work and their images appear on the buttons in the IDE but not in the EXE).
I have little time to devote to this right now but will certainly look at it as time allows as this is a very helpful tool for me as well.
Art
-
Re: twinBasic "installer"
EDIT
OK, found the issue with the two folder selection buttons. Their icons have to be in the same folder path as the EXE otherwise the images don't appear on the buttons and the buttons don't work (the custom button setup code probably silently aborts when the image is not found at the specified path).
Might consider adding some error handling to that button setup code to display or log an error if the button setup fails. Or maybe a Resume Next so that the entire routine is not aborted when setting one property of the button fails.
-
Re: twinBasic "installer"
For button image DPI issues you can use the DPI Scale factor to modify the button's graphical properties:
I created a helper function GetDPIScale() and placed it in a modDPI module which I've also added below. You should be able to use this same helper in similar fashion in the other places where you're drawing images.
Code:
Public Sub ConfigureCustomButton(theButton As ucCustomButton, buttonCaption As String, bkColor As OLE_COLOR, frColor As OLE_COLOR, _
pngImagePath As String, iconSize As Integer, startEnabled As Boolean, boldFont As Boolean, _
Optional borderColor As OLE_COLOR = 0, Optional borderWidth As Integer = 0)
'WriteToDebugLogFile " ConfigureCustomButton identifier " & IIf(buttonCaption = "", pngImagePath, buttonCaption)
Dim dpiScale As Double = GetDPIScale()
With theButton
.Caption = buttonCaption
.BackColor = bkColor
.ForeColor = frColor
If borderWidth > 0 Then
.BorderColor = borderColor
.BorderWidth = borderWidth
End If
.FontSize = 11
.BorderRadius = 3 * dpiScale
.FontBold = boldFont
.PngIconPath = pngImagePath
.IconSize = iconSize * dpiScale
.IconSpacing = 8 * dpiScale
.Enabled = startEnabled
End With
End Sub
Code:
Attribute VB_Name = "modDPI"
' Standard Module: modDPI
Option Explicit
' --- API Declarations and Constants ---
' System Metric Index for Horizontal DPI
Private Const LOGPIXELSX As Long = 88
' Standard DPI baseline (100% scaling)
Private Const BASE_DPI As Long = 96
' twinBASIC uses VBA7 compatibility syntax for 64-bit compilation,
' requiring PtrSafe and LongPtr for handles and pointers [4-7].
#If VBA7 Then
' Retrieves a handle to a device context (hDC) for the entire screen (hWnd=0)
Private Declare PtrSafe Function GetDC Lib "user32" (ByVal hWnd As LongPtr) As LongPtr
' Releases the device context handle
Private Declare PtrSafe Function ReleaseDC Lib "user32" (ByVal hWnd As LongPtr, ByVal hDC As LongPtr) As Long
' Retrieves device-specific information from the specified device context
Private Declare PtrSafe Function GetDeviceCaps Lib "gdi32" (ByVal hDC As LongPtr, ByVal nIndex As Long) As Long
#Else
' Fallback declarations (standard VB6/VBA syntax for 32-bit)
Private Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function ReleaseDC Lib "user32" (ByVal hWnd As Long, ByVal hDC As Long) As Long
Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hDC As Long, ByVal nIndex As Long) As Long
#End If
' --- Public Method ---
Public Function GetDPIScale() As Double
' Returns the system DPI scaling factor (e.g., 1.5 for 150% scaling)
#If VBA7 Then
Dim hDC As LongPtr
#Else
Dim hDC As Long
#End If
Dim CurrentDPI As Long
Dim ScaleFactor As Double
' 1. Get the Device Context (DC) for the desktop window (hWnd=0)
hDC = GetDC(0)
If hDC <> 0 Then
' 2. Retrieve the current DPI value (e.g., 144 DPI for 150% scaling)
CurrentDPI = GetDeviceCaps(hDC, LOGPIXELSX)
' 3. Release the Device Context (essential cleanup)
Call ReleaseDC(0, hDC)
' 4. Calculate the fractional scale factor using floating-point division
If CurrentDPI > 0 Then
ScaleFactor = CDbl(CurrentDPI) / BASE_DPI
GetDPIScale = ScaleFactor
Else
GetDPIScale = 1.0 ' Default to 1.0 (100%) if DPI failed to retrieve
End If
Else
' Failed to get DC
GetDPIScale = 1.0
End If
End Function
-
1 Attachment(s)
Re: twinBasic "installer"
Here's the button images shown at 250 DPI after these changes.
Attachment 195450
-
Re: twinBasic "installer"
That might be all I can get to today but hopefully there's enough in here to get you started down the path to resolving the other DPI issues.
-
Re: twinBasic "installer"
Awesome, thank you.
EDIT: the images are meant to be included as a resource in the end, just haven't done that yet.
-
Re: twinBasic "installer"
Including the images as a resource is a great way to go! It'll help prevent these issues.
-
Re: twinBasic "installer"
You've got several Image controls on the main form which aren't handling DPI properly. The fix is super easy. Image controls have a PictureDPIScaling property which you have to set to True and this automatically resolves the issue for you - no code required.
-
Re: twinBasic "installer"
The activity log's issue is that the row height is currently a fixed value. You're correctly calculating the font size in CalculateDPIValues() but you need to also calculate a variable sized row height in there and use that in all places in the code where you're using the ROW_HEIGHT constant.
-
Re: twinBasic "installer"
Indeed, much appreciated.
-
Re: twinBasic "installer"
Added new code and exe to the github (I'll be moving the files around on this soon so the new version isn't in a sub folder) for:
Adding DPI code to Activity Log and Change Log
updated columns width calculation, type badge drawing, type text location in the badge, row height, and inner row wrapping.
Add code given by ArtAraya, again thank you, to handle the custom buttons, as well as what needed to be changed for the images (used for placing icons) to be correct.
Modified selecting a twinBASIC location code as it lacked adding a (edit): backslash causing the check for the existence of tB in the folder to break.
Added the verification that the download button can be enabled once both the folders are valid.
I'll look at changing the treeview on the select folder location to be DPI aware (if possible, if not that'll be swapped out) I tested this at 125% and 150% let me know if you see something off. THANK YOU again.