Wixsharp: External UI Setting INSTALLDIR Error

Created on 28 May 2020  路  2Comments  路  Source: oleg-shilo/wixsharp

I use External UI with WPF, and I want to change INSTALLDIR by code
public void StartInstall() { base.StartInstall(@"INSTALLDIR=C:\"); }
but this dosen't work ... How can i change installdir?

question

All 2 comments

Cannot really comment about your code but passing the path in the slightly modified WinFormSetup sample works just fine. Try to follow it when implementing your setup:

```C#
void installBtn_Click(object sender, EventArgs e)
{
DisableButtons();
session.StartInstall("CUSTOM_UI=\"true\" INSTALLDIR=C:\MyProduct");
}

![image](https://user-images.githubusercontent.com/16729806/83197576-0716a880-a181-11ea-8170-0de4b197ea95.png)

![image](https://user-images.githubusercontent.com/16729806/83197447-d6cf0a00-a180-11ea-96ee-788f3ba727ea.png)

And of course it all will depend on your MSI definition, which is in that sample:

```c#
var docs = new Feature("Documentation");
var binaries = new Feature("Binaries");

var project =
    new Project("MyProduct",

        new LaunchCondition("CUSTOM_UI=\"true\" OR REMOVE=\"ALL\"", "Please run setup.exe instead."),

        new Dir(@"%ProgramFiles%\My Company\My Product",
            new File(binaries, @"Files\Bin\MyApp.exe"),
            new Dir(@"Docs\Manual",
                new File(docs, @"Files\Docs\Manual.txt"))));

project.UI = WUI.WixUI_Common;
project.GUID = new Guid("6f330b47-2577-43ad-9095-1861ba25889b");

Compiler.BuildMsi(project);

It works well. This really help me. Thank you! :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

UweKeim picture UweKeim  路  5Comments

JasShao picture JasShao  路  4Comments

milhousemanastorm picture milhousemanastorm  路  4Comments

mattias-symphony picture mattias-symphony  路  3Comments

empz picture empz  路  3Comments