Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Join Date
    May 2008
    Location
    Slovakia, Bratislava
    Posts
    16

    Lua script action is not executed via DoAction on button click

    I have custom action called SetupSummary whic is run lua script. On this action there is no timing set.

    On dialog WelcomeScreen on button Next, in Published Events i add event DoAction with argument set to SetupSummary (name of custom action) and place it at first place before NewDialog event.

    Now i wait that lua script is executed when i press Next, but script is not executed.

    When i do same as above but custom action is Run Executable and run for example notepad.exe everything works like a charm and notepad is opened after i press Next button.

    Can you confirm that this behavior is a bug, or explain to me how to execute custom action of type Run LuaScript on button click?

  2. #2
    Join Date
    May 2008
    Location
    Slovakia, Bratislava
    Posts
    16
    I test same scenario in custom action but for VB Script, and its working OK.

    This is the testing VB Script:
    Code:
    MsgBox "Hello from VB Script ", vbCritical, "Test"
    but custom action of type Run LuaScript does not executed.

    Any help will be appreciated.

  3. #3
    Join Date
    Feb 2001
    Location
    Indigo Rose Software
    Posts
    2,728
    What are the contents of the Lua script file you're running?

    (Note: it needs to contain a valid Lua script, not VB commands -- Lua is an interpreted scripting language with a different syntax from VB.)
    --[[ Indigo Rose Software Developer ]]

  4. #4
    Join Date
    May 2000
    Location
    Indigo Rose Software
    Posts
    2,150
    I was able to get this working with a simple hello world lua script:

    Code:
    Dialog.Message("","Hello world");
    So this makes me think the issue is with your Lua script. What is included in the script? It could be being launched but an error occurs so it appears to not launch?

    Adam Kapilik

  5. #5
    Join Date
    May 2008
    Location
    Slovakia, Bratislava
    Posts
    16
    I have a valid LUA script, not VB. I just wrote that if i have valid VB script, then it is working, but executing valid LUA script in Run LuaScript does not works for me.

    Se attached demo, a try to help me out where is the problem, pls.
    LUA_TEST1.ZIP

  6. #6
    Join Date
    Feb 2001
    Location
    Indigo Rose Software
    Posts
    2,728
    There is no DoAction event published on the Next button on your Welcome dialog. All I see there is the original NewDialog event. (See the attached screenshot.)

    I added a DoAction with EXEC_LUA as the argument to the Next button in your project and it worked -- I got the "Hello World" dialog when I clicked Next.
    Attached Images
    --[[ Indigo Rose Software Developer ]]

  7. #7
    Join Date
    May 2008
    Location
    Slovakia, Bratislava
    Posts
    16

    Cool

    In my posted example, i havent event on Next button on Welcome dialog but on second dialog LicenseAgreementDlg have placed new button Exec LUA and there is event DoAction. And this is not executed. Sorry for missunderstanding.

    But i think there is an bug.
    Check my updated example LUA_TEST1b.ZIP.

    When i set DoAction on Next button on first dialog in First Install sequence (WelcomeDlg) to execute lua script, then this script is executed and all other lua scripts on other dialogs are also executed, like in my example on second dialog on button Exec LUA. But when first dialog does not execute any lua script, or have condition 0 (which does not execute lua script also) then executions of others lua scripts on other than first dialog are not functional.

    See my example, on WelcomeDlg, Next button, there is DoAction, but have condition 0, on second LicenseAgreementDlg, there is Exec LUA button which have DoAction. When you build and run this setup, no lua script is executed. Now try change condition to 1 of DoAction on WelcomeDlg, build and run and you will see that lua script is executed on Next button click on first dialog, but also click on Exec LUA is also executed.

    Can you confirm, that is bug, or am i still doing something wrong?

  8. #8
    Join Date
    May 2008
    Location
    Slovakia, Bratislava
    Posts
    16

    Thumbs up

    I found workaround for this , but i think its definitely bug.
    When i generate WIX files, in file msifactui.wxs i found within button element this sub element (which is probably auto-generated by MSI Factory):
    Code:
    <Publish Property="RUNLUAFILE" Value="lua1.lua">1</Publish>
    on first occurrence of running lua script (on button click in first dialog), but on next occurrences of executing lua script on published events with DoAction, there is missing such element, and this it is not executed.

    When i manually add published evet to create property with name RUNLUAFILE and value set to file name of lua script(without path) e.g. lua1.lua and place this published property at first place before DoAction event, then everything is ok and lua script is executed.

    Another hint is that, if you want to execute lua script action e.g. EXEC_LUA1 (which is in file lua1.lua) in first dialog, and in second dialog want to execute another lua script action e.g. EXEC_LUA2 (which is in another file lua2.lua) then each published property RUNLUAFILE must have different value for file (lua1.lua for this published property, lua2.lua for second published property)

    Can you confirm this? I can work with this workaround, but if it is bug, that this could be fixed quickly i think.

  9. #9
    Join Date
    Feb 2001
    Location
    Indigo Rose Software
    Posts
    2,728
    A condition of 0 evaluates to false, and will not be performed. (Note that the RUNFLUAFILE property's condition matches that of the DoAction event.)

    I believe the RUNLUAFILE property tells the LuaScript.dll what file to execute. I don't know why it isn't being added for both controls...it does look like a bug.

    For example, if you set up a second Run LuaScript custom action to run a different lua file, no RUNLUAFILE property is added before its DoAction event either.

    I've logged it for investigation. REF: 17412
    --[[ Indigo Rose Software Developer ]]

Similar Threads

  1. Building pages from script
    By Roboblue in forum AutoPlay Media Studio 7.5
    Replies: 23
    Last Post: 02-28-2008, 10:31 AM
  2. Stuck again ! - button state changes from script
    By qwerty in forum AutoPlay Media Studio 6.0
    Replies: 1
    Last Post: 07-09-2007, 05:12 PM
  3. Example: Creating an on/off button to toggle background audio
    By Jonas DK in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 07-10-2004, 02:54 PM
  4. INFO: Tips for Debugging Action Lists in AutoPlay Media Studio 4.0
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-03-2002, 08:38 AM
  5. SUF6.0.0.2 -- installer hangs.
    By jassing in forum Setup Factory 6.0
    Replies: 4
    Last Post: 12-19-2001, 11:28 PM

Posting Permissions

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