Skip to content

Commit 28e7286

Browse files
committed
creating an additional all-users installer
1 parent a390bf9 commit 28e7286

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

setup/Program.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ static void Main(string[] args)
2121
UpgradeCode = new Guid("E92B4658-0D37-4FF6-AD09-379881769A8D"),
2222
Platform = Platform.x64,
2323
UI = WUI.WixUI_InstallDir,
24-
InstallScope = InstallScope.perUser,
2524
MajorUpgrade = MajorUpgrade.Default,
2625
Version = new Version(productVersion),
2726
OutFileName = $"RevitDBExplorer",
@@ -36,12 +35,19 @@ static void Main(string[] args)
3635
ProductIcon = "Resources\\RDBE.ico"
3736
};
3837

38+
project.RemoveDialogsBetween(NativeDialogs.WelcomeDlg, NativeDialogs.InstallDirDlg);
39+
40+
BuildMsi(project, InstallScope.perUser, @"%AppDataFolder%\Autodesk\Revit\Addins");
41+
BuildMsi(project, InstallScope.perMachine, @"%CommonAppDataFolder%\Autodesk\Revit\Addins\");
42+
}
43+
44+
private static void BuildMsi(Project project, InstallScope scope, string rootPath)
45+
{
46+
project.InstallScope = scope;
3947
project.Dirs = new Dir[]
4048
{
41-
new Dir(@"%AppDataFolder%\Autodesk\Revit\Addins", CreateDirFor(2021), CreateDirFor(2022), CreateDirFor(2023), CreateDirFor(2024), CreateDirFor(2025), CreateDirFor(2026))
49+
new Dir(rootPath, CreateDirFor(2021), CreateDirFor(2022), CreateDirFor(2023), CreateDirFor(2024), CreateDirFor(2025), CreateDirFor(2026))
4250
};
43-
44-
project.RemoveDialogsBetween(NativeDialogs.WelcomeDlg, NativeDialogs.InstallDirDlg);
4551
Compiler.BuildMsi(project);
4652
}
4753

0 commit comments

Comments
 (0)