New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Creating a dynamic install directory #516
Comments
Have a look at "Install Files" and "InstallDir" samples. but from the top of my head you have some problems with your dir structure. Try change it to something like this: var project = new ManagedProject("MyProduct",
new InstallDir(@"%ProgramFiles%\My Company\My Product"),
new Dir("DataAPI",
new Files(@"E:\Temp\installertemp\DataAPI\*.*"))); |
Thanks for quick reply I will have a look at the code samples you reccomended but i tried your above suggestion, here is the log output, its installing the folder structure for installDir but placing my dataAPI folder and its containing files at the base of my E drive. ActionStart: Action 13:39:48: CreateFolders. Creating folders Is it possible to access the MsiRuntime.Session[installLocation] in the setup class where the installer is built? |
So correct: var project = new ManagedProject("MyProduct",
new InstallDir(@"%ProgramFiles%\My Company\My Product",
new Dir("DataAPI",
new Files(@"E:\Temp\installertemp\DataAPI\*.*")))); |
Thanks @Xaddan i hadn't noticed the difference in brackets at first but this worked great! |
Also @oleg-shilo i really can't thank you and all those that have contributed to Wixsharp enough! As someone who has never used wix before and seeing the horrible mess it is, Wixsharp has really saved me! |
You are very welcome :) |
I am having trouble with with my directories, I want my InstallDir to be my top parent directory and for any other Dir to be contained within this folder structure. I have tried this multiple ways and can't seem to work it out but what I am aiming for is to be able to use the installDirDialog to change the install location. The directory left unchanged installs correctly, but if i was to change the install location it only builds the new folder structure and the files install install to the default location. I know why it's installing to this location because its referencing a static string, I only used the below as an example to simplify the problem I am having.
Another approach was to use an MSI property and set that as the install path.
In setup.cs
string dirs =General.InstallLocation;
I then set this property in the install dialog.
MsiRuntime.Session[General.InstallLocation] = installDir.Text;
This didn't work either and only passed INSTALLDIRECTORY as the path.
The text was updated successfully, but these errors were encountered: