Page 1 of 1

Execute MSICode between dialogs

Posted: Thu Aug 05, 2010 3:02 am
by ctusch
Hello,

after the user has entered the install path I want to check if a specific file exists within that path and if not terminate the installation. My problem is that it seems like the MSICode within the dialog loop doesn't execute. Here is the snippet:

Code: Select all

  Display Dialog: destination, wait for dialog to return (modal)
  Does File Exist $TARGETDIR$\bin\Gops20.exe (get result into variable GOPS20EXEEXISTS)
  MessageBox: , $GOPS20EXEEXISTS$
  if Variable GOPS20EXEEXISTS not Equals TRUE
    MessageBox: Fehler, Um das Setup auszuführen, muss zuerst GOPS2 installiert werden.
    Terminate Installation
  end
  Comment: Display Dialog: startmenu, wait for dialog to return (modal)
  [compiler end]
  Display Dialog: startinstallation, wait for dialog to return (modal)
Not even the message box that should output the value of the variable shows up. How can I achieve my goal?

Re: Execute MSICode between dialogs

Posted: Thu Aug 05, 2010 5:31 am
by alibaba
Firstly I would use Camelot Plugin (writelog function) to see where the script stops and what values the variables have.

Gruß

Re: Execute MSICode between dialogs

Posted: Thu Aug 05, 2010 5:47 am
by ctusch
All dialogs appear as they should but the code in between the 'Display Dialog' commands doesn't seem to execute.

EDIT: I think I've found the cause of the problem. From the help: The wizard loop may only contain Display Dialog commands inside it and must be closed with an End command.

So how can I execute something after the user has specified a target directory?

EDIT2: I stumbled upon this post http://www.installaware.com/forum/viewt ... p?=&p=3182 and adjusted my project to use the more verbose version of the dialog logic. It works now.

Re: Execute MSICode between dialogs

Posted: Thu Aug 05, 2010 4:24 pm
by mills
Great! I'm glad you were able to resolve this.