{"id":1247,"date":"2017-12-04T05:47:50","date_gmt":"2017-12-04T05:47:50","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=1247"},"modified":"2020-01-09T09:35:50","modified_gmt":"2020-01-09T09:35:50","slug":"newbie-issue-with-custom-input","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/newbie-issue-with-custom-input\/","title":{"rendered":"Newbie issue with custom input"},"content":{"rendered":"<p><strong>applicationPackaging created the topic: Newbie issue with custom input<\/strong><br \/>\nI am running WiX version 3.0.5419.0.<\/p>\n<p>I am building an installer for a program that transforms data.  The program reads data from an input directory and writes the transformed data to an output directory.  I want the user to be able to specify the input and output directory during the installation process and have the installer save the values to the registry.<\/p>\n<p>I created an msi installer using WiX.  It uses a modified version of the WixUI_InstallDir that includes an additional configuration dialog with PathEdit controls to accept the user defined values.  When I run my installer I get the following error before my custom configuration dialog opens up:<\/p>\n<p>    DEBUG: Error 2343:  Specified path is empty.<\/p>\n<p>Here is the code I use to handle the user provided input directory (the output directory code is very similar):<\/p>\n<p>I have a Component for the input directory registry entry that references a UI_CONFIG_INPUT_DIR property that holds the user defined entry:<\/p>\n<p>      <DirectoryRef Id=\"APPLICATIONROOTDIRECTORY\"><br \/>\n        <Component Id=\"InputDirectory\"\nGuid=\"c2689487-f89b-419c-a098-bd2d6cccb2ab\"><br \/>\n            <RegistryValue Root=\"HKCU\" Key=\"Software\\ACME\\DATA PROJECT\\Configure\" Name=\"Input_dir\" Type=\"string\"\nValue=\"[UI_CONFIG_INPUT_DIR]\"\/><br \/>\n        <\/Component><br \/>\n      <\/DirectoryRef><\/p>\n<p>In my feature I reference the InputDirectory Component:<\/p>\n<p>      <Feature Id=\"DATA PROJECT \" Title=\"DATA PROJECT handler\" Level=\"1\"\nConfigurableDirectory=\"APPLICATIONROOTDIRECTORY\"><br \/>\n        <ComponentRef Id=\"InputDirectory\" \/><br \/>\n      <\/Feature><\/p>\n<p>The UI_CONFIG_INPUT_DIR is defined and set to a default value of C:\\\\:<\/p>\n<p>      <Property Id=\"UI_CONFIG_INPUT_DIR\" Value=\"C:\\\\\" \/><\/p>\n<p>In my custom version of the WixUI_InstallDir I have the following Publish commands to handle the user input from a ConfigureDlg dialog I created (see<br \/>\nbelow):<\/p>\n<p>            <Publish Dialog=\"ConfigureDlg\" Control=\"Back\" Event=\"NewDialog\"\nValue=\"MyInstallDirDlg\" Order=\"1\">1<\/Publish><br \/>\n            <Publish Dialog=\"ConfigureDlg\" Control=\"Next\" Event=\"NewDialog\"\nValue=\"VerifyReadyDlg\" Order=\"1\">1<\/Publish><br \/>\n            <Publish Dialog=\"ConfigureDlg\" Control=\"Next\"\nEvent=\"SetProperty\" Value=\"[UI_CONFIG_INPUT_DIR]\" Order=\"1\">1<\/Publish><br \/>\n            <Publish Dialog=\"ConfigureDlg\" Control=\"ChangeInputFolder\"\nProperty=\"_BrowseProperty\" Value=\"[UI_CONFIG_INPUT_DIR]\"\nOrder=\"1\">1<\/Publish><\/p>\n<p>The ConfigureDlg includes a PathEdit Control to accept the user input:<\/p>\n<p><Wix xmlns=\" schemas.microsoft.com\/wix\/2006\/wi \"><br \/>\n    <Fragment><br \/>\n        <UI><br \/>\n            <Dialog Id=\"ConfigureDlg\" Width=\"370\" Height=\"270\"\nTitle=\"!(loc.InstallDirDlg_Title)\"><br \/>\n                <Control Id=\"Next\" Type=\"PushButton\" X=\"236\" Y=\"243\"\nWidth=\"56\" Height=\"17\" Default=\"yes\" Text=\"!(loc.WixUINext)\" \/><br \/>\n                <Control Id=\"Back\" Type=\"PushButton\" X=\"180\" Y=\"243\"\nWidth=\"56\" Height=\"17\" Text=\"!(loc.WixUIBack)\" \/><br \/>\n                <Control Id=\"Cancel\" Type=\"PushButton\" X=\"304\" Y=\"243\"\nWidth=\"56\" Height=\"17\" Cancel=\"yes\" Text=\"!(loc.WixUICancel)\"><br \/>\n                    <Publish Event=\"SpawnDialog\"\nValue=\"CancelDlg\">1<\/Publish><br \/>\n                <\/Control><\/p>\n<p>                <Control Id=\"FolderInputLabel\" Type=\"Text\" X=\"20\" Y=\"60\"\nWidth=\"290\" Height=\"20\" Text=\"Raw FOQA Input Directory:\" \/><br \/>\n                <Control Id=\"FolderInput\" Type=\"PathEdit\" X=\"20\" Y=\"80\"\nWidth=\"320\" Height=\"18\" Property=\"UI_CONFIG_INPUT_DIR\" Indirect=\"yes\" \/><br \/>\n                <Control Id=\"ChangeInputFolder\" Type=\"PushButton\" X=\"20\"\nY=\"100\" Width=\"56\" Height=\"17\" Text=\"!(loc.InstallDirDlgChange)\" \/><br \/>\n            <\/Dialog><br \/>\n        <\/UI><br \/>\n    <\/Fragment><br \/>\n<\/Wix><\/p>\n<p>Thanks in advance for any help,<\/p>\n","protected":false},"excerpt":{"rendered":"<p>applicationPackaging created the topic: Newbie issue with custom input I am running WiX version 3.0.5419.0. I am building an installer for a program that transforms data. The program reads data&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[49],"tags":[302],"class_list":["post-1247","post","type-post","status-publish","format-standard","hentry","category-general","tag-issue"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1247","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=1247"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1247\/revisions"}],"predecessor-version":[{"id":1248,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1247\/revisions\/1248"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=1247"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=1247"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=1247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}