Skip to content

Commit 1a6010b

Browse files
Merge pull request #15 from atc-net/hotfix/add-missing-can-comammnd-execute-guards
fix: Add missing CanComammnd execute guards with DisableInstallationA…
2 parents d1ec770 + 19cdbfb commit 1a6010b

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

src/Atc.Installer.Wpf.ComponentProvider.ElasticSearch/ElasticSearchServerComponentProviderViewModel.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ public override async Task ServiceStopCommandHandler()
132132
}
133133

134134
public override bool CanServiceStartCommandHandler()
135-
=> RunningState == ComponentRunningState.Stopped;
135+
=> DisableInstallationActions &&
136+
RunningState == ComponentRunningState.Stopped;
136137

137138
public override async Task ServiceStartCommandHandler()
138139
{

src/Atc.Installer.Wpf.ComponentProvider.InternetInformationServer/InternetInformationServerComponentProviderViewModel.cs

+6-3
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ public override async Task ServiceStopCommandHandler()
295295
}
296296

297297
public override bool CanServiceStartCommandHandler()
298-
=> RunningState == ComponentRunningState.Stopped;
298+
=> !DisableInstallationActions &&
299+
RunningState == ComponentRunningState.Stopped;
299300

300301
public override async Task ServiceStartCommandHandler()
301302
{
@@ -333,7 +334,8 @@ public override async Task ServiceStartCommandHandler()
333334

334335
public override bool CanServiceDeployCommandHandler()
335336
{
336-
if (UnpackedZipFolderPath is null)
337+
if (DisableInstallationActions ||
338+
UnpackedZipFolderPath is null)
337339
{
338340
return false;
339341
}
@@ -355,7 +357,8 @@ public override Task ServiceDeployAndStartCommandHandler()
355357

356358
public override bool CanServiceRemoveCommandHandler()
357359
{
358-
if (InstallationFolderPath is null ||
360+
if (DisableInstallationActions ||
361+
InstallationFolderPath is null ||
359362
InstalledMainFilePath is null)
360363
{
361364
return false;

src/Atc.Installer.Wpf.ComponentProvider.PostgreSql/PostgreSqlServerComponentProviderViewModel.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ public override async Task ServiceStopCommandHandler()
159159
}
160160

161161
public override bool CanServiceStartCommandHandler()
162-
=> RunningState == ComponentRunningState.Stopped;
162+
=> !DisableInstallationActions &&
163+
RunningState == ComponentRunningState.Stopped;
163164

164165
public override async Task ServiceStartCommandHandler()
165166
{

src/Atc.Installer.Wpf.ComponentProvider.WindowsApplication/WindowsApplicationComponentProviderViewModel.cs

+6-3
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ public override async Task ServiceStopCommandHandler()
133133
}
134134

135135
public override bool CanServiceStartCommandHandler()
136-
=> RunningState == ComponentRunningState.Stopped;
136+
=> !DisableInstallationActions &&
137+
RunningState == ComponentRunningState.Stopped;
137138

138139
public override async Task ServiceStartCommandHandler()
139140
{
@@ -195,7 +196,8 @@ public override async Task ServiceStartCommandHandler()
195196

196197
public override bool CanServiceDeployCommandHandler()
197198
{
198-
if (UnpackedZipFolderPath is null)
199+
if (DisableInstallationActions ||
200+
UnpackedZipFolderPath is null)
199201
{
200202
return false;
201203
}
@@ -217,7 +219,8 @@ public override Task ServiceDeployAndStartCommandHandler()
217219

218220
public override bool CanServiceRemoveCommandHandler()
219221
{
220-
if (InstallationFolderPath is null ||
222+
if (DisableInstallationActions ||
223+
InstallationFolderPath is null ||
221224
InstalledMainFilePath is null)
222225
{
223226
return false;

0 commit comments

Comments
 (0)