MSI: handling custom dialogs in Visual studio setup project

Posted on 2008-11-18
Last Modified: 2013-11-26
I have a custom dialog (with 2 radio buttons) in Visual Studio setup project
(2005). Is there anyway I can turn on/off showing the custom dialog based on
a registry key?

Basically, if a particular version of software is running (i am detecting
using a registry key) the custom dialog should not be shown, otherwise it
should be shown.

Thanks for the help.
Question by:vizagboy
    LVL 40

    Accepted Solution

    This would be easy in more capable MSI-authoring tool, but in Visual studio setup project there's only one ugly way I can think of: put in custom action; the action would analyze registry key anddisplay its own dialog. That however would occur already during theactual installation, not at the initial user interface steps. Another, no less ugly way would be to put custom dialog and specify property "visible" for its controls as the property resulting from the system search for your registry key; so it would show up anyways, but empty. You could put up a text like "this page is intentionally left blank", lol.

    Or you can patch resulting msi file with orca or other tool; figure out the place in the script where custom dialog is called, and put the condition such as "if property = ... then".

    Third option would be probably to realize that your requirements far exceed capabitilies of VS environment, and get  more capable tool; or ask to help with your project someone already possessing that tool - rather than continue to struggle yourself with new limitation every week.

    Author Comment

    Vadim..i didnt understand the first option. Custom actions are executed during install phase and the user interfaces are shown before the installation begins. How does the user interface know the registry key value?
    LVL 40

    Expert Comment

    by:Vadim Rapp
    That's what I said: user interface won't know. But if you can do whatever is the result of your custom dialog in the custom action (of which I have no idea), then it can ask and do it alltogether. For example, the following scenario is possible, and will work regardless of the phase.

    search for competitors software by registry key
    if found then
       show dialog and ask if the user wants to wipe it out for 10% discount on your product
       if yes, then wipe it out
    end if


    Author Closing Comment

    Looks like there is no straightforward solution in VS for this. Thanks for the information Vadim.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
    Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now