Results 1 to 4 of 4

Thread: Do you know: How to detect if a script is bundled

  1. #1
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    55
    Posts
    1,554
    Rep Power
    174

    Do you know: How to detect if a script is bundled

    Currently I have only one solution to find out from within code if it runs as tBasic-Script or bundled standalone-executeable:

    In case it's an executeable, thinCore-function App_Scriptname / App_Sourcename will return an empty string.

    
    
    ' ----------------------------------------------------------
    Function App_IsBundledExe() As Boolean
      ' returns TRUE if this program is an .exe 
      
      Function = ( APP_ScriptName = "" )
    
    End Function 
    
    ' ----------------------------------------------------------
    Function App_Title() As String        
      ' returns the name of this program
      
       Function = IIf$( APP_ScriptName = "" , APP_Name, APP_ScriptName )
    
    End Function
    ' ----------------------------------------------------------
    
    'test:
    
    If App_IsBundledExe Then
      MsgBox(0, "this is bundled version running " & $CRLF & APP_Title )
    Else
      MsgBox(0, "this is script-version running " & $CRLF & APP_Title )
    EndIf
    
    Last edited by ReneMiner; 05-09-2015 at 12:48.
    I think there are missing some Forum-sections as beta-testing and support

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


    I think that is a bug. They should return the correct name even if it is bundled. I will fix it.
    I will try to add a new App_ function able to return current running mode: open source code, obfuscated souce code, bundled executable code.
    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

  3. #3
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    55
    Posts
    1,554
    Rep Power
    174
    too bad, i thought i've found a huge bag of wisdom...

    So you might delete this "Do you know..." and move the content to your to-do-list or support
    I think there are missing some Forum-sections as beta-testing and support

  4. #4
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10
    I've fixed this problem and developed 3 more functions.

    APP_IsBundled will return %TRUE/%FALSE if current script is executed from a bundled executable
    APP_IsIsolated will return %TRUE/%FALSE if current script is executed from a bundled executable and execution is taking place from an isolation path (currently always %TRUE but not sure for future option, maybe in future versions execution will take place 100% from memory and not from disk)
    APP_IsolationPath will return the full path where a bundled executable export bundled modules / dlls


    APP_Name function is now aware if script is executed from source code or from bundled executable
    APP_ScriptFullName function is now aware if script is executed from source code or from bundled executable

    Very shortly a 1.9.16 version to test.
    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

Similar Threads

  1. UI: How to detect minimizing of Dialog?
    By ReneMiner in forum UI (User Interface)
    Replies: 7
    Last Post: 23-08-2013, 12:16
  2. Help me: test this bundled Exe
    By ErosOlmi in forum thinBasic vaporware
    Replies: 4
    Last Post: 09-06-2013, 23:36
  3. How to detect if dialog is maximized and set maximized at runtime?
    By Michael Hartlef in forum UI (User Interface)
    Replies: 2
    Last Post: 03-10-2008, 17:25
  4. DIR_GetCurrent behaves different with a bundled EXE
    By Michael Hartlef in forum File
    Replies: 13
    Last Post: 19-05-2008, 10:36

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
  •