+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Run setup.exe in silent mode and provide responses to dialogs

Hybrid View

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

    Question Run setup.exe in silent mode and provide responses to dialogs

    Hello,

    I can't seem to find this information in the documentation and forums. I have a SetupBuilder installer that needs to run in silent mode. Using the setup.exe /S switch works but it just runs through the installer with all the default selections. I need to be able to provide different responses in some of the dialogs, such as server name and DB name.

    In InstallShield, this is achieved by using the -r switch to run the installer in "recording" mode which creates a setup.iss response file to use in subsequent silent installations. Is there similar functionality in SetupBuilder?

    Thanks in advance,

    Svetlana

  2. #2
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Run setup.exe in silent mode and provide responses to dialogs

    Svetlana,

    You have several different options. For example, you can use the command line interface to set runtime variables.

    Let us assume, you have a %SERVER_NAME% runtime variable which holds the name of the server.

    The command line to set the server name would look like this:

    setup.exe /V SERVER_NAME "This_is_the_server_name"

    Or, if you would like to use a "response file", you can use the "Get INI Value..." function to read all your stuff from a file.

    I have developed and uploaded a source code demo for you:

    http://www.lindersoft.com/projects/r..._file_demo.zip

    Does this help?

    Friedrich
    Attached Images Attached Images  

  3. #3

    Default Re: Run setup.exe in silent mode and provide responses to dialogs

    Hi Friedrich,

    Thank you for your prompt reply and the code sample. I think for our purposes here, the command line option will be more convenient. I will try that and post an update when possible.

    Svetlana

  4. #4

    Post Re: Run setup.exe in silent mode and provide responses to dialogs

    Hello Friedrich,

    Thanks again for your reply. I tried the suggested command line switch, however, it does not produce the desired result and I could not find any logs to help me troubleshoot what went wrong. Is the /E switch supposed to enable logging in the Application Event Log?

    This is the command I used, from a windows batch file:

    call "C:\Setup\MySetup.exe" /S /V W_DSERVER "MyServer" W_DBNAME "MyDB" /E

    I need to set two runtime variables, is this the correct syntax for passing the two values? I also tried /V W_DSERVER "MyServer" /V W_DBNAME "MyDB" with the same result. The installer screens are all displaying in the correct order and it appears to be running database scripts, but apparently not on the correct database.

    Thanks,

    Svetlana

  5. #5
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Run setup.exe in silent mode and provide responses to dialogs

    Quote Originally Posted by Svetlana View Post
    call "C:\Setup\MySetup.exe" /S /V W_DSERVER "MyServer" W_DBNAME "MyDB" /E
    It should be:

    C:\Setup\MySetup.exe" /S /V W_DSERVER "MyServer" /V W_DBNAME "MyDB"

    You can send us your project file and we'll check your script (I assume you have a problem in your script logic).

    Friedrich

  6. #6

    Post Re: Run setup.exe in silent mode and provide responses to dialogs

    Hi Friedrich,

    I tried removing the /E switch and using two /V switches as you suggested but still no improvement.

    I would rather not send the .sb7 project due to intellectual property issues (we use it in production.) One thing I noticed today is the installer normally creates logs for the database upgrade but it didn't create them this time. It did unpack the sql scripts correctly to the hard drive but apparently did not run them at all.

    I will try adding some more error logging to the script and troubleshoot from there. Thanks for your suggestions.

  7. #7
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Run setup.exe in silent mode and provide responses to dialogs

    Hello,

    No problem. If you are interested, you can create and send us a simple demo .sb7 project that reproduces this problem and we'll fix it in that project for you so you can see how this works.

    Our support email address is support [at] lindersoft [dot] com.

    Friedrich

  8. #8
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Run setup.exe in silent mode and provide responses to dialogs

    Svetlana,

    We have developed and uploaded another example for you.

    http://www.lindersoft.com/projects/ctest.zip

    Unzip to a temporary folder and run the cbatch.bat batch file. It will execute the ctest.exe and then pass the following to the application:

    ctest.exe /S /V W_DSERVER "MyServer" /V W_DBNAME "MyDB"

    The ctest.exe will display the variable values.

    Does this help?

    Friedrich

  9. #9

    Post Re: Run setup.exe in silent mode and provide responses to dialogs

    Hello Friedrich,

    That was very helpful, thank you!

    I added the message box as you suggested and all the variables are being displayed with the correct values. However, the silent install is still not going through.

    After tinkering with this for a while, the only possibility I can think of is that the EULA dialog is breaking the silent install because we have the "I do not accept" option pre-selected. We do not explicitly mention this dialog in the script so I'm not sure how the silent installation handles it but I would assume it takes the default "I do not accept" value so the code after that point is simply not executed.

    So I would need something like this:

    If %_SB_DIALOGID% Equals "$DLG_EULA$" And %_SB_INSTALLERFLAG%Equals "1" on Position "$SB_SILENTMODEFLAG$" Then
    Set Variable %MY_VARIABLE% to "I accept"

    I am not sure what the variable name and value should be in the above example. Is there a way to expose the code for the EULA dialog? All I have been able to access is the GUI editor under Setup Appearance - Dialogs. It seems the EULA dialog does not have the "Store selection in variable" capability of the standard Radio Button dialog. So if I am not mistaken, in order to use the code above, I would need to rewrite our License agreement dialog to use the Radio Button template rather than the EULA. Does that make sense?

    Thanks in advance,

    Svetlana

  10. #10
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Run setup.exe in silent mode and provide responses to dialogs

    Svetlana,

    What about this solution (see attached screenshot) If it is running in silent mode, the License Agreement dialog is not displayed.

    Friedrich
    Attached Images Attached Images  

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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