{"id":4233,"date":"2016-07-11T22:19:05","date_gmt":"2016-07-11T21:19:05","guid":{"rendered":"http:\/\/www.samlogic.net\/blog\/?p=4233"},"modified":"2019-07-07T18:02:20","modified_gmt":"2019-07-07T18:02:20","slug":"variables-in-visual-installer","status":"publish","type":"post","link":"https:\/\/www.samlogic.net\/blog\/2016\/07\/variables-in-visual-installer\/","title":{"rendered":"Variables in Visual Installer"},"content":{"rendered":"<p>If you have used a programming language before you are probably very familiar with <em>variables<\/em>. If not, you can read this <a href=\"https:\/\/en.wikipedia.org\/wiki\/Variable_(computer_science)\" target=\"_blank\" rel=\"noopener noreferrer\">Wikipedia article<\/a> to get a basic knowledge about variables.<\/p>\n<p><img decoding=\"async\" class=\"alignright\" src=\"https:\/\/www.samlogic.net\/pad\/icons\/visual_installer.gif\" border=\"0\" alt=\"\">Also <a href=\"https:\/\/www.samlogic.net\/visual-installer\/visual-installer.htm\" target=\"_blank\" rel=\"noopener noreferrer\">Visual Installer<\/a> can handle variables. Most variables are automatically set during the setup process and are used to handle for example drive letters, system folders, application folders, date, time, license keys, version information etc. Variables can also be used to retrieve values from the Registry in Windows.<\/p>\n<p>Variables can be used in many places in Visual Installer, for example in all main tabs in the editor (e.g. <strong>File list<\/strong>, <strong>Registry<\/strong>, <strong>INI files<\/strong>, <strong>Components<\/strong> tabs etc.). Variables can also be used with the most setup dialog boxes in Visual Installer and with the scripting language.<\/p>\n<p><strong>The %DESTDIR variable<\/strong><br \/>\nOne of the most used variables in Visual Installer is the <strong>%DESTDIR<\/strong> variable. This variable contains the main destination folder for the setup project. The contents is read from the <strong>Main folder<\/strong> text box in the <strong>File list<\/strong> tab.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.samlogic.net\/blog\/images\/product-visual-installer\/vi-editor-tab-filelist--main-folder.png\" border=\"0\" alt=\"The 'Main folder' text box\"><\/p>\n<p>In the main folder text box it is common to include the <strong>%PROGRAMFILES<\/strong> variable. The <strong>%PROGRAMFILES<\/strong> variable will be replaced with the current path to the <strong>Program Files<\/strong> folder in Windows during the installation. We explain more in this blog post:<\/p>\n<p><strong><span style=\"color: #ff0000;\">&gt;<\/span><\/strong> <a href=\"https:\/\/www.samlogic.net\/blog\/2013\/06\/visual-installer-how-do-i-install-files-to-program-files-folder\/\">Visual Installer: How do I install files to the Program Files folder?<\/a><\/p>\n<p><strong>List with variables<\/strong><br \/>\nYou can open and view a list with all available variables in the Visual Installer editor. If you open for example the <strong>Registry<\/strong> tab in the editor and clicks on the <strong>Variables<\/strong> button, the following window is opened:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.samlogic.net\/blog\/images\/product-visual-installer\/vi-dialogbox-variables.png\" border=\"0\" alt=\"List with variables\"><\/p>\n<p>In the <strong>Variables<\/strong> window you can see a list of all available variables in Visual Installer. To get a description of each variable, you can press the <strong>F1<\/strong> key.<\/p>\n<p>(If you double-click on a variable name in the <strong>Variables<\/strong> window, the variable will be inserted at the cursors position, if a text editor was active before you clicked the <strong>Variables<\/strong> button.)<\/p>\n<p><strong>Environment variables<\/strong><br \/>\nVisual Installer can also handle Windows <a href=\"https:\/\/en.wikipedia.org\/wiki\/Environment_variable\" target=\"_blank\" rel=\"noopener noreferrer\">environment variables<\/a>. You can read more about this in the following blog post:<\/p>\n<p><strong><span style=\"color: #ff0000;\">&gt;<\/span><\/strong> <a href=\"https:\/\/www.samlogic.net\/blog\/2015\/11\/using-environment-variables-in-visual-installer\/\">Using environment variables in Visual Installer<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you have used a programming language before you are probably very familiar with variables. If not, you can read this Wikipedia article to get a basic knowledge about variables. Also Visual Installer can handle variables. Most variables are automatically set during the setup process and are used to handle for example drive letters, system &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.samlogic.net\/blog\/2016\/07\/variables-in-visual-installer\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;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\/4233"}],"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=4233"}],"version-history":[{"count":1,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/posts\/4233\/revisions"}],"predecessor-version":[{"id":6042,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/posts\/4233\/revisions\/6042"}],"wp:attachment":[{"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/media?parent=4233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/categories?post=4233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/tags?post=4233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}