0

I want to extract a folder path other than an installation directory using a second folder browser dialog.

 <Control Id="edtDataStoreLocation" Type="PathEdit" X="45" Y="174" Height="18" Width="220"Property="MyProperty"/>

  <Control Id="btnStoreLocation" Type="PushButton" X="270" Y="175" Width="56" Height="17" Text="Browse" >
     <Publish Property="SelectFolderDialog_Property" Value="MyProperty" Order="1">1</Publish>
     <Publish Event="SpawnDialog" Value="SelectFolderDialog" Order="2">1</Publish>
  </Control>

This throws up an error when I click OK in the browser dialog. Following is the error.

The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2727.

How can i select a folder and extract this path to MyProperty ?

Nilaksha Perera
  • 715
  • 2
  • 12
  • 36

1 Answers1

1

You can do that with custom action if you want :

    var dialog = new OpenFileDialog
        {
            Filter = @"PFX Files|*.ipa",
            Title = @"Add IPA file"
        };
        if (dialog.ShowDialog() == DialogResult.OK)
        {
            doSometh with the result;

        }
Chris Tanev
  • 208
  • 3
  • 16
  • So this means we cannot use existing properties to do this task ? – Nilaksha Perera Mar 16 '16 at 02:11
  • One other question. This folder browser dialog box does not have the actual behavior of an actual folder browser dialog. The dialog box is not always on top of the installer. How to overcome this problem ? – Nilaksha Perera Mar 21 '16 at 06:32
  • You probably use wix UI , there must be some option to hide the current dialog window, but im not sure. I am using custom wpf UI as bootstrapper and this browse dialog is always on top(although its really easy to hide window in wpf). – Chris Tanev Mar 21 '16 at 07:52