none
installer with textboxes

    Question

  • I have textboxes with my installer and I pass those values to a function. How can I disable the next button on the installer until the textboxes have been filled out?

     

     

    Monday, July 17, 2006 10:29 PM

All replies


  • The only way to do that would be to edit the .MSI after it is built.  It's a bit advanced, but the built MSI and the Windows Installer documentation can help lead you to how to do it.

     

    Tuesday, July 18, 2006 5:19 AM
    Moderator
  • Can you point me in the direction of the documentation?

    I tried to open the .msi with Visual Studio 2005, but it trys to install the application.

    Tuesday, July 18, 2006 1:52 PM
  • There's a tool called Orca in the Platform SDK, install it from Orca.msi. You can use this to edit MSI contents. It's rather advanced, and you won't find much documentation about how to edit Dialogs and Controls in the UI because many tools provide UI design in their IDEs. You'll have to add a custom action to your Control that prevents the user going to the next dialog unless the textbox data is correct. This will give you the general idea:

    http://support.microsoft.com/kb/253683/en-us

    but the details are not accurate for new versions of Visual Studio.

    Wednesday, July 19, 2006 12:11 AM
  • I am downloading the SDK. I am assuming I can create the installer, for the service I created with Visual Studio, with the SDK?

    Pardon my ignorance when it comes to Windows applications. I work primarily with web applications.

    Thursday, July 20, 2006 9:12 PM
  • You'd build your MSI file with whatever you want, Visual Studio in your case. Then you open the MSI file with Orca and edit it, and Orca is a tool in the Platform SDK.
    Thursday, July 20, 2006 9:48 PM
  • g'day phil,

    regarding your post above regarding adding a custom action to the control to prevent the user going to the next dialog, I have couple of questions.

    If you were to add a custom action, say in the "install" section, it will only get executed after the installation phase is completed correct ? If it is correct, then how will your suggestion of a custom action work before the installation process.

    Also in the microsoft support example link you posted, the sample code uses the property, MsiSetProperty, to control whether the next button should be disabled or remain enabled. Is this property part of .net framework or do we have to do import the msi.dll library ?

    thanks
    Vee
    edit: should be msi.lib not msi.dll
    Thursday, July 20, 2006 10:37 PM
  • That kb article is about how to hook up a custom action to a button in the UI sequence so that the custom action validates the value of a property. You can actually run custom actions anywhere you want with Windows Installer (as you'd realise if you were using some other MSI-building tool). It's just that Visual Studio's custom actions are restricted to run at the end of the install. The point about using Orca is to edit the MSI file to add a custom action to the UI sequence because you can't do it with VS.

    That custom action is C++. You'd need to #include msiquery.h and link to msi.lib.

    Thursday, July 20, 2006 10:54 PM