0

Am developing an installer for my application using wix installer, in that installer am having a custom dialog to browse company logo. Which control is used to browse images(.bmp file)?

1 Answers1

1

In my opinion, there is no file browse control in WiX. Better if you can write a custom action and invoke it on button click. This custom action would select a file and set to appropriate Wix property.

Please refer the solution at:File Browse Dialog in Wix Installer

EDIT:

It seems you want to copy the browsed file to system32 directory. For that you can use custom action.

FileToCopy.txt should be replaced with your browsed file path.

<CustomAction Id="CopyToSystem32" ExeCommand="cmd /c copy /y FileToCopy.txt C:\Windows\System32" Directory="INSTALLFOLDER" Impersonate="no" Execute="deferred" Return="asyncWait" />

<InstallExecuteSequence>
  <Custom Action="CopyToSystem32" After="InstallFiles" ><!-- YOUR CONDITION --></Custom>
</InstallExecuteSequence>
Manoj Choudhari
  • 5,277
  • 2
  • 26
  • 37
  • Thanks Manoj..I am able to upload the file. I have one more requirement, How to copy this uploaded image in to windows\system32 floder using Wix Installer. – Navya reddy Jan 02 '19 at 12:57
  • You will have to use custom action for this. In this file browse custom action only to copy the file which is not part of MSI File DB to the install location or SYSTEM32 location. – Manoj Choudhari Jan 02 '19 at 13:02
  • when I am copying from custom action I am getting access denied to system32 path..so i tried from wix (ex. – Navya reddy Jan 02 '19 at 13:06
  • You cannot use source path which is out side the MSI file table. What i understand is you are allowing user to select the icon and hence the file is not part of your MSI file table. The access denied error may be because you will need to run MSI with admin privilege. You can start admin command prompt and then invoke msi using msiexec command. But i would prefer to keep any user added files in install directory rather than in system32. – Manoj Choudhari Jan 02 '19 at 13:10
  • I need to copy uploaded image into system32 folder, with custom action session value(Path of uploaded image). I already copied dll into system32 using File property. – Navya reddy Jan 02 '19 at 13:58
  • edited answer you can check the code shown there. – Manoj Choudhari Jan 02 '19 at 14:16
  • 'FileToCopy.txt' is dynamic I have to give user uploaded image from CustomAction Session value. – Navya reddy Jan 04 '19 at 09:25
  • In your previous custom action , where user is browsing the file path, you should set that in a property. That property you can use instead of FileToCopy.txt – Manoj Choudhari Jan 04 '19 at 09:54
  • NOT Installed AND NOT PATCH , this is what i am doing..but it is not copying – Navya reddy Jan 04 '19 at 12:29