Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 26

Thread: Question(s) about the bundler

  1. #11
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,782
    Rep Power
    10

    Re: Question(s) about the bundler

    Well, a way could be to output into a file.
    For example FILE_Save can save a string content into a file with just one line even if the string is many MB in size.
    I usually prefer to use files instead of standard output because is is less susceptible to possible OS differences.
    But it depends on what you are trying to achieve.

    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  2. #12

    Re: Question(s) about the bundler

    Big Jon,

    just to highlight two things.

    More statements of console's module are alias of same statements following the table below:
    [code=thinbasic]
    Console_Cls Console_Cls
    Console_Cls Cls
    Console_ColorAt Console_ColorAt
    Console_PrintAt Console_PrintAt
    Console_PrintAt PrintAt
    Console_Read Console_Read
    Console_Read Gets
    Console_Read StdIn
    Console_WaitKey Console_WaitKey
    Console_WaitKey WaitKey
    Console_WriteError StdError
    Console_WriteError Console_WriteError
    Console_WriteError Console_PrintError
    Console_WriteError PrintError
    Console_WriteLineError Console_WriteLineError
    Console_WriteLineError Console_PrintLineError
    Console_WriteLineError PrintLError
    Console_WriteLine Console_WriteLine
    Console_WriteLine Console_PrintLine
    Console_WriteLine PrintL
    Console_Write Echo
    Console_Write StdOut
    Console_Write Console_Write
    Console_Write Console_Print
    Console_Write Print
    [/code]

    If you need to build a bundle that should run on console subsystem please always use the .tbasicc extension as script extension.

    If you can please post an example of your work so I can understand better what happen, please be sure to encrypt your source script when you make the bundle.

    Regards,
    Roberto
    http://www.thinbasic.com

  3. #13

    Re: Question(s) about the bundler

    Okay, I've created this which exhibits the problem.
    MyDrives.tBasicC[code=thinbasic]USES "CONSOLE"

    DECLARE FUNCTION GetLogicalDriveStrings LIB "KERNEL32.DLL" ALIAS "GetLogicalDriveStringsA" (BYVAL nBufferLength AS DWORD,BYVAL lpBuffer AS DWORD) AS DWORD
    DECLARE FUNCTION GetDriveType LIB "KERNEL32.DLL" ALIAS "GetDriveTypeA" (BYVAL nDrive AS STRING) AS INTEGER

    %DRIVE_REMOVABLE = 2
    %DRIVE_FIXED = 3
    %DRIVE_REMOTE = 4
    %DRIVE_CDROM = 5
    %DRIVE_RAMDISK = 6

    SUB Disk_GetList(BYREF DiskList() AS STRING)

    DIM DriveString AS STRING * 512

    GetLogicalDriveStrings(LEN(DriveString), STRPTR(DriveString))
    SPLIT(DriveString, CHR$(0) , DiskList)

    END SUB

    DIM Disks() AS STRING

    Disk_GetList(Disks)

    FOR x AS LONG = 1 TO UBOUND(Disks())
    SELECT CASE GetDriveType(Disks(x))
    CASE %DRIVE_REMOVABLE
    SELECT CASE LCASE$(LEFT$(Disks(x), 1))
    CASE "a", "b"
    PRINTL Disks(x), "Floppy"
    CASE ELSE
    PRINTL Disks(x), "Removable"
    END SELECT
    CASE %DRIVE_FIXED
    PRINTL Disks(x), "Fixed"
    CASE %DRIVE_REMOTE
    PRINTL Disks(x), "Network"
    CASE %DRIVE_CDROM
    PRINTL Disks(x), "CDROM"
    CASE %DRIVE_RAMDISK
    PRINTL Disks(x), "RAM"
    END SELECT
    NEXT
    [/code]I hope your tests produce the same or similar results so that I don't look too stupid!

  4. #14
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159

    Re: Question(s) about the bundler

    Jon your script is fine, no problems there.

    There does seem to be a problem with the bundler it does not recognise system enviroment variables such as %tmp% or %HOMEDRIVE%, it also leaves lots of files behind (not the script). It only works with full paths.



    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  5. #15

    Re: Question(s) about the bundler

    Try copying the code to a new file with a .tBasicC extension into a new, empty folder e.g. C:\test_dir\MyConApp.tBasicC

    Then open it in the IDE and build two packages of it with the bundler.

    Make sure that ther first one is left with the defaults, and the second one with the box unchecked for Delete after run, (this will obviously require a different Bundle Name so as not to overwrite the first one!).

    Now open a windows console and CD /D C:\test_dir.

    Now invoke the first bundled script and note what happens, then try the second bundled script and note the difference!

    Does the latter as in my tests not return to the flashing prompt?
    If it does it could be related to my OS, UAC or some similar anomaly.

    Thank you for your time looking at this!

  6. #16
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159

    Re: Question(s) about the bundler

    Mine does the same, it waits until enter is pressed.
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  7. #17

    Re: Question(s) about the bundler

    It just seems odd to me that one seemingly unrelated tick box can cause this behaviour.

    The good thing is that it's rare that I'd distribute a bundle which would need not be deleted after running.

  8. #18

    Re: Question(s) about the bundler

    Hi Big Jon,

    thank you to posting your code.
    Actually I can't test your script, but I'll do ASAP, meanwhile I'm working to adding to the bundle the capabilities of expand the enviroment variables used as extraction folder because as Michael pointed out it would be useful have it.
    I'll let you know about my progress.

    Ciao,
    Roberto
    http://www.thinbasic.com

  9. #19
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,782
    Rep Power
    10

    Re: Question(s) about the bundler

    Big Jon,

    now I got exactly your point. I replicated what you have described and the exact same behave.
    I will talk with Roberto and we will try to see where the problem is.

    I also did the example using .tBasic extention instead of .tBasicc because in my understanding no new console window should be opened/closed but a script using CONSOLE module should use the same console window where it is executed from.

    Thank you very much for your help. We will give a solution soon.
    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  10. #20

    Re: Question(s) about the bundler

    Sorry to re-open an old topic, is it possible to change the output of the script I posted earlier to return only the first two characters of the drive letters without the trailing backslashes and if so how?

    Thank you in advance.

Page 2 of 3 FirstFirst 123 LastLast

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •