{"id":4313,"date":"2016-08-24T14:00:28","date_gmt":"2016-08-24T13:00:28","guid":{"rendered":"http:\/\/www.samlogic.net\/blog\/?p=4313"},"modified":"2019-07-08T12:28:11","modified_gmt":"2019-07-08T12:28:11","slug":"the-reg1-to-reg5-variables-in-visual-installer","status":"publish","type":"post","link":"https:\/\/www.samlogic.net\/blog\/2016\/08\/the-reg1-to-reg5-variables-in-visual-installer\/","title":{"rendered":"The %REG1 to %REG5 variables in Visual Installer"},"content":{"rendered":"<p><img decoding=\"async\" class=\"alignright\" src=\"https:\/\/www.samlogic.net\/pad\/icons\/visual_installer.gif\" alt=\"\" border=\"0\">In this <a href=\"https:\/\/www.samlogic.net\/blog\/2016\/07\/variables-in-visual-installer\/\">blog post<\/a> we explained how to use variables in <a href=\"https:\/\/www.samlogic.net\/visual-installer\/visual-installer.htm\" target=\"_blank\" rel=\"noopener noreferrer\">Visual Installer<\/a>. Many variables get their values automatically from known locations in Windows Registry, but there are also some variables in Visual Installer that can obtain their values from locations in Windows Registry that <em>you<\/em> specify.<\/p>\n<p><strong>The %REG1 to %REG5 variables<\/strong><br \/>\nThere are five variables in Visual Installer that can obtain their values from keys and value names in the Windows Registry that you specify. They have the following names: <strong>%REG1<\/strong>, <strong>%REG2<\/strong>, <strong>%REG3<\/strong>, <strong>%REG4<\/strong>, and <strong>%REG5<\/strong>.<\/p>\n<p><strong>How to specify a location in Registry to read<\/strong><br \/>\nTo specify a key and value name in the Registry for any of these variables, you must first open the <strong>Variables<\/strong> dialog box in Visual Installer&#8217;s editor. You can do this by first opening the <strong>Registry<\/strong> or <strong>INI files<\/strong> tab in Visual Installer&#8217;s editor, and then click on the <strong>Variables<\/strong> button, that is located at the bottom right of the editor:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.samlogic.net\/blog\/images\/product-visual-installer\/vi-editor-tab-registry-button-variables.png\" alt=\"The Variables button\" border=\"0\"><\/p>\n<p>The following dialog box will be opened if you click on the button:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.samlogic.net\/blog\/images\/product-visual-installer\/vi-dialogbox-variables-1.png\" alt=\"List with variables\" border=\"0\"><\/p>\n<p>If you scroll to the bottom of the list, you will find the <strong>User variables<\/strong> section:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.samlogic.net\/blog\/images\/product-visual-installer\/vi-dialogbox-variables-2.png\" alt=\"List with variables - The User variables section\" border=\"0\"><\/p>\n<p>As default, these variables are empty but you can specify a key and value name for them by clicking on the <strong>Change values<\/strong> button (in the bottom left), and then specify the information in the <strong>Change contents for variables<\/strong> dialog box that is opened:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.samlogic.net\/blog\/images\/product-visual-installer\/vi-dialogbox-change-contents-for-variables-1.png\" alt=\"The 'Change contents for variables' dialog box\" border=\"0\"><\/p>\n<p>To specify a key and value for example for the <strong>%REG1<\/strong> variable, you need to enter the information at the <strong>%REG1<\/strong> text box in the <strong>User variables<\/strong> section. For example like this:<\/p>\n<p><span style=\"color: #008000;\">HKEY_LOCAL_MACHINE\\SOFTWARE\\SamLogic\\Visual Installer\\10.5 :: Path<\/span><\/p>\n<p>&#8220;<span style=\"color: #008000;\">HKEY_LOCAL_MACHINE\\SOFTWARE\\SamLogic\\Visual Installer\\10.5<\/span>&#8221; is the key and &#8220;<span style=\"color: #008000;\">Path<\/span>&#8221; is the value name. You can read more about this format in Visual Installer&#8217;s <a href=\"https:\/\/www.samlogic.net\/visual-installer\/pdf\/VI.pdf\" target=\"_blank\" rel=\"noopener noreferrer\">User Guide<\/a>.<\/p>\n<p>In the picture below we have specified keys and values for both the <strong>%REG1<\/strong> variable and the <strong>%REG2<\/strong> variable:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.samlogic.net\/blog\/images\/product-visual-installer\/vi-dialogbox-change-contents-for-variables-3.png\" alt=\"A key and value name has been specified for the REG1 and REG2 variables\" border=\"0\"><\/p>\n<p>You can click <strong>OK<\/strong> to save the keys and value names. In the <strong>Variables<\/strong> dialog box you will now see the information that you entered in the previous dialog box in the <strong>Contents<\/strong> column of the variable list. You can also see the current value for the variable (that is read from the Registry) by hovering the mouse pointer over the variable name, as shown in the picture below:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.samlogic.net\/blog\/images\/product-visual-installer\/vi-dialogbox-variables-3.png\" alt=\"Shows the tip text function\" border=\"0\"><\/p>\n<p>During the installation, the <strong>%REG1<\/strong> to <strong>%REG5<\/strong> variables will read its contents from the end-users Registry. If no contents is available, the variables will be empty.<\/p>\n<p><strong>See also<\/strong><br \/>\n<strong><span style=\"color: #ff0000;\">&gt;<\/span><\/strong> <a href=\"https:\/\/www.samlogic.net\/blog\/2016\/08\/your-projects-bitness-affects-where-the-reg1-to-reg5-variables-get-their-values\/\">Your project\u2019s bitness affects where the %REG1 to %REG5 variables get their values<\/a><br \/>\n<strong><span style=\"color: #ff0000;\">&gt;<\/span><\/strong> <a href=\"https:\/\/www.samlogic.net\/blog\/2016\/07\/variables-in-visual-installer\/\">Variables in Visual Installer<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog post we explained how to use variables in Visual Installer. Many variables get their values automatically from known locations in Windows Registry, but there are also some variables in Visual Installer that can obtain their values from locations in Windows Registry that you specify. The %REG1 to %REG5 variables There are five &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.samlogic.net\/blog\/2016\/08\/the-reg1-to-reg5-variables-in-visual-installer\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;The %REG1 to %REG5 variables in Visual Installer&#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":[6,15],"tags":[],"_links":{"self":[{"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/posts\/4313"}],"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=4313"}],"version-history":[{"count":2,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/posts\/4313\/revisions"}],"predecessor-version":[{"id":6219,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/posts\/4313\/revisions\/6219"}],"wp:attachment":[{"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/media?parent=4313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/categories?post=4313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/tags?post=4313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}