Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: A few more Questions

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default A few more Questions

    Friedrich,

    I got a few more questions - maybe you can point me in the right direction:

    1. In the ClarionSelectDialog - it seems like you cannot detect Clarion
    versions based on a CompileVariable? Ideally I would like to pass a
    parameter to the compiler such as 55|60|61|62 and it detects C5.5, C6.0,
    C6.1, C6.2, or 50|55 and it only detects the existance of Clarion 5 and
    C5.5. I guess I'll need to continue down the road of creating my own
    RadioDialog window for the clarion select?

    2. I can't seem to find anything of this nature in the help, but I thought
    it might be worth a shot. Is there a function out the box to edit the RED
    file? Or should I create my own set of functions using the INI read\write?

    3. I'm looking for a way of adding shortcuts to the windows start menu -
    based on whether the program exists or not. IOW - loop through the files in
    the (e.g. _SB_INSTALLDIR\bin) and place a link for each EXE that's
    installed. The clarion equivalent would look something like:

    directory(filesq, _SB_INSTALLDIR & '\bin\*.exe',)
    loop Counter = 1 to records(filesq)
    get(filesq,Counter)
    do AddShortCutToStartMenu
    end

    Anyway of doing that?

    4. Failing the possibility of Q3, is there a way to conditionally include a
    script (based on a passed parameter)? I guess I could work around this, but
    conditional inclusion would be simpler. Also related to this - is there a
    way of including a script that contains a Compiler variable - e.g.
    [PRODUCTNAME]script.sbi?

    Thanks a ton for the help

    Geoff (Capesoft)

  2. #2

    Default Re: A few more Questions

    Geoff,

    > I got a few more questions - maybe you can point me in the right
    > direction:
    >
    > 1. In the ClarionSelectDialog - it seems like you cannot detect Clarion
    > versions based on a CompileVariable? Ideally I would like to pass a
    > parameter to the compiler such as 55|60|61|62 and it detects C5.5, C6.0,
    > C6.1, C6.2, or 50|55 and it only detects the existance of Clarion 5 and
    > C5.5. I guess I'll need to continue down the road of creating my own
    > RadioDialog window for the clarion select?

    The "Clarion Environment Detection" dialog can only detect Clarion versions
    defined in "Supported Version" (check boxes).

    But hey, we are talking about SetupBuilder 5, so there is a solution
    available <bg>

    Please see the "Detect Clarion Versions Demo 1.sb5" example. It makes use
    of the "Detect Clarion Versions.sbi" include script.

    You can modify it to fit your own needs. For example, define a WHICHVERSION
    symbol (#def / Get value from compile command line) and based on that
    "symbol" decide which version to detect.

    #def WHICHVERSION = (Command Line)

    #ifdef WHICHVERSION Equals "1" Then
    #def C63 = 1
    #def C62 = 1
    #def C61 = 1
    #def C60 = 1
    #def C55 = 1
    #def C50 = 1
    #end

    #ifdef WHICHVERSION Equals "2" Then
    #def C63 = 1
    #def C62 = 0
    #def C61 = 0
    #def C60 = 0
    #def C55 = 0
    #def C50 = 0
    #end

    If you pass "1" then it detects all Clarion versions. Pass "2" to only
    detect Clarion 6.3. Etc.

    Then use the following to call from the command line:

    sbuilder.exe /C "c:\test\Detect Clarion Versions Demo 1.sb5" /DS
    WHICHVERSION "2"

    BTW, the new SetupBuilder 5 build is nearly code complete. It now creates
    a compiler.txt file if there was a compile error. The log file is located
    in the same directory as the sbuilder.exe file. Interesting feature if you
    compile from the command line.

    > 2. I can't seem to find anything of this nature in the help, but I thought
    > it might be worth a shot. Is there a function out the box to edit the RED
    > file? Or should I create my own set of functions using the INI read\write?

    You can use the "Text File Operations" script function.

    > 3. I'm looking for a way of adding shortcuts to the windows start menu -
    > based on whether the program exists or not. IOW - loop through the files
    > in the (e.g. _SB_INSTALLDIR\bin) and place a link for each EXE that's
    > installed. The clarion equivalent would look something like:
    >
    > directory(filesq, _SB_INSTALLDIR & '\bin\*.exe',)
    > loop Counter = 1 to records(filesq)
    > get(filesq,Counter)
    > do AddShortCutToStartMenu
    > end
    >
    > Anyway of doing that?

    Yes, this would be possible, but how to set the correct "shortcut text"?
    For example, if it finds sbuilder.exe then it's not a good idea to display
    sbuilder.exe as shortcut text.

    > 4. Failing the possibility of Q3, is there a way to conditionally include
    > a script (based on a passed parameter)? I guess I could work around this,
    > but conditional inclusion would be simpler. Also related to this - is
    > there a way of including a script that contains a Compiler variable - e.g.
    > [PRODUCTNAME]script.sbi?

    Yes, you can conditionally include a script (see technique used in 1.).

    Using compiler variables in the #include function is not possible. But I
    think it's a good idea. I'll see what we can do here.

    Does this help?

    Friedrich

    Friedrich Linder
    CEO, Lindersoft
    www.lindersoft.com
    +1.954.252.3910

    "point. click. ship" - that's SetupBuilder 5

  3. #3

    Default Re: A few more Questions

    Friedrich,

    Thank very much - you've given me enough to chew on <g>.

    Geoff

  4. #4

    Default Re: A few more Questions

    Friedrich,

    >> 3. I'm looking for a way of adding shortcuts to the windows start menu -
    >> based on whether the program exists or not. IOW - loop through the files
    >> in the (e.g. _SB_INSTALLDIR\bin) and place a link for each EXE that's
    >> installed. The clarion equivalent would look something like:
    >>
    >> directory(filesq, _SB_INSTALLDIR & '\bin\*.exe',)
    >> loop Counter = 1 to records(filesq)
    >> get(filesq,Counter)
    >> do AddShortCutToStartMenu
    >> end
    >>
    >> Anyway of doing that?
    >
    > Yes, this would be possible,
    Any chance of a pointer or two? I've look through all the Script functions
    and can't seem to figure a way of doing this (i.e. of looping through exes
    and figuring out what shortcuts to create from a simple loop.

    Thanks
    --
    Geoff

    Capesoft - taking you higher and further

    www.capesoft.com

  5. #5

    Default Re: A few more Questions

    Geoff,

    Would it be cool to directly use native Clarion code in SB5 to handle this
    <g>

    If you are interested, I can send you (or post) the source code to handle
    this.

    Friedrich

    --
    Friedrich Linder
    CEO, Lindersoft
    www.lindersoft.com
    +1.954.252.3910

    "point. click. ship" - that's SetupBuilder 5

  6. #6

    Default Re: A few more Questions

    Geoff,

    I have created a simple demo for you.

    We have two Clarion functions:

    ! -----------------------------------------------------------------------------

    1. LoadDirectory - Pass a folder from the installer to the function and load
    all .exe files located in the \Bin subfolder. Return the number of items to
    the installer.

    ! Call Function
    LOADDIRECTORY FUNCTION(SB_INSTALLDIR)
    SearchFor CSTRING(260)
    CODE
    SearchFolder = SB_INSTALLDIR
    SearchFor = SearchFolder & '\bin\*.exe'
    DIRECTORY(FilesQ, SearchFor,0)

    ! Return found items to installer
    RETURN RECORDS(filesq)


    2. GetItem - Pass item number from the installer to the function and
    retrieve a specific item from the QUEUE.

    ! Call Function
    GETITEM FUNCTION(ItemNo, ItemResult)
    CODE

    GET(FilesQ, ItemNo)
    IF ERRORCODE() THEN RETURN 0.

    ItemResult = CLIP(SearchFolder) & '\' & CLIP(FilesQ:name)

    ! Return to installer
    RETURN 1

    ! -----------------------------------------------------------------------------

    Then we can call the above functions from the installer script:

    ! Load Library
    Set Variable %DLLHANDLE% to ScriptItem->Load DLL("%TMPDIR%\sbdll3.dll")

    ! Set variable value
    Set Variable %_SB_INSTALLDIR% to c:\5

    ! Call into 3rd party DLL (developed with Clarion 6)
    Call DLL "%DLLHANDLE%" -- Function "LOADDIRECTORY" (*CSTRING)
    (%_SB_INSTALLDIR%)

    ! %ITEMNO% includes number of items
    Set Variable %ITEMNO% to %_SB_RETURN%

    ! Initialize %ITEMNAME%
    Set Variable %ITEMNAME% to ""
    If %ITEMNO% Greater Than "0" Then
    Set Variable %GETITEMNO% to 0
    Loop (%ITEMNO% Times)
    Set Variable %GETITEMNO% to (Increment Variable by 1)
    Call DLL "%DLLHANDLE%" -- Function "GETITEM" (LONG,*CSTRING)
    (%GETITEMNO%,%ITEMNAME%)
    ! Handle action
    Display Message Box "Item Number: %GETITEMNO%\n\nDo this and that with
    ...." -- ""
    End
    End

    ! Free Library
    Free DLL "%DLLHANDLE%"

    ! -----------------------------------------------------------------------------

    I have attached the dll source code and the installer script.

    1. Unzip "sbdll3.zip" and compile the code.
    2. Copy the resulting sbdll3.dll into your SetupBuilder 5 \Lib folder
    3. Unzip "Call Dll Demo 3.zip" and open "Call Dll Demo 3.sb5"
    4. Set the "search in" variable value in the following line:

    Set Variable "%_SB_INSTALLDIR% to c:\5"

    5. Compile and run the script.

    What do you think?

    Friedrich

    Friedrich Linder
    CEO, Lindersoft
    www.lindersoft.com
    +1.954.252.3910

    "point. click. ship" - that's SetupBuilder 5
    Attached Files Attached Files

  7. #7

    Default Re: A few more Questions

    Friedrich,

    Wow thanks - I'll give it a spin tonight.

    --
    Geoff

    Capesoft - taking you higher and further

    www.capesoft.com

  8. #8

    Default Re: A few more Questions

    Friedrich,

    This is really the max!!!!! This has opened up some serious possibilities!!!
    Thanks a ton. I did some playing last night, and have started putting some
    more functionality into the DLL. This has helped big time, thanks a ton.

    I've basically scratched everything off the list - except for modding the
    path (which I haven't looked into yet, but should be pretty standard), and
    then I'm sorted.

    Thanks a ton.

    --
    Geoff

    Capesoft - taking you higher and further (with SetupBuilder 5 <g>)

    www.capesoft.com

  9. #9

    Default Re: A few more Questions

    Friedrich,

    OK - I've fallen over my feet again (I think <g>). I can't quite figure out
    the Drop Target (CLSID) - maybe you can shed some light.

    Basically I want to add something to the path statement (on startup) like:

    path = %path% & ';d:\Clarion6\3rdparty\bin'

    I've found the Add app path command, but I'm not quite sure what I need the
    DropTarget for. Do I need to create that in the registry - otherwise would I
    need to look it up? I'm also not quite sure why I need a filename (it
    complains if I don't have one). Can you clarify this one? I guess I must be
    missing something obvious

    It doesn't seem to work without the DropTarget - so I guess that's not
    optional.

    Thanks for the assistance.

    --
    Geoff

    Capesoft - taking you higher and further

    www.capesoft.com

  10. #10

    Default Re: A few more Questions

    Geoff,

    I think what you are trying to do is to add the path (if it does not already
    exist) to the PATH environment variable, right?

    I would suggest to use the "Edit Environment Variable..." function. For
    example:

    Edit Environment Variable PATH = d:\Clarion6\3rdparty\bin

    Does this help?

    Friedrich

    --
    Friedrich Linder
    CEO, Lindersoft
    www.lindersoft.com
    +1.954.252.3910

    "point. click. ship" - that's SetupBuilder 5

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Newbie Questions
    By kenoneko in forum SetupBuilder
    Replies: 1
    Last Post: 10-05-2006, 09:34 AM
  2. SetupBuilder 5 questions
    By NewsArchive in forum SetupBuilder - NNTP
    Replies: 5
    Last Post: 02-16-2006, 10:31 AM
  3. WebUpdate Uninstall questions
    By linder in forum SetupBuilder - NNTP
    Replies: 3
    Last Post: 10-12-2005, 03:11 AM
  4. Web Update questions AFTER reading docs
    By NewsArchive in forum SetupBuilder - NNTP
    Replies: 4
    Last Post: 08-10-2005, 09:36 AM
  5. [REPOST] SB5 1042 questions
    By NewsArchive in forum SetupBuilder - NNTP
    Replies: 1
    Last Post: 02-23-2005, 04:10 AM

Posting Permissions

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