{"id":3764,"date":"2016-01-26T12:00:55","date_gmt":"2016-01-26T11:00:55","guid":{"rendered":"http:\/\/www.samlogic.net\/blog\/?p=3764"},"modified":"2019-07-07T18:25:41","modified_gmt":"2019-07-07T18:25:41","slug":"new-setup-dialog-box-in-visual-installer-user-options","status":"publish","type":"post","link":"https:\/\/www.samlogic.net\/blog\/2016\/01\/new-setup-dialog-box-in-visual-installer-user-options\/","title":{"rendered":"New setup dialog box in Visual Installer: User Options"},"content":{"rendered":"<p>We have added a new setup dialog box to the Professional version of <a href=\"https:\/\/www.samlogic.net\/visual-installer\/visual-installer.htm\" target=\"_blank\" rel=\"noopener noreferrer\">Visual Installer<\/a>. The name of the dialog box is <strong>User Options<\/strong> and it is a general dialog box where the user can select and unselect options that you add to the setup project. These options co-operates with conditional statements in Visual Installer&#8217;s scripting language and with Visual Installer&#8217;s <strong>Registry<\/strong> tab. Below is an example of how the <strong>User Options<\/strong> setup dialog box may look like and how it can be used:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.samlogic.net\/blog\/images\/product-visual-installer\/vi-setup-dialogbox-user-options-win7.png\" alt=\"\" border=\"0\"><\/p>\n<p>In the example above we have added three options to the setup dialog box. The user can select and unselect the options of his\/her choice.<\/p>\n<p>To activate this dialog box, you need first open the <strong>Dialog boxes<\/strong> tab in Visual Installer&#8217;s editor and check the <strong>User options<\/strong> option:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.samlogic.net\/blog\/images\/product-visual-installer\/visual-installer-tab-dialogboxes-user-options-cropped.png\" alt=\"\" border=\"0\"><\/p>\n<p>Then you can click on the button marked &#8220;&#8230;&#8221; to the right of the option. This will open a new dialog box in the Visual Installer editor with the title <strong>User Options<\/strong>. Below we have filled the dialog box with the text and options that is needed to create the setup dialog box in the example above:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.samlogic.net\/blog\/images\/product-visual-installer\/visual-installer-dialogbox-user-options.png\" alt=\"\" border=\"0\"><\/p>\n<p>As you see, it is very easy to create a setup dialog box with your own options. You just need to enter a title, a short description text and your options. And it is done!<\/p>\n<p><span style=\"color: #000080;\"><strong>Co-operates with Visual Installer&#8217;s scripting language and &#8216;Registry&#8217; tab<\/strong><\/span><br \/>\nThe main purpose of this new option dialog box is to let the end-user decide which script lines to execute and which keys and values to add to the Registry, during the setup process. This is a more flexible way to handle user choices than file components (file groups) because you don&#8217;t necessary need to copy files based on user choices; instead you can use Visual Installer&#8217;s whole scripting language to do whatever you want. This is useful if some special operations must be done, based on user choices.<\/p>\n<p>Below we show how Visual Installer&#8217;s scripting language can co-operate with the <strong>User Options<\/strong> dialog box:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.samlogic.net\/blog\/images\/product-visual-installer\/visual-installer-script-if-option.png\" alt=\"\" border=\"0\"><\/p>\n<p>And below we show how the <strong>Registry<\/strong> tab in Visual Installer can co-operate with the <strong>User Options<\/strong> dialog box:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.samlogic.net\/blog\/images\/product-visual-installer\/visual-installer-tab-registry-if_option-2.png\" alt=\"\" border=\"0\"><\/p>\n<p><span style=\"color: #000080;\"><strong>Scripting language<\/strong><\/span><br \/>\nIn Visual Installer&#8217;s <a href=\"https:\/\/www.samlogic.net\/visual-installer\/tips\/tips-pages\/visual-installer-scripting-language\/visual-installer-scripting-language.htm\" target=\"_blank\" rel=\"noopener noreferrer\">scripting language<\/a> we have added a new condition check, <strong>IF OPTION(<em>n<\/em>)<\/strong>, that can be used to check which options the user has selected in the <strong>User Options<\/strong> setup dialog box. We have added a similar condition check to Visual Installer&#8217;s <strong>Registry<\/strong> tab: <strong>IF_OPTION(<em>n<\/em>)<\/strong>.<\/p>\n<p>The <strong>IF OPTION(<em>n<\/em>)<\/strong> condition in the script language can check both if an option is <strong>ON<\/strong> (selected) or <strong>OFF<\/strong> (unselected). So for example to examine if option 2 was selected by the end-user, you can enter the following condition:<\/p>\n<p><strong>IF OPTION(2)=ON<\/strong><br \/>\n&#8230;<br \/>\n<strong>END IF<\/strong><\/p>\n<p>If you for example need to examine if option 3 was not selected, you can enter the following condition:<\/p>\n<p><strong>IF OPTION(3)=OFF<\/strong><br \/>\n&#8230;<br \/>\n<strong>END IF<\/strong><\/p>\n<p><span style=\"color: #000080;\"><strong>&#8216;Registry&#8217; tab<\/strong><\/span><br \/>\nThe condition check in the <strong><a href=\"https:\/\/www.samlogic.net\/visual-installer\/visual-installer-details-registry.htm\" target=\"_blank\" rel=\"noopener noreferrer\">Registry<\/a><\/strong> tab works in a similar way. <strong>IF_OPTION(<em>n<\/em>)<\/strong> or <strong>IF_OPTION(<em>n<\/em>)=ON<\/strong> can be used to examine if an option was selected by the end-user. <strong>IF_OPTION(<em>n<\/em>)=OFF<\/strong> can be used to check if an option was not selected.<\/p>\n<p>If you use <strong>IF_OPTION(<em>n<\/em>)<\/strong> and the option number <em>n<\/em> was selected by the end-user, the key or value will be added to the registry. The example below shows how to examine if option number 1 is selected, and if yes, add a value to registry:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.samlogic.net\/blog\/images\/product-visual-installer\/visual-installer-tab-registry-if_option-1.png\" alt=\"\" border=\"0\"><\/p>\n<p><strong>See also<\/strong><br \/>\n<strong><span style=\"color: #ff0000;\">&gt;<\/span><\/strong> <a href=\"https:\/\/www.samlogic.net\/visual-installer\/tips\/tips-pages\/user-options\/user-options.htm\">Tip: How to use the &#8216;User Options&#8217; dialog box with script<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We have added a new setup dialog box to the Professional version of Visual Installer. The name of the dialog box is User Options and it is a general dialog box where the user can select and unselect options that you add to the setup project. These options co-operates with conditional statements in Visual Installer&#8217;s &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.samlogic.net\/blog\/2016\/01\/new-setup-dialog-box-in-visual-installer-user-options\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;New setup dialog box in Visual Installer: User Options&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10,15],"tags":[],"_links":{"self":[{"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/posts\/3764"}],"collection":[{"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/comments?post=3764"}],"version-history":[{"count":1,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/posts\/3764\/revisions"}],"predecessor-version":[{"id":6056,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/posts\/3764\/revisions\/6056"}],"wp:attachment":[{"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/media?parent=3764"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/categories?post=3764"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/tags?post=3764"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}