WiX - requirements to install TO a network share - wix

I have a program, we'll call it foo.msi that I wrote using WIX.
Users want to be able to install it TO (not from, but TO) a network share.
If you try to change to the network , it will not allow you to select the network drive.
What kind of permissions does a user have to have to install stuff to a network share?
Basically the setup is used to distribute a file spread with some logic behind it.
Are there some WIX parameters we can alter here to allow it with basic read/write capabilities?
Thanks...

Found my answer.
<Property Id="WIXUI_DONTVALIDATEPATH" Value="1" />
WIXUI_DONTVALIDATEFILEPATH="1" will surpress the drive checking but there is a trick . You must TYPE IN the path you wish to install to fully. If you try and change it change the Change Folder dialog you will get the error "installation directory mustbe a local hard drive" .
This is a WiX bug and is scheduled to be fixed in WiX 4.0 - https://github.com/wixtoolset/issues/issues/4737 .

Related

Cannot overwrite files in ProgramData\myApp installed by MSI

I am about to create a MSI package.
During the installation (launched e.g. via double-click on the MSI) some files contained in the MSI are deposited deeper under c:\ProgramData (resp. the CommonAppDataFolder), e.g. c:\ProgramData\myCompany\myApplication.
Later when the installed application is run by the user the application may need to modify these file.
The problem is that neither the running application nor the user e.g. via Windows Explorer has the right to modify any files under c:\ProgramData\myCompany\myApplication created during installation.
The files do not have a readonly attribute set.
The strange thing for me now is: If I install the MSI via msiexec /q /i then I have write permissions on these files.
My MSI is created with WiX, my os is Win 7, the user is member of the administrator group.
Can anyone tell me why that is so, and how I can gain write permissions to these files w/o having to use /q /i?
Thanks
Jan
EDIT 2014-03-24: Damned. I missed to specify the InstallPrivileges attribute on my element, I just didn't know about it.
Setting it to "limited" does not show up a UAC prompt when installing to ProgramData! And now the user / my application is allowed to overwrite files in the destination folder :)
I don't know why that behavior would be different regarding access to that folder unless you have a custom action that does something that is only in the UI sequence. That's the only functional difference I can think of - the UI sequence is suppressed in a silent install.
However the common app data folder is not normally writeable to limited users. I'm not sure how much you know about UAC, but it doesn't matter if the user running the program is an admin or not because by default admins run with limited privileges. If the app needs admin privilege to run then it needs building with an elevation manifest so it asks for elevation to admin privilege. Either that or run it as administrator from a shortcut.
Windows access control is extremely complicated to deal with. In every version of Windows there is something new and changed to deal with, and it looks like the default write access in ProgramData now includes some sort of special ACL / DACL. If this is indeed the problem you can apply new permissions there and open up for regular users to write. Please note that I am not quite aware of exactly what newer versions of Windows apply as default. The tool I generally use to set permissioning is subinacl.exe. A real handful of a tool with a command line that can scare the most experienced system administrators. Some command line samples are here. You can also use the LockPermissions table in MSI, but somehow there are some issues with how these permissions are applied to the file system object. subinacl.exe is more complex, and more capable.
More on file and folder permissioning:
http://technet.microsoft.com/en-us/library/bb727008.aspx
http://support.microsoft.com/kb/308419
With regards to where you should put different types of files on the system, please check this thread.

How to limit UI installation paths in WIX?

I am writing an installation script using WIX and have a question that arises in regards to the user selected location for installation. The program that needs to be installed needs to be installed at the root drive C:/, D:/, ext for the program to work. Using the Wix UI package WIXUI_INSTALLDIR the user can change the path that the program is installed too what I want to do is to make it impossible for the user to change anything except the root drive ie change D:\usr\sparrow\bin ---> C:\usr\sparrow bin if they so desired. Does anyone have any suggestions about how this might be accomplished?
You can do this with a custom action and a custom dialog, but I wouldn't do this. It is a lot of work, and doesn't seem to have any major benefits.
If I were you I would remove the chance to install to a custom location altogether. However, if the setup is run by command line, you won't be able to control what path they specify for TARGETDIR / INSTALLDIR anyway, unless you add a custom action check to abort the setup if the path is not to be allowed:
msiexec /i setup.msi TARGETDIR=c:\anypathcanbewrittenhere

Wix Bootstrapper - DownloadUrl - Can it be a local network path?

I want to have my exePackage saved on a network path and for the bootrapper to "download" it from this place if needed.
I cannot get the bootstapper to work with the path. My log says failed to connect to ....
I have tried may different things with the / or \ and with "file" at the beginning. But I cannot seem to get it right. Firefox, Internet Explorer and file explorer all have no problem with this format, however wix will change it in the log. The log show "file://servname..."
DownloadUrl="file://///servname/foldername1/foldername2/folder%20withaspace/myEXE.exe"
What should it be?
EDIT: One work around would be to use the Source attribute and have it pointing to the network path. But my development pc with Visual Studio (M$ version) does not have access to this network share so I cannot use the Name or Source of the exePackage to refer to this file.
Burn supports downloading from BITS, FTP, HTTP, and HTTPS. It doesn't support SMB shares.

Wix installer could not remove installation folder

I have a Wix installer which is designed to install (uninstall) a Windows service and another .exe file. When I uninstall the software using this installer, and enabling extra log, I see some error messages about unable to remove my installation folder, although it is indeed empty. The first message that appears on the log is like this:
DEBUG: Error 2911: Could not remove the folder MY_INSTALLATION_FOLDER.
The following errors are all about the same problem. My first guess is of course that there are some resources that were being used during the uninstallation. However, like I mentioned, all components in this folder were indeed removed and this is an empty folder by now. Also, this error is the first error in the log, meaning there was no error prior to removing this folder. For example, from the log I can see a series of FileRemove actions were taken right prior to the folder removal and they all succeeded. So it's gotta be that this folder itself was being used. But I really can't figure out why and what is holding this folder. By the way the software was indeed uninstalled since the final product removal returns 0 and every thing related to our software was removed (Windows service list, shortcuts, registries...) excepted this empty folder. It is not crucial but we definitely don't want to hear from our customer asking about this kind of error anyway(they are using auto-installation and the log is by default enabled and checked)
Please help. Thanks!
Possible causes:
Other process is locking that folder. Use Unlocker to
verify if that's the case.
Some folders have restricted permissions
by Windows (e.g. C:\Windows\system32). Generally, you should avoid creating files under Windows own folders (unless it's required, I.e.: your'e installing a device driver).
Did you properly set folder permissions?

WIX create folder using property

In the WIX I have a dialog where the user could select a folder [CUSTOM_FOLDER] from local machine, after the setup is finish I must give share to that folder and copy some files to it.
How could I archive this using WIX 3.5?
AFTER the setup is finished you want to install more files? Why not just simply install them during the process. That point aside, you can create as many empty folders as your heart desires during the installation process, then using CustomAction elements you can add the files after the installation has completed successfully. As for "give share to that folder" I have no idea what you are talking about. Please expand on that and I will try my best to answer it.