Skip to content

Commit f9665c2

Browse files
committed
feat(installer): allow CLI generation on release builds
1 parent e432ad0 commit f9665c2

File tree

3 files changed

+40
-4
lines changed

3 files changed

+40
-4
lines changed

package/WindowsManaged/Dialogs/VerifyReadyDialog.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,23 @@ public VerifyReadyDialog()
1414
{
1515
InitializeComponent();
1616
label1.MakeTransparentOn(banner);
17-
18-
#if DEBUG
19-
this.generateCli.Visible = true;
20-
#endif
2117
}
2218

2319
public override void OnLoad(object sender, EventArgs e)
2420
{
2521
banner.Image = Runtime.Session.GetResourceBitmap("WixUI_Bmp_Banner");
2622

23+
bool generateCliVisible = false;
24+
25+
#if DEBUG
26+
generateCliVisible = true;
27+
#else
28+
GatewayProperties properties = new(Runtime.Session);
29+
generateCliVisible = properties.EnableCliGeneration;
30+
#endif
31+
32+
this.generateCli.Visible = generateCliVisible;
33+
2734
base.OnLoad(sender, e);
2835
}
2936

package/WindowsManaged/Properties/GatewayProperties.g.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,6 +1069,32 @@ public String NgrokRemoteAddress
10691069
}
10701070
}
10711071

1072+
internal static readonly WixProperty<Boolean> enableCliGeneration = new()
1073+
{
1074+
Id = "P.ENABLECLIGENERATION",
1075+
Default = false,
1076+
Name = "EnableCliGeneration",
1077+
Secure = false,
1078+
Hidden = false,
1079+
Public = true
1080+
};
1081+
1082+
public Boolean EnableCliGeneration
1083+
{
1084+
get
1085+
{
1086+
string stringValue = this.FnGetPropValue(enableCliGeneration.Id);
1087+
return WixProperties.GetPropertyValue<Boolean>(stringValue);
1088+
}
1089+
set
1090+
{
1091+
if (this.runtimeSession is not null)
1092+
{
1093+
this.runtimeSession.Set(enableCliGeneration, value);
1094+
}
1095+
}
1096+
}
1097+
10721098
internal static readonly WixProperty<Boolean> debugPowerShell = new()
10731099
{
10741100
Id = "P.DEBUGPOWERSHELL",
@@ -1385,6 +1411,8 @@ public Boolean Maintenance
13851411

13861412
ngrokRemoteAddress,
13871413

1414+
enableCliGeneration,
1415+
13881416
debugPowerShell,
13891417

13901418
installId,

package/WindowsManaged/Properties/GatewayProperties.g.tt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ namespace DevolutionsGateway.Properties
256256
new PropertyDefinition<bool>("NgrokEnableTcp", false),
257257
new PropertyDefinition<string>("NgrokRemoteAddress", ""),
258258

259+
new PropertyDefinition<bool>("EnableCliGeneration", false, isPublic: true, secure: false),
259260
new PropertyDefinition<bool>("DebugPowerShell", false),
260261
new PropertyDefinition<Guid>("InstallId", Guid.Empty, isPublic: true, secure: true),
261262
new PropertyDefinition<string>("UserTempPath", "", isPublic: true, secure: true),

0 commit comments

Comments
 (0)