Skip to content

Commit

Permalink
Merge pull request #9 from GridProtectionAlliance/installer-service-p…
Browse files Browse the repository at this point in the history
…ermissions

Fix permissions for service account after upgrades
  • Loading branch information
ritchiecarroll authored Oct 24, 2024
2 parents 40b1fde + 78a8f05 commit e35794a
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ Maintenance dialog sequence:
- WixUI_MaintenanceTypeDlg
- WixUI_CustomizeDlg
- WixUI_VerifyReadyDlg
Patch dialog sequence:
- WixUI_WelcomeDlg
- WixUI_VerifyReadyDlg
-->

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
Expand All @@ -44,7 +40,6 @@ Patch dialog sequence:
<Publish Dialog="CustomExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>

<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>

<Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="CustomizeDlg">LicenseAccepted = "1"</Publish>
Expand All @@ -54,8 +49,7 @@ Patch dialog sequence:
<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>

<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="1">NOT Installed OR WixUI_InstallMode = "Change"</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="3">Installed AND PATCH</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT(WixUI_InstallMode = "Change")</Publish>

<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>

Expand Down
52 changes: 42 additions & 10 deletions Source/Applications/SIEGate/SIEGateSetup/SIEGateSetup.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,22 @@
<UIRef Id="WixUI_ErrorProgressText" />
<DialogRef Id="CompanyInfoDialog" />
<DialogRef Id="ServiceAccountDialog" />
<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="ServiceAccountDialog"><![CDATA[&SIEGateFeature=3]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg"><![CDATA[NOT(&SIEGateFeature=3)]]></Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CompanyInfoDialog">(NOT Installed OR WixUI_InstallMode = "Change") AND <![CDATA[&SIEGateFeature=3]]></Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg">(NOT Installed OR WixUI_InstallMode = "Change") AND <![CDATA[NOT(&SIEGateFeature=3)]]></Publish>

<Publish Dialog="CustomizeDlg" Control="Next" Property="INSTALLSERVICEFEATURE" Value="1" Order="7"><![CDATA[&SIEGateFeature=3 OR (!SIEGateFeature=3 AND &SIEGateFeature=-1)]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Property="INSTALLSERVICEFEATURE" Order="7"><![CDATA[NOT(&SIEGateFeature=3 OR (!SIEGateFeature=3 AND &SIEGateFeature=-1))]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Property="INSTALLMANAGERFEATURE" Value="1" Order="7"><![CDATA[&SIEGateManagerFeature=3 OR (!SIEGateManagerFeature=3 AND &SIEGateManagerFeature=-1)]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Property="INSTALLMANAGERFEATURE" Order="7"><![CDATA[NOT(&SIEGateManagerFeature=3 OR (!SIEGateManagerFeature=3 AND &SIEGateManagerFeature=-1))]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Property="INSTALLCONSOLEFEATURE" Value="1" Order="7"><![CDATA[&SIEGateConsoleFeature=3 OR (!SIEGateConsoleFeature=3 AND &SIEGateConsoleFeature=-1)]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Property="INSTALLCONSOLEFEATURE" Order="7"><![CDATA[NOT(&SIEGateConsoleFeature=3 OR (!SIEGateConsoleFeature=3 AND &SIEGateConsoleFeature=-1))]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Property="INSTALLTOOLSFEATURE" Value="1" Order="7"><![CDATA[&SIEGateToolsFeature=3 OR (!SIEGateToolsFeature=3 AND &SIEGateToolsFeature=-1)]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Property="INSTALLTOOLSFEATURE" Order="7"><![CDATA[NOT(&SIEGateToolsFeature=3 OR (!SIEGateToolsFeature=3 AND &SIEGateToolsFeature=-1))]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Property="INSTALLOPTIONALFEATURE" Value="1" Order="7"><![CDATA[&SIEGateOptionalFeatures=3 OR (!SIEGateOptionalFeatures=3 AND &SIEGateOptionalFeatures=-1)]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Property="INSTALLOPTIONALFEATURE" Order="7"><![CDATA[NOT(&SIEGateOptionalFeatures=3 OR (!SIEGateOptionalFeatures=3 AND &SIEGateOptionalFeatures=-1))]]></Publish>

<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="ServiceAccountDialog" Order="8">INSTALLSERVICEFEATURE</Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="8">NOT(INSTALLSERVICEFEATURE)</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CompanyInfoDialog">INSTALLSERVICEFEATURE</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg">NOT(INSTALLSERVICEFEATURE)</Publish>
<Publish Dialog="CustomExitDialog" Control="Finish" Event="DoAction" Value="StartCSUProcessAction">WIXUI_CUSTOMEXITDIALOGOPTIONALCHECKBOX = 1</Publish>
</UI>

Expand All @@ -132,7 +144,14 @@
<Icon Id="APPPDCImporter.ico.exe" SourceFile="$(var.ProjectDir)\APPPDCImporter.exe"/>
<Icon Id="SELPDCImporter.ico.exe" SourceFile="$(var.ProjectDir)\SELPDCImporter.exe"/>

<Property Id="INSTALLSERVICEFEATURE" Secure="yes" />
<Property Id="INSTALLMANAGERFEATURE" Secure="yes" />
<Property Id="INSTALLCONSOLEFEATURE" Secure="yes" />
<Property Id="INSTALLTOOLSFEATURE" Secure="yes" />
<Property Id="INSTALLOPTIONALFEATURE" Secure="yes" />

<Property Id="SERVICENAME" Value="$(var.SIEGate.TargetName)" />
<Property Id="SERVICEACCOUNT" Secure="yes" />
<Property Id="SERVICEPASSWORD" Hidden="yes" />
<Property Id="HTTPSERVICEPORTS" Value="6053,6054,6153,6154,6354,6454,5019" />
<Property Id="COMPANYNAME" Value="Grid Protection Alliance" />
Expand All @@ -144,11 +163,24 @@
<Property Id="REGSERVICESTARTVALUE">
<RegistrySearch Id="ServiceStartRegSearch" Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\[SERVICENAME]" Name="Start" Type="raw" />
</Property>

<SetProperty Action="SetServiceStartDefault" Id="SERVICESTART" After="AppSearch" Value="#2" Sequence="first"><![CDATA[NOT REGSERVICESTARTVALUE]]></SetProperty>
<SetProperty Action="SetServiceStartRegistry" Id="SERVICESTART" After="AppSearch" Value="[REGSERVICESTARTVALUE]" Sequence="first"><![CDATA[REGSERVICESTARTVALUE]]></SetProperty>
<SetProperty Action="SetServiceAccountDefault" Id="SERVICEACCOUNT" After="AppSearch" Value="NT SERVICE\[SERVICENAME]" Sequence="first"><![CDATA[NOT REGSERVICEACCOUNT]]></SetProperty>
<SetProperty Action="SetServiceAccountRegistry" Id="SERVICEACCOUNT" After="AppSearch" Value="[REGSERVICEACCOUNT]" Sequence="first"><![CDATA[REGSERVICEACCOUNT]]></SetProperty>
<SetProperty Id="PROCESSSTARTINFO" Value="FileName={[#ConfigurationSetupUtility.exe]};Arguments=-install;UseShellExecute=True;Verb=runas" After="ExecuteAction" Sequence="ui" />

<SetProperty Action="INSTALLSERVICEFEATURE0" Id="INSTALLSERVICEFEATURE" Value="1" After="CostFinalize" Sequence="both"><![CDATA[&SIEGateFeature=3 OR (!SIEGateFeature=3 AND &SIEGateFeature=-1)]]></SetProperty>
<SetProperty Action="INSTALLSERVICEFEATURE1" Id="INSTALLSERVICEFEATURE" Value="" After="CostFinalize" Sequence="both"><![CDATA[NOT(&SIEGateFeature=3 OR (!SIEGateFeature=3 AND &SIEGateFeature=-1))]]></SetProperty>
<SetProperty Action="INSTALLMANAGERFEATURE0" Id="INSTALLMANAGERFEATURE" Value="1" After="CostFinalize" Sequence="both"><![CDATA[&SIEGateManagerFeature=3 OR (!SIEGateManagerFeature=3 AND &SIEGateManagerFeature=-1)]]></SetProperty>
<SetProperty Action="INSTALLMANAGERFEATURE1" Id="INSTALLMANAGERFEATURE" Value="" After="CostFinalize" Sequence="both"><![CDATA[NOT(&SIEGateManagerFeature=3 OR (!SIEGateManagerFeature=3 AND &SIEGateManagerFeature=-1))]]></SetProperty>
<SetProperty Action="INSTALLCONSOLEFEATURE0" Id="INSTALLCONSOLEFEATURE" Value="1" After="CostFinalize" Sequence="both"><![CDATA[&SIEGateConsoleFeature=3 OR (!SIEGateConsoleFeature=3 AND &SIEGateConsoleFeature=-1)]]></SetProperty>
<SetProperty Action="INSTALLCONSOLEFEATURE1" Id="INSTALLCONSOLEFEATURE" Value="" After="CostFinalize" Sequence="both"><![CDATA[NOT(&SIEGateConsoleFeature=3 OR (!SIEGateConsoleFeature=3 AND &SIEGateConsoleFeature=-1))]]></SetProperty>
<SetProperty Action="INSTALLTOOLSFEATURE0" Id="INSTALLTOOLSFEATURE" Value="1" After="CostFinalize" Sequence="both"><![CDATA[&SIEGateToolsFeature=3 OR (!SIEGateToolsFeature=3 AND &SIEGateToolsFeature=-1)]]></SetProperty>
<SetProperty Action="INSTALLTOOLSFEATURE1" Id="INSTALLTOOLSFEATURE" Value="" After="CostFinalize" Sequence="both"><![CDATA[NOT(&SIEGateToolsFeature=3 OR (!SIEGateToolsFeature=3 AND &SIEGateToolsFeature=-1))]]></SetProperty>
<SetProperty Action="INSTALLOPTIONALFEATURE0" Id="INSTALLOPTIONALFEATURE" Value="1" After="CostFinalize" Sequence="both"><![CDATA[&SIEGateOptionalFeatures=3 OR (!SIEGateOptionalFeatures=3 AND &SIEGateOptionalFeatures=-1)]]></SetProperty>
<SetProperty Action="INSTALLOPTIONALFEATURE1" Id="INSTALLOPTIONALFEATURE" Value="" After="CostFinalize" Sequence="both"><![CDATA[NOT(&SIEGateOptionalFeatures=3 OR (!SIEGateOptionalFeatures=3 AND &SIEGateOptionalFeatures=-1))]]></SetProperty>

<WixVariable Id="WixUIBannerBmp" Value="$(var.ProjectDir)\SIEGateSetupBanner.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="$(var.ProjectDir)\SIEGateSetupDialog.bmp" />
<WixVariable Id="WixUILicenseRtf" Value="$(var.ProjectDir)\INSTALL_LICENSE.rtf" />
Expand Down Expand Up @@ -179,12 +211,12 @@
</UI>

<InstallExecuteSequence>
<Custom Action="CompanyInfoAction.SetProperty" After="InstallFiles">NOT REMOVE AND <![CDATA[&SIEGateFeature=3]]></Custom>
<Custom Action="CompanyInfoAction" After="CompanyInfoAction.SetProperty">NOT REMOVE AND <![CDATA[&SIEGateFeature=3]]></Custom>
<Custom Action="ConfigureServiceAction.SetProperty" After="InstallServices">NOT REMOVE AND <![CDATA[&SIEGateFeature=3]]></Custom>
<Custom Action="ConfigureServiceAction" After="ConfigureServiceAction.SetProperty">NOT REMOVE AND <![CDATA[&SIEGateFeature=3]]></Custom>
<Custom Action="ServiceAccountAction.SetProperty" After="ConfigureServiceAction">NOT REMOVE</Custom>
<Custom Action="ServiceAccountAction" After="ServiceAccountAction.SetProperty">NOT REMOVE</Custom>
<Custom Action="CompanyInfoAction.SetProperty" After="InstallFiles">INSTALLSERVICEFEATURE</Custom>
<Custom Action="CompanyInfoAction" After="CompanyInfoAction.SetProperty">INSTALLSERVICEFEATURE</Custom>
<Custom Action="ConfigureServiceAction.SetProperty" After="InstallServices"><![CDATA[&SIEGateFeature=3]]></Custom>
<Custom Action="ConfigureServiceAction" After="ConfigureServiceAction.SetProperty"><![CDATA[&SIEGateFeature=3]]></Custom>
<Custom Action="ServiceAccountAction.SetProperty" After="ConfigureServiceAction">INSTALLSERVICEFEATURE</Custom>
<Custom Action="ServiceAccountAction" After="ServiceAccountAction.SetProperty">INSTALLSERVICEFEATURE</Custom>
<Custom Action="NetFxExecuteNativeImageCommitInstall" After="NetFxExecuteNativeImageUninstall">0</Custom>
<Custom Action="NetFxExecuteNativeImageInstall" After="NetFxExecuteNativeImageCommitInstall" />
<!-- Set write registry values sequence after service install but before service start to restore original service start mode -->
Expand Down

0 comments on commit e35794a

Please sign in to comment.