This commit is contained in:
Virtuworks 2015-05-12 18:09:34 -04:00
commit 5f118619e6
11 changed files with 1089 additions and 142 deletions

View file

@ -331,11 +331,14 @@
<Publish Dialog="PrereqCheckDlg" Control="Cancel" Event="SpawnDialog" Value="CancelDlg">1</Publish> <Publish Dialog="PrereqCheckDlg" Control="Cancel" Event="SpawnDialog" Value="CancelDlg">1</Publish>
<!--CustomizeDlg--> <!--CustomizeDlg-->
<Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="PrereqCheckDlg" Order="3">1</Publish> <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="PrereqCheckDlg" Order="3">1</Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="SWebDlg" Order="12">&amp;ServerFeature=3</Publish> <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="ServerPasswordDlg" Order="15"><![CDATA[&ServerFeature=-1 AND !ServerFeature=3]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="ESWebDlg" Order="11">&amp;EnterpriseServerFeature=3</Publish> <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="ServerAdminPasswordDlg" Order="14"><![CDATA[&EnterpriseServerFeature=-1 AND !EnterpriseServerFeature=3]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="PWebDlg" Order="10">&amp;PortalFeature=3</Publish> <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="ESUrlDlg" Order="13"><![CDATA[&PortalFeature=-1 AND !PortalFeature=3]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="DatabaseConnectionDlg" Order="9">&amp;SchedulerServiceFeature=3</Publish> <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="SWebDlg" Order="12"><![CDATA[&ServerFeature=3 AND COMPFOUND_SERVER=0]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="CustomVerifyReadyDlg" Order="8">&amp;WDPortalFeature=3</Publish> <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="ESWebDlg" Order="11"><![CDATA[&EnterpriseServerFeature=3 AND COMPFOUND_ESERVER=0]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="PWebDlg" Order="10"><![CDATA[&PortalFeature=3 AND COMPFOUND_PORTAL=0]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="DatabaseConnectionDlg" Order="9"><![CDATA[&SchedulerServiceFeature=3 AND COMPFOUND_SCHEDULER=0]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="CustomVerifyReadyDlg" Order="8"><![CDATA[&WDPortalFeature=3 AND COMPFOUND_WDPORTAL=0]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="CustomVerifyReadyDlg" Order="7">1</Publish> <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="CustomVerifyReadyDlg" Order="7">1</Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Event="DoAction" Value="CA_RecapListUI" Order="1">1</Publish> <Publish Dialog="CustomizeDlg" Control="Next" Event="DoAction" Value="CA_RecapListUI" Order="1">1</Publish>
<!--SWebDlg--> <!--SWebDlg-->
@ -357,7 +360,10 @@
<Publish Dialog="SUserAccountDlg" Control="SelectUserButton" Property="PI_SERVER_LOGIN" Value="[DSOP_UPN]" Order="3"><![CDATA[DSOP_UPN <> ""]]></Publish> <Publish Dialog="SUserAccountDlg" Control="SelectUserButton" Property="PI_SERVER_LOGIN" Value="[DSOP_UPN]" Order="3"><![CDATA[DSOP_UPN <> ""]]></Publish>
<Publish Dialog="SUserAccountDlg" Control="SelectUserButton" Property="PI_SERVER_LOGIN" Value="[DSOP_NAME]" Order="3"><![CDATA[DSOP_NAME <> "" AND DSOP_UPN = ""]]></Publish> <Publish Dialog="SUserAccountDlg" Control="SelectUserButton" Property="PI_SERVER_LOGIN" Value="[DSOP_NAME]" Order="3"><![CDATA[DSOP_NAME <> "" AND DSOP_UPN = ""]]></Publish>
<!--ServerPasswordDlg--> <!--ServerPasswordDlg-->
<Publish Dialog="ServerPasswordDlg" Control="Back" Event="NewDialog" Value="SUserAccountDlg">1</Publish> <Publish Dialog="ServerPasswordDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="2"><![CDATA[&ServerFeature=-1 AND !ServerFeature=3]]></Publish>
<Publish Dialog="ServerPasswordDlg" Control="Back" Event="NewDialog" Value="SUserAccountDlg" Order="1">1</Publish>
<Publish Dialog="ServerPasswordDlg" Control="Next" Event="NewDialog" Value="ServerAdminPasswordDlg" Order="9"><![CDATA[&EnterpriseServerFeature=-1 AND !EnterpriseServerFeature=3 AND VALIDATE_OK = 1]]></Publish>
<Publish Dialog="ServerPasswordDlg" Control="Next" Event="NewDialog" Value="ESUrlDlg" Order="8"><![CDATA[&PortalFeature=-1 AND !PortalFeature=3 AND VALIDATE_OK = "1"]]></Publish>
<Publish Dialog="ServerPasswordDlg" Control="Next" Event="NewDialog" Value="ESWebDlg" Order="7">&amp;EnterpriseServerFeature=3 AND VALIDATE_OK = "1"</Publish> <Publish Dialog="ServerPasswordDlg" Control="Next" Event="NewDialog" Value="ESWebDlg" Order="7">&amp;EnterpriseServerFeature=3 AND VALIDATE_OK = "1"</Publish>
<Publish Dialog="ServerPasswordDlg" Control="Next" Event="NewDialog" Value="PWebDlg" Order="6">&amp;PortalFeature=3 AND VALIDATE_OK = "1"</Publish> <Publish Dialog="ServerPasswordDlg" Control="Next" Event="NewDialog" Value="PWebDlg" Order="6">&amp;PortalFeature=3 AND VALIDATE_OK = "1"</Publish>
<Publish Dialog="ServerPasswordDlg" Control="Next" Event="NewDialog" Value="DatabaseConnectionDlg" Order="5">&amp;SchedulerServiceFeature=3 AND VALIDATE_OK = "1"</Publish> <Publish Dialog="ServerPasswordDlg" Control="Next" Event="NewDialog" Value="DatabaseConnectionDlg" Order="5">&amp;SchedulerServiceFeature=3 AND VALIDATE_OK = "1"</Publish>
@ -389,7 +395,11 @@
<Publish Dialog="ESUserAccountDlg" Control="SelectUserButton" Property="PI_ESERVER_LOGIN" Value="[DSOP_UPN]" Order="3"><![CDATA[DSOP_UPN <> ""]]></Publish> <Publish Dialog="ESUserAccountDlg" Control="SelectUserButton" Property="PI_ESERVER_LOGIN" Value="[DSOP_UPN]" Order="3"><![CDATA[DSOP_UPN <> ""]]></Publish>
<Publish Dialog="ESUserAccountDlg" Control="SelectUserButton" Property="PI_ESERVER_LOGIN" Value="[DSOP_NAME]" Order="3"><![CDATA[DSOP_NAME <> "" AND DSOP_UPN = ""]]></Publish> <Publish Dialog="ESUserAccountDlg" Control="SelectUserButton" Property="PI_ESERVER_LOGIN" Value="[DSOP_NAME]" Order="3"><![CDATA[DSOP_NAME <> "" AND DSOP_UPN = ""]]></Publish>
<!--ServerAdminPasswordDlg--> <!--ServerAdminPasswordDlg-->
<Publish Dialog="ServerAdminPasswordDlg" Control="Back" Event="NewDialog" Value="ESUserAccountDlg">1</Publish> <Publish Dialog="ServerAdminPasswordDlg" Control="Back" Event="NewDialog" Value="ServerPasswordDlg" Order="3"><![CDATA[&ServerFeature=-1 AND !ServerFeature=3]]></Publish>
<Publish Dialog="ServerAdminPasswordDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="2"><![CDATA[&EnterpriseServerFeature=-1 AND !EnterpriseServerFeature=3]]></Publish>
<Publish Dialog="ServerAdminPasswordDlg" Control="Back" Event="NewDialog" Value="ESUserAccountDlg" Order="1">1</Publish>
<Publish Dialog="ServerAdminPasswordDlg" Control="Next" Event="NewDialog" Value="ESUrlDlg" Order="5"><![CDATA[&PortalFeature=-1 AND !PortalFeature=3 AND VALIDATE_OK = "1"]]></Publish>
<Publish Dialog="ServerAdminPasswordDlg" Control="Next" Event="NewDialog" Value="CustomVerifyReadyDlg" Order="4"><![CDATA[&EnterpriseServerFeature=-1 AND !EnterpriseServerFeature=3 AND VALIDATE_OK = "1"]]></Publish>
<Publish Dialog="ServerAdminPasswordDlg" Control="Next" Event="NewDialog" Value="DatabaseConnectionDlg" Order="3"><![CDATA[(&EnterpriseServerFeature=3 OR &SchedulerServiceFeature=3) AND VALIDATE_OK="1"]]></Publish> <Publish Dialog="ServerAdminPasswordDlg" Control="Next" Event="NewDialog" Value="DatabaseConnectionDlg" Order="3"><![CDATA[(&EnterpriseServerFeature=3 OR &SchedulerServiceFeature=3) AND VALIDATE_OK="1"]]></Publish>
<Publish Dialog="ServerAdminPasswordDlg" Control="Next" Event="SpawnDialog" Value="ValidateDlg" Order="2">VALIDATE_OK="0"</Publish> <Publish Dialog="ServerAdminPasswordDlg" Control="Next" Event="SpawnDialog" Value="ValidateDlg" Order="2">VALIDATE_OK="0"</Publish>
<Publish Dialog="ServerAdminPasswordDlg" Control="Next" Event="DoAction" Value="CA_ServerAdminValidateUI" Order="1">1</Publish> <Publish Dialog="ServerAdminPasswordDlg" Control="Next" Event="DoAction" Value="CA_ServerAdminValidateUI" Order="1">1</Publish>
@ -437,21 +447,28 @@
<Publish Dialog="PUserAccountDlg" Control="SelectUserButton" Property="PI_PORTAL_LOGIN" Value="[DSOP_UPN]" Order="3"><![CDATA[DSOP_UPN <> ""]]></Publish> <Publish Dialog="PUserAccountDlg" Control="SelectUserButton" Property="PI_PORTAL_LOGIN" Value="[DSOP_UPN]" Order="3"><![CDATA[DSOP_UPN <> ""]]></Publish>
<Publish Dialog="PUserAccountDlg" Control="SelectUserButton" Property="PI_PORTAL_LOGIN" Value="[DSOP_NAME]" Order="3"><![CDATA[DSOP_NAME <> "" AND DSOP_UPN = ""]]></Publish> <Publish Dialog="PUserAccountDlg" Control="SelectUserButton" Property="PI_PORTAL_LOGIN" Value="[DSOP_NAME]" Order="3"><![CDATA[DSOP_NAME <> "" AND DSOP_UPN = ""]]></Publish>
<!--ESUrlDlg--> <!--ESUrlDlg-->
<Publish Dialog="ESUrlDlg" Control="Back" Event="NewDialog" Value="PUserAccountDlg">1</Publish> <Publish Dialog="ESUrlDlg" Control="Back" Event="NewDialog" Value="ServerAdminPasswordDlg" Order="4"><![CDATA[&EnterpriseServerFeature=-1 AND !EnterpriseServerFeature=3]]></Publish>
<Publish Dialog="ESUrlDlg" Control="Back" Event="NewDialog" Value="ServerPasswordDlg" Order="3"><![CDATA[&ServerFeature=-1 AND !ServerFeature=3]]></Publish>
<Publish Dialog="ESUrlDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="2"><![CDATA[&PortalFeature=-1 AND !PortalFeature=3]]></Publish>
<Publish Dialog="ESUrlDlg" Control="Back" Event="NewDialog" Value="PUserAccountDlg" Order="1">1</Publish>
<Publish Dialog="ESUrlDlg" Control="Next" Event="NewDialog" Value="DatabaseConnectionDlg" Order="2"><![CDATA[&SchedulerServiceFeature=3]]></Publish> <Publish Dialog="ESUrlDlg" Control="Next" Event="NewDialog" Value="DatabaseConnectionDlg" Order="2"><![CDATA[&SchedulerServiceFeature=3]]></Publish>
<Publish Dialog="ESUrlDlg" Control="Next" Event="NewDialog" Value="CustomVerifyReadyDlg" Order="1">1</Publish> <Publish Dialog="ESUrlDlg" Control="Next" Event="NewDialog" Value="CustomVerifyReadyDlg" Order="1">1</Publish>
<Publish Dialog="ESUrlDlg" Control="Cancel" Event="SpawnDialog" Value="CancelDlg">1</Publish> <Publish Dialog="ESUrlDlg" Control="Cancel" Event="SpawnDialog" Value="CancelDlg">1</Publish>
<!--CustomVerifyReadyDlg--> <!--CustomVerifyReadyDlg-->
<Publish Dialog="CustomVerifyReadyDlg" Control="Back" Event="NewDialog" Value="DatabaseConnectionDlg" Order="16"><![CDATA[&SchedulerServiceFeature=3 AND NOT(&EnterpriseServerFeature=3)]]></Publish> <Publish Dialog="CustomVerifyReadyDlg" Control="Back" Event="NewDialog" Value="ESUrlDlg" Order="19"><![CDATA[&PortalFeature=-1 AND !PortalFeature=3]]></Publish>
<Publish Dialog="CustomVerifyReadyDlg" Control="Back" Event="NewDialog" Value="ESUrlDlg" Order="15"><![CDATA[&PortalFeature=3 AND NOT(&EnterpriseServerFeature=3)]]></Publish> <Publish Dialog="CustomVerifyReadyDlg" Control="Back" Event="NewDialog" Value="ServerPasswordDlg" Order="18"><![CDATA[&ServerFeature=-1 AND !ServerFeature=3]]></Publish>
<Publish Dialog="CustomVerifyReadyDlg" Control="Back" Event="NewDialog" Value="PUserAccountDlg" Order="14"><![CDATA[&PortalFeature=3 AND &EnterpriseServerFeature=3]]></Publish> <Publish Dialog="CustomVerifyReadyDlg" Control="Back" Event="NewDialog" Value="ServerAdminPasswordDlg" Order="17"><![CDATA[&EnterpriseServerFeature=-1 AND !EnterpriseServerFeature=3]]></Publish>
<Publish Dialog="CustomVerifyReadyDlg" Control="Back" Event="NewDialog" Value="DatabaseConnectionDlg" Order="13"><![CDATA[&EnterpriseServerFeature=3 AND &PortalFeature<>3]]></Publish> <Publish Dialog="CustomVerifyReadyDlg" Control="Back" Event="NewDialog" Value="DatabaseConnectionDlg" Order="16"><![CDATA[&SchedulerServiceFeature=3 AND NOT(&EnterpriseServerFeature=3) AND COMPFOUND_SCHEDULER=0]]></Publish>
<Publish Dialog="CustomVerifyReadyDlg" Control="Back" Event="NewDialog" Value="ServerPasswordDlg" Order="12"><![CDATA[&ServerFeature=3 AND &EnterpriseServerFeature<>3 AND &PortalFeature<>3]]></Publish> <Publish Dialog="CustomVerifyReadyDlg" Control="Back" Event="NewDialog" Value="ESUrlDlg" Order="15"><![CDATA[&PortalFeature=3 AND NOT(&EnterpriseServerFeature=3) AND COMPFOUND_PORTAL=0]]></Publish>
<Publish Dialog="CustomVerifyReadyDlg" Control="Back" Event="NewDialog" Value="PUserAccountDlg" Order="14"><![CDATA[&PortalFeature=3 AND &EnterpriseServerFeature=3 AND COMPFOUND_PORTAL=0]]></Publish>
<Publish Dialog="CustomVerifyReadyDlg" Control="Back" Event="NewDialog" Value="DatabaseConnectionDlg" Order="13"><![CDATA[&EnterpriseServerFeature=3 AND &PortalFeature<>3 AND COMPFOUND_ESERVER=0]]></Publish>
<Publish Dialog="CustomVerifyReadyDlg" Control="Back" Event="NewDialog" Value="ServerPasswordDlg" Order="12"><![CDATA[&ServerFeature=3 AND &EnterpriseServerFeature<>3 AND &PortalFeature<>3 AND COMPFOUND_SERVER=0]]></Publish>
<Publish Dialog="CustomVerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="1">1</Publish> <Publish Dialog="CustomVerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="1">1</Publish>
<!--FinishDlg--> <!--FinishDlg-->
<Publish Dialog="FinishDlg" Control="Next" Event="NewDialog" Value="FinishDlg">1</Publish> <Publish Dialog="FinishDlg" Control="Next" Event="NewDialog" Value="FinishDlg">1</Publish>
<!--ValidateDlg--> <!--ValidateDlg-->
<Publish Dialog="ValidateDlg" Control="Ok" Event="EndDialog" Value="Return">1</Publish> <Publish Dialog="ValidateDlg" Control="Ok" Event="EndDialog" Value="Return">1</Publish>
<ProgressText Action="CA_InstallWebFeatures">Please wait while [ProductName] Installer configures IIS &amp; ASP.NET, this may take a few minutes. Thanks!</ProgressText>
</UI> </UI>
<Icon Id="WebSitePanel.ico" SourceFile="WebSitePanel.ico" /> <Icon Id="WebSitePanel.ico" SourceFile="WebSitePanel.ico" />
<Binary Id="Assembly_CA" SourceFile="bin\WebsitePanel.WIXInstaller.CA.dll" /> <Binary Id="Assembly_CA" SourceFile="bin\WebsitePanel.WIXInstaller.CA.dll" />
@ -476,7 +493,7 @@
<!--SQL props.--> <!--SQL props.-->
<Property Id="DB_SERVER" Secure="yes" Value="localhost\SQLExpress" /> <Property Id="DB_SERVER" Secure="yes" Value="localhost\SQLExpress" />
<Property Id="DB_CONN" Secure="yes" /> <Property Id="DB_CONN" Secure="yes" />
<Property Id="DB_DATABASE" Secure="yes" /> <Property Id="DB_DATABASE" Secure="yes" Value="WebsitePanel" />
<Property Id="DB_AUTH" Secure="yes" Value="Windows Authentication" /> <Property Id="DB_AUTH" Secure="yes" Value="Windows Authentication" />
<Property Id="DB_LOGIN" Secure="yes" /> <Property Id="DB_LOGIN" Secure="yes" />
<Property Id="DB_PASSWORD" Secure="yes" /> <Property Id="DB_PASSWORD" Secure="yes" />
@ -503,7 +520,7 @@
<Property Id="PI_SERVER_IP" Secure="yes" Value="127.0.0.1" /> <Property Id="PI_SERVER_IP" Secure="yes" Value="127.0.0.1" />
<Property Id="PI_SERVER_PORT" Secure="yes" Value="9003" /> <Property Id="PI_SERVER_PORT" Secure="yes" Value="9003" />
<Property Id="PI_SERVER_HOST" Secure="yes" /> <Property Id="PI_SERVER_HOST" Secure="yes" />
<Property Id="PI_SERVER_LOGIN" Secure="yes" /> <Property Id="PI_SERVER_LOGIN" Secure="yes" Value="WPServer"/>
<Property Id="PI_SERVER_PASSWORD" Secure="yes" /> <Property Id="PI_SERVER_PASSWORD" Secure="yes" />
<Property Id="PI_SERVER_PASSWORD_CONFIRM" Secure="yes" /> <Property Id="PI_SERVER_PASSWORD_CONFIRM" Secure="yes" />
<Property Id="PI_SERVER_DOMAIN" Secure="yes" /> <Property Id="PI_SERVER_DOMAIN" Secure="yes" />
@ -512,7 +529,7 @@
<Property Id="PI_ESERVER_IP" Secure="yes" Value="127.0.0.1" /> <Property Id="PI_ESERVER_IP" Secure="yes" Value="127.0.0.1" />
<Property Id="PI_ESERVER_PORT" Secure="yes" Value="9002" /> <Property Id="PI_ESERVER_PORT" Secure="yes" Value="9002" />
<Property Id="PI_ESERVER_HOST" Secure="yes" /> <Property Id="PI_ESERVER_HOST" Secure="yes" />
<Property Id="PI_ESERVER_LOGIN" Secure="yes" /> <Property Id="PI_ESERVER_LOGIN" Secure="yes" Value="WPEnterpriseServer"/>
<Property Id="PI_ESERVER_PASSWORD" Secure="yes" /> <Property Id="PI_ESERVER_PASSWORD" Secure="yes" />
<Property Id="PI_ESERVER_PASSWORD_CONFIRM" Secure="yes" /> <Property Id="PI_ESERVER_PASSWORD_CONFIRM" Secure="yes" />
<Property Id="PI_ESERVER_DOMAIN" Secure="yes" /> <Property Id="PI_ESERVER_DOMAIN" Secure="yes" />
@ -522,7 +539,7 @@
<Property Id="PI_PORTAL_IP" Secure="yes" Value="127.0.0.1" /> <Property Id="PI_PORTAL_IP" Secure="yes" Value="127.0.0.1" />
<Property Id="PI_PORTAL_PORT" Secure="yes" Value="9001" /> <Property Id="PI_PORTAL_PORT" Secure="yes" Value="9001" />
<Property Id="PI_PORTAL_HOST" Secure="yes" /> <Property Id="PI_PORTAL_HOST" Secure="yes" />
<Property Id="PI_PORTAL_LOGIN" Secure="yes" /> <Property Id="PI_PORTAL_LOGIN" Secure="yes" Value="WPPortal" />
<Property Id="PI_PORTAL_PASSWORD" Secure="yes" /> <Property Id="PI_PORTAL_PASSWORD" Secure="yes" />
<Property Id="PI_PORTAL_PASSWORD_CONFIRM" Secure="yes" /> <Property Id="PI_PORTAL_PASSWORD_CONFIRM" Secure="yes" />
<Property Id="PI_PORTAL_DOMAIN" Secure="yes" /> <Property Id="PI_PORTAL_DOMAIN" Secure="yes" />
@ -539,9 +556,15 @@
<!----> <!---->
<Property Id="VALIDATE_OK" Secure="yes" Value="0" /> <Property Id="VALIDATE_OK" Secure="yes" Value="0" />
<Property Id="VALIDATE_MSG" Secure="yes" /> <Property Id="VALIDATE_MSG" Secure="yes" />
<Property Id ="WSP_ROOT" Secure="yes"> <Property Id="WSP_BASE" Secure="yes">
<RegistrySearch Id='Search_WSP_ROOT' Root='HKCU' Key='SOFTWARE\[ProductName]' Name='Root' Type='raw' /> <RegistrySearch Id='Search_WSP_BASE' Root='HKLM' Key='SOFTWARE\[ProductName]' Name='Base' Type='raw' />
</Property> </Property>
<!--Was found an existing installation (configuration) on local pc. COMPFOUND stands for COMPonent FOUND.-->
<Property Id="COMPFOUND_SERVER" Secure="yes" Value="0" />
<Property Id="COMPFOUND_ESERVER" Secure="yes" Value="0" />
<Property Id="COMPFOUND_PORTAL" Secure="yes" Value="0" />
<Property Id="COMPFOUND_WDPORTAL" Secure="yes" Value="0" />
<Property Id="COMPFOUND_SCHEDULER" Secure="yes" Value="0" />
<!--CustomActions.--> <!--CustomActions.-->
<!-- <CustomAction Id='AlreadyUpdated' Error='Product has already been updated to $(var.VERSION) or newer.' /> <!-- <CustomAction Id='AlreadyUpdated' Error='Product has already been updated to $(var.VERSION) or newer.' />
<CustomAction Id='NoDowngrade' Error='A later version of [ProductName] is already installed.' /> --> <CustomAction Id='NoDowngrade' Error='A later version of [ProductName] is already installed.' /> -->
@ -588,11 +611,19 @@
<CustomAction Id="CA_OnEServerRemove" BinaryKey="Assembly_CA" DllEntry="OnEServerRemove" Impersonate="no" Execute="deferred" HideTarget="no" /> <CustomAction Id="CA_OnEServerRemove" BinaryKey="Assembly_CA" DllEntry="OnEServerRemove" Impersonate="no" Execute="deferred" HideTarget="no" />
<CustomAction Id="CA_PropertyOnPortalRemove" Property="CA_OnPortalRemove" Value="InstallerFolder=[WEBSITEPANELDIR];ComponentCode=portal;BaseDirectory=[WEBSITEPANELDIR];MODE_UP=[WIX_UPGRADE_DETECTED];MODE_RUP=[UPGRADINGPRODUCTCODE]" /> <CustomAction Id="CA_PropertyOnPortalRemove" Property="CA_OnPortalRemove" Value="InstallerFolder=[WEBSITEPANELDIR];ComponentCode=portal;BaseDirectory=[WEBSITEPANELDIR];MODE_UP=[WIX_UPGRADE_DETECTED];MODE_RUP=[UPGRADINGPRODUCTCODE]" />
<CustomAction Id="CA_OnPortalRemove" BinaryKey="Assembly_CA" DllEntry="OnPortalRemove" Impersonate="no" Execute="deferred" HideTarget="no" /> <CustomAction Id="CA_OnPortalRemove" BinaryKey="Assembly_CA" DllEntry="OnPortalRemove" Impersonate="no" Execute="deferred" HideTarget="no" />
<!--Maintenance mode.-->
<CustomAction Id="CA_PropertyMaintenanceServer" Property="CA_MaintenanceServer" Value="InstallerFolder=[WEBSITEPANELDIR];ComponentCode=server;BaseDirectory=[WEBSITEPANELDIR];ServerPassword=[SERVER_ACCESS_PASSWORD]" />
<CustomAction Id="CA_MaintenanceServer" BinaryKey="Assembly_CA" DllEntry="MaintenanceServer" Impersonate="no" Execute="deferred" HideTarget="no" />
<CustomAction Id="CA_PropertyMaintenanceEServer" Property="CA_MaintenanceEServer" Value="InstallerFolder=[WEBSITEPANELDIR];ComponentCode=enterpriseserver;BaseDirectory=[WEBSITEPANELDIR];ServerAdminPassword=[SERVERADMIN_PASSWORD];" />
<CustomAction Id="CA_MaintenanceEServer" BinaryKey="Assembly_CA" DllEntry="MaintenanceEServer" Impersonate="no" Execute="deferred" HideTarget="no" />
<CustomAction Id="CA_PropertyMaintenancePortal" Property="CA_MaintenancePortal" Value="InstallerFolder=[WEBSITEPANELDIR];ComponentCode=portal;BaseDirectory=[WEBSITEPANELDIR];EnterpriseServerUrl=[PI_ESERVER_URL]" />
<CustomAction Id="CA_MaintenancePortal" BinaryKey="Assembly_CA" DllEntry="MaintenancePortal" Impersonate="no" Execute="deferred" HideTarget="no" />
<!----> <!---->
<SetProperty Id="WEBSITEPANELDIR" After="AppSearch" Value="[WSP_ROOT]">WSP_ROOT</SetProperty> <SetProperty Id="WEBSITEPANELDIR" After="AppSearch" Value="[WSP_BASE]">WSP_BASE</SetProperty>
<CustomAction Id="CA_PreFillSettings" BinaryKey="Assembly_CA" DllEntry="PreFillSettings" />
<!--Exe sequence.--> <!--Exe sequence.-->
<InstallExecuteSequence> <InstallExecuteSequence>
<Custom Action="CA_InstallWebFeatures" After="InstallValidate"><![CDATA[(&ServerFeature=3) OR (&EnterpriseServerFeature=3) OR (&PortalFeature=3) OR (&SchedulerServiceFeature=3) OR (&WDPortalFeature=3)]]></Custom> <Custom Action="CA_InstallWebFeatures" Before="CostInitialize"><![CDATA[(&ServerFeature=3) OR (&EnterpriseServerFeature=3) OR (&PortalFeature=3) OR (&SchedulerServiceFeature=3) OR (&WDPortalFeature=3)]]></Custom>
<!--<Custom Action="CA_PropertyFinalizeInstall" After='InstallValidate'/> <!--<Custom Action="CA_PropertyFinalizeInstall" After='InstallValidate'/>
<Custom Action="CA_FinalizeUnInstall" After="InstallValidate">(NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")</Custom> <Custom Action="CA_FinalizeUnInstall" After="InstallValidate">(NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")</Custom>
<Custom Action="CA_FinalizeInstall" After="InstallFiles" >NOT Installed or REINSTALL</Custom>--> <Custom Action="CA_FinalizeInstall" After="InstallFiles" >NOT Installed or REINSTALL</Custom>-->
@ -609,9 +640,19 @@
<Custom Action="CA_PropertyOnEServerRemove" After="InstallInitialize"><![CDATA[(&EnterpriseServerFeature=2) AND (!EnterpriseServerFeature=3)]]></Custom> <Custom Action="CA_PropertyOnEServerRemove" After="InstallInitialize"><![CDATA[(&EnterpriseServerFeature=2) AND (!EnterpriseServerFeature=3)]]></Custom>
<Custom Action="CA_OnEServerRemove" Before="StopServices"><![CDATA[(&EnterpriseServerFeature=2) AND (!EnterpriseServerFeature=3)]]></Custom> <Custom Action="CA_OnEServerRemove" Before="StopServices"><![CDATA[(&EnterpriseServerFeature=2) AND (!EnterpriseServerFeature=3)]]></Custom>
<Custom Action="CA_PropertyOnPortalRemove" After="InstallInitialize"><![CDATA[(&PortalFeature=2) AND (!PortalFeature=3)]]></Custom> <Custom Action="CA_PropertyOnPortalRemove" After="InstallInitialize"><![CDATA[(&PortalFeature=2) AND (!PortalFeature=3)]]></Custom>
<Custom Action="CA_OnPortalRemove" After="CA_PropertyOnPortalRemove"><![CDATA[(&PortalFeature=2) AND (!PortalFeature=3)]]></Custom> <Custom Action="CA_OnPortalRemove" After="CA_PropertyOnPortalRemove"><![CDATA[(&PortalFeature=2) AND (!PortalFeature=3)]]></Custom>
<!--Maintenance.-->
<Custom Action="CA_PropertyMaintenanceServer" After="InstallInitialize"><![CDATA[&ServerFeature=-1 AND !ServerFeature=3]]></Custom>
<Custom Action="CA_MaintenanceServer" After="CA_PropertyMaintenanceServer"><![CDATA[&ServerFeature=-1 AND !ServerFeature=3]]></Custom>
<Custom Action="CA_PropertyMaintenanceEServer" After="InstallInitialize"><![CDATA[&EnterpriseServerFeature=-1 AND !EnterpriseServerFeature=3]]></Custom>
<Custom Action="CA_MaintenanceEServer" After="CA_PropertyMaintenanceEServer"><![CDATA[&EnterpriseServerFeature=-1 AND !EnterpriseServerFeature=3]]></Custom>
<Custom Action="CA_PropertyMaintenancePortal" After="InstallInitialize"><![CDATA[&PortalFeature=-1 AND !PortalFeature=3]]></Custom>
<Custom Action="CA_MaintenancePortal" After="CA_PropertyMaintenancePortal"><![CDATA[&PortalFeature=-1 AND !PortalFeature=3]]></Custom>
<!---->
<Custom Action="CA_PreFillSettings" After="SetWEBSITEPANELDIR">1</Custom>
</InstallExecuteSequence> </InstallExecuteSequence>
<InstallUISequence> <InstallUISequence>
<Custom Action="CA_PreFillSettings" Before="CA_InstallWebFeatures" />
<Custom Action="CA_InstallWebFeatures" Before="CA_PrereqCheck" /> <Custom Action="CA_InstallWebFeatures" Before="CA_PrereqCheck" />
<Custom Action="CA_PrereqCheck" After ="CostInitialize" /> <Custom Action="CA_PrereqCheck" After ="CostInitialize" />
<Custom Action="CA_PrereqCheckUI" After ="CA_PrereqCheck" /> <Custom Action="CA_PrereqCheckUI" After ="CA_PrereqCheck" />
@ -630,7 +671,7 @@
<DirectoryRef Id="INSTALLENTERPRISESERVERFOLDER"> <DirectoryRef Id="INSTALLENTERPRISESERVERFOLDER">
<Component Id="InstallDatabaseSql" Guid="{81FB6008-A445-464F-8A0E-2EE076027FF3}"> <Component Id="InstallDatabaseSql" Guid="{81FB6008-A445-464F-8A0E-2EE076027FF3}">
<CreateFolder /> <CreateFolder />
<Condition>(NOT Installed OR NOT WIX_UPGRADE_DETECTED) AND NOT(DB_AUTH = "Windows Authentication")</Condition> <Condition>(NOT Installed AND NOT WIX_UPGRADE_DETECTED) AND NOT(DB_AUTH = "Windows Authentication")</Condition>
<util:User Id="SqlUser" Name="[DB_LOGIN]" Password="[DB_PASSWORD]" CreateUser="no" /> <util:User Id="SqlUser" Name="[DB_LOGIN]" Password="[DB_PASSWORD]" CreateUser="no" />
<sql:SqlDatabase Id="SqlDatabaseInstallSql" ConfirmOverwrite="yes" ContinueOnError="no" CreateOnInstall="yes" CreateOnReinstall="no" CreateOnUninstall="no" <sql:SqlDatabase Id="SqlDatabaseInstallSql" ConfirmOverwrite="yes" ContinueOnError="no" CreateOnInstall="yes" CreateOnReinstall="no" CreateOnUninstall="no"
DropOnInstall="no" DropOnReinstall="no" DropOnUninstall="no" DropOnInstall="no" DropOnReinstall="no" DropOnUninstall="no"
@ -654,7 +695,7 @@
</Component> </Component>
<Component Id="InstallDatabaseWin" Guid="{C50FC58C-3EF3-452D-BA9B-C9513B4D941A}"> <Component Id="InstallDatabaseWin" Guid="{C50FC58C-3EF3-452D-BA9B-C9513B4D941A}">
<CreateFolder /> <CreateFolder />
<Condition>(NOT Installed OR NOT WIX_UPGRADE_DETECTED) AND (DB_AUTH = "Windows Authentication")</Condition> <Condition>(NOT Installed AND NOT WIX_UPGRADE_DETECTED) AND (DB_AUTH = "Windows Authentication")</Condition>
<sql:SqlDatabase Id="SqlDatabaseInstallWin" ConfirmOverwrite="yes" ContinueOnError="no" CreateOnInstall="yes" CreateOnReinstall="no" CreateOnUninstall="no" <sql:SqlDatabase Id="SqlDatabaseInstallWin" ConfirmOverwrite="yes" ContinueOnError="no" CreateOnInstall="yes" CreateOnReinstall="no" CreateOnUninstall="no"
DropOnInstall="no" DropOnReinstall="no" DropOnUninstall="no" DropOnInstall="no" DropOnReinstall="no" DropOnUninstall="no"
Server="[DB_SERVER]" Server="[DB_SERVER]"
@ -680,9 +721,9 @@
<Component Id ="comp_WebsitePanel_config" Directory="WEBSITEPANELDIR" Guid="{28CD1ADB-562C-4E38-A3B6-325D3A2718B1}"> <Component Id ="comp_WebsitePanel_config" Directory="WEBSITEPANELDIR" Guid="{28CD1ADB-562C-4E38-A3B6-325D3A2718B1}">
<File Id="file_WebsitePanel_config" KeyPath="yes" Source="WebsitePanel.config" /> <File Id="file_WebsitePanel_config" KeyPath="yes" Source="WebsitePanel.config" />
</Component> </Component>
<Component Directory="WEBSITEPANELDIR"> <Component Id="comp_WebsitePanel_reg_locator" Directory="WEBSITEPANELDIR" Guid="{CC35E1B5-3E29-4AD1-991C-2904E4DCB099}">
<RegistryValue Root='HKCU' Key='SOFTWARE\[ProductName]' <RegistryValue Root='HKLM' Key='SOFTWARE\[ProductName]'
Name='Root' Value='[WEBSITEPANELDIR]' Name='Base' Value='[WEBSITEPANELDIR]'
Type='string' /> Type='string' />
</Component> </Component>
</ComponentGroup> </ComponentGroup>

View file

@ -88,7 +88,8 @@ namespace WebsitePanel.Setup
SwitchServer2AspNet40, SwitchServer2AspNet40,
SwitchEntServer2AspNet40, SwitchEntServer2AspNet40,
SwitchWebPortal2AspNet40, SwitchWebPortal2AspNet40,
ConfigureSecureSessionModuleInWebConfig ConfigureSecureSessionModuleInWebConfig,
RestoreConfig
} }
public class InstallAction public class InstallAction

View file

@ -322,12 +322,30 @@ namespace WebsitePanel.Setup
case WindowsVersion.WindowsServer2008: case WindowsVersion.WindowsServer2008:
ret = "Windows Server 2008"; ret = "Windows Server 2008";
break; break;
case WindowsVersion.WindowsServer2008R2:
ret = "Windows Server 2008 R2";
break;
case WindowsVersion.WindowsServer2012:
ret = "Windows Server 2012";
break;
case WindowsVersion.WindowsServer2012R2:
ret = "Windows Server 2012 R2";
break;
case WindowsVersion.WindowsVista: case WindowsVersion.WindowsVista:
ret = "Windows Vista"; ret = "Windows Vista";
break; break;
case WindowsVersion.WindowsXP: case WindowsVersion.WindowsXP:
ret = "Windows XP"; ret = "Windows XP";
break; break;
case WindowsVersion.Windows7:
ret = "Windows 7";
break;
case WindowsVersion.Windows8:
ret = "Windows 8";
break;
default:
ret = "Windows";
break;
} }
return ret; return ret;
} }

View file

@ -94,6 +94,9 @@ namespace WebsitePanel.Setup.Internal
case SetupActions.Uninstall: case SetupActions.Uninstall:
Uninstall(); Uninstall();
break; break;
case SetupActions.Setup:
Maintenance();
break;
default: default:
throw new NotImplementedException(); throw new NotImplementedException();
} }
@ -101,6 +104,7 @@ namespace WebsitePanel.Setup.Internal
protected abstract void Install(); protected abstract void Install();
protected abstract void Uninstall(); protected abstract void Uninstall();
protected abstract void Maintenance();
/// <summary> /// <summary>
/// LoadSetupVariablesFromParameters. /// LoadSetupVariablesFromParameters.
@ -393,6 +397,9 @@ namespace WebsitePanel.Setup.Internal
case ActionTypes.ConfigureSecureSessionModuleInWebConfig: case ActionTypes.ConfigureSecureSessionModuleInWebConfig:
ConfigureSecureSessionModuleInWebConfig(); ConfigureSecureSessionModuleInWebConfig();
break; break;
case ActionTypes.RestoreConfig:
RestoreXmlConfigs(Execute.SetupVariables);
break;
} }
} }
catch (Exception ex) catch (Exception ex)
@ -402,7 +409,6 @@ namespace WebsitePanel.Setup.Internal
} }
} }
} }
protected virtual List<InstallAction> GetActions(string ComponentID) protected virtual List<InstallAction> GetActions(string ComponentID)
{ {
return new List<InstallAction>(); return new List<InstallAction>();
@ -843,7 +849,7 @@ namespace WebsitePanel.Setup.Internal
return; return;
} }
// Load web.config // Load web.config
XmlDocument doc = new XmlDocument(); var doc = new XmlDocument();
doc.Load(webConfigPath); doc.Load(webConfigPath);
// add node: // add node:
@ -993,7 +999,7 @@ namespace WebsitePanel.Setup.Internal
return; return;
} }
// Load web.config // Load web.config
XmlDocument doc = new XmlDocument(); var doc = new XmlDocument();
doc.Load(webConfigPath); doc.Load(webConfigPath);
// do Windows 2008 platform-specific changes // do Windows 2008 platform-specific changes
bool iis7 = (Context.IISVersion.Major >= 7); bool iis7 = (Context.IISVersion.Major >= 7);
@ -1229,7 +1235,7 @@ namespace WebsitePanel.Setup.Internal
private string GetConnectionString(string webConfigPath) private string GetConnectionString(string webConfigPath)
{ {
string ret = null; string ret = null;
XmlDocument doc = new XmlDocument(); var doc = new XmlDocument();
doc.Load(webConfigPath); doc.Load(webConfigPath);
//connection string //connection string
string xPath = "configuration/connectionStrings/add[@name=\"EnterpriseServer\"]"; string xPath = "configuration/connectionStrings/add[@name=\"EnterpriseServer\"]";
@ -1244,7 +1250,7 @@ namespace WebsitePanel.Setup.Internal
private string GetCryptoKey(string webConfigPath) private string GetCryptoKey(string webConfigPath)
{ {
string ret = null; string ret = null;
XmlDocument doc = new XmlDocument(); var doc = new XmlDocument();
doc.Load(webConfigPath); doc.Load(webConfigPath);
//crypto key //crypto key
string xPath = "configuration/appSettings/add[@key=\"WebsitePanel.CryptoKey\"]"; string xPath = "configuration/appSettings/add[@key=\"WebsitePanel.CryptoKey\"]";
@ -1258,7 +1264,7 @@ namespace WebsitePanel.Setup.Internal
private bool IsEncryptionEnabled(string webConfigPath) private bool IsEncryptionEnabled(string webConfigPath)
{ {
XmlDocument doc = new XmlDocument(); var doc = new XmlDocument();
doc.Load(webConfigPath); doc.Load(webConfigPath);
//encryption enabled //encryption enabled
string xPath = "configuration/appSettings/add[@key=\"WebsitePanel.EncryptionEnabled\"]"; string xPath = "configuration/appSettings/add[@key=\"WebsitePanel.EncryptionEnabled\"]";
@ -2316,7 +2322,7 @@ namespace WebsitePanel.Setup.Internal
} }
Log.WriteStart("Updating config.xml file"); Log.WriteStart("Updating config.xml file");
XmlDocument doc = new XmlDocument(); var doc = new XmlDocument();
doc.Load(path); doc.Load(path);
XmlNode serversNode = doc.SelectSingleNode("//myLittleAdmin/sqlservers"); XmlNode serversNode = doc.SelectSingleNode("//myLittleAdmin/sqlservers");
@ -2429,7 +2435,7 @@ namespace WebsitePanel.Setup.Internal
return; return;
} }
// Load web.config // Load web.config
XmlDocument doc = new XmlDocument(); var doc = new XmlDocument();
doc.Load(webConfigPath); doc.Load(webConfigPath);
// Tighten WSE security on local machine // Tighten WSE security on local machine
@ -2513,7 +2519,7 @@ namespace WebsitePanel.Setup.Internal
} }
Log.WriteStart("Loading portal settings"); Log.WriteStart("Loading portal settings");
XmlDocument doc = new XmlDocument(); var doc = new XmlDocument();
doc.Load(path); doc.Load(path);
string xPath = "configuration/connectionStrings/add[@name=\"SiteSqlServer\"]"; string xPath = "configuration/connectionStrings/add[@name=\"SiteSqlServer\"]";
@ -2605,7 +2611,7 @@ namespace WebsitePanel.Setup.Internal
} }
Log.WriteStart("Updating site settings"); Log.WriteStart("Updating site settings");
XmlDocument doc = new XmlDocument(); var doc = new XmlDocument();
doc.Load(path); doc.Load(path);
XmlElement urlNode = doc.SelectSingleNode("SiteSettings/EnterpriseServer") as XmlElement; XmlElement urlNode = doc.SelectSingleNode("SiteSettings/EnterpriseServer") as XmlElement;
@ -3178,7 +3184,7 @@ namespace WebsitePanel.Setup.Internal
} }
Log.WriteStart("Updating configuration file (server password)"); Log.WriteStart("Updating configuration file (server password)");
XmlDocument doc = new XmlDocument(); var doc = new XmlDocument();
doc.Load(path); doc.Load(path);
XmlElement passwordNode = doc.SelectSingleNode("//websitepanel.server/security/password") as XmlElement; XmlElement passwordNode = doc.SelectSingleNode("//websitepanel.server/security/password") as XmlElement;
@ -3221,7 +3227,7 @@ namespace WebsitePanel.Setup.Internal
} }
Log.WriteStart("Updating configuration file (service settings)"); Log.WriteStart("Updating configuration file (service settings)");
XmlDocument doc = new XmlDocument(); var doc = new XmlDocument();
doc.Load(path); doc.Load(path);
XmlElement ipNode = doc.SelectSingleNode("//configuration/appSettings/add[@key='WebsitePanel.HostIP']") as XmlElement; XmlElement ipNode = doc.SelectSingleNode("//configuration/appSettings/add[@key='WebsitePanel.HostIP']") as XmlElement;
@ -3881,7 +3887,7 @@ namespace WebsitePanel.Setup.Internal
return; return;
} }
// Load web.config // Load web.config
XmlDocument doc = new XmlDocument(); var doc = new XmlDocument();
doc.Load(webConfigPath); doc.Load(webConfigPath);
// replace existing node: // replace existing node:
@ -3915,8 +3921,63 @@ namespace WebsitePanel.Setup.Internal
} }
#endregion #endregion
#endregion #endregion
private void RestoreXmlConfigs(SetupVariables Ctx)
{
try
{
Log.WriteStart("RestoreXmlConfigs");
var Backup = BackupRestore.Find(Ctx.InstallerFolder, "WebsitePanel", Ctx.ComponentName);
switch(Ctx.ComponentCode)
{
case "server":
{
Backup.XmlFiles.Add("Web.config");
}
break;
case "enterpriseserver":
{
Backup.XmlFiles.Add("Web.config");
}
break;
case "portal":
{
Backup.XmlFiles.Add("Web.config");
Backup.XmlFiles.Add(@"App_Data\Countries.config");
Backup.XmlFiles.Add(@"App_Data\CountryStates.config");
Backup.XmlFiles.Add(@"App_Data\Ecommerce_Modules.config");
Backup.XmlFiles.Add(@"App_Data\Ecommerce_Pages.config");
Backup.XmlFiles.Add(@"App_Data\ESModule_ControlsHierarchy.config");
Backup.XmlFiles.Add(@"App_Data\ModulesData.config");
Backup.XmlFiles.Add(@"App_Data\SiteSettings.config");
Backup.XmlFiles.Add(@"App_Data\SupportedLocales.config");
Backup.XmlFiles.Add(@"App_Data\SupportedThemes.config");
Backup.XmlFiles.Add(@"App_Data\WebsitePanel_Modules.config");
Backup.XmlFiles.Add(@"App_Data\WebsitePanel_Pages.config");
}
break;
}
var MainCfg = Path.Combine(Ctx.InstallerFolder, BackupRestore.MainConfig);
var XCfg = new XmlDocument();
XCfg.Load(MainCfg);
if (XCfg.SelectSingleNode("//components").ChildNodes.Count == 0)
{
Log.WriteInfo("Restoring main config...");
XmlDocumentMerge.Process(Backup.BackupMainConfigFile, MainCfg);
Context.ComponentId = WiXSetup.GetComponentID(Ctx);
AppConfig.LoadConfiguration(new ExeConfigurationFileMap { ExeConfigFilename = MainCfg });
AppConfig.LoadComponentSettings(Ctx);
}
Log.WriteInfo(string.Format("Restoring xml config for component - {0}.", Ctx.ComponentFullName));
Backup.Restore();
Log.WriteEnd("RestoreXmlConfigs");
}
catch (Exception ex)
{
Log.WriteError("RestoreXmlConfigs", ex);
throw;
}
}
} }
public class UninstallScript : SetupScript // UninstallPage public class UninstallScript : SetupScript // UninstallPage
{ {
public UninstallScript(SetupVariables SessionVariables):base(SessionVariables) public UninstallScript(SetupVariables SessionVariables):base(SessionVariables)
@ -4117,12 +4178,22 @@ namespace WebsitePanel.Setup.Internal
protected override List<InstallAction> GetActions(string ComponentID) protected override List<InstallAction> GetActions(string ComponentID)
{ {
var Scenario = base.GetActions(ComponentID); var Scenario = base.GetActions(ComponentID);
var Act = new InstallAction(ActionTypes.UpdateConfig); Scenario.Add(new InstallAction(ActionTypes.RestoreConfig) { SetupVariables = Context, Description = "Restoring xml configuration files..." });
Act.Description = "Updating system configuration..."; Scenario.Add(new InstallAction(ActionTypes.UpdateConfig) { Description = "Updating system configuration..." });
Scenario.Add(Act); Scenario.Add(new InstallAction(ActionTypes.StartApplicationPool) { Description = "Starting IIS Application Pool..." });
Act = new InstallAction(ActionTypes.StartApplicationPool); return Scenario;
Act.Description = "Starting IIS Application Pool..."; }
Scenario.Add(Act); }
public class MaintenanceScript: ExpressScript
{
public MaintenanceScript(SetupVariables SessionVariables):base(SessionVariables)
{
Context.SetupAction = SetupActions.Setup;
}
protected override List<InstallAction> GetActions(string ComponentID)
{
var Scenario = base.GetActions(ComponentID);
Scenario.Add(new InstallAction(ActionTypes.UpdateConfig) { Description = "Updating system configuration..." });
return Scenario; return Scenario;
} }
} }
@ -4170,6 +4241,7 @@ namespace WebsitePanel.Setup.Internal
else if (ModeExtension == ModeExtension.Restore) else if (ModeExtension == ModeExtension.Restore)
{ {
Context.ComponentId = GetComponentID(Context); Context.ComponentId = GetComponentID(Context);
Context.UpdateVersion = Context.Release;
AppConfig.LoadComponentSettings(Context); AppConfig.LoadComponentSettings(Context);
new RestoreScript(Context).Run(); new RestoreScript(Context).Run();
} }
@ -4194,12 +4266,19 @@ namespace WebsitePanel.Setup.Internal
} }
Script.Run(); Script.Run();
} }
protected override void Maintenance()
{
Context.ComponentId = GetComponentID(Context);
AppConfig.LoadComponentSettings(Context);
SetupScript Script = new MaintenanceScript(Context);
Script.Actions.Add(new InstallAction(ActionTypes.UpdateServerPassword) { Description = "Updating server password..." });
Script.Run();
}
} }
public class EServerSetup : WiXSetup public class EServerSetup : WiXSetup
{ {
public EServerSetup(SetupVariables Ctx) public EServerSetup(SetupVariables Ctx, ModeExtension Ext)
: base(Ctx) : base(Ctx, Ext)
{ {
} }
@ -4210,7 +4289,7 @@ namespace WebsitePanel.Setup.Internal
SetupVars.SetupAction = Action; SetupVars.SetupAction = Action;
SetupVars.IISVersion = Global.IISVersion; SetupVars.IISVersion = Global.IISVersion;
AppConfig.LoadConfiguration(new ExeConfigurationFileMap { ExeConfigFilename = GetFullConfigPath(SetupVars) }); AppConfig.LoadConfiguration(new ExeConfigurationFileMap { ExeConfigFilename = GetFullConfigPath(SetupVars) });
return new EServerSetup(SetupVars); return new EServerSetup(SetupVars, GetModeExtension(Ctx));
} }
protected override void Install() protected override void Install()
{ {
@ -4240,6 +4319,7 @@ namespace WebsitePanel.Setup.Internal
else if (ModeExtension == ModeExtension.Restore) else if (ModeExtension == ModeExtension.Restore)
{ {
Context.ComponentId = GetComponentID(Context); Context.ComponentId = GetComponentID(Context);
Context.UpdateVersion = Context.Release;
AppConfig.LoadComponentSettings(Context); AppConfig.LoadComponentSettings(Context);
new RestoreScript(Context).Run(); new RestoreScript(Context).Run();
} }
@ -4264,12 +4344,19 @@ namespace WebsitePanel.Setup.Internal
} }
Script.Run(); Script.Run();
} }
protected override void Maintenance()
{
Context.ComponentId = GetComponentID(Context);
AppConfig.LoadComponentSettings(Context);
SetupScript Script = new MaintenanceScript(Context);
Script.Actions.Add(new InstallAction(ActionTypes.UpdateServerAdminPassword) { Description = "Updating serveradmin password..." });
Script.Run();
}
} }
public class PortalSetup : WiXSetup public class PortalSetup : WiXSetup
{ {
public PortalSetup(SetupVariables Ctx) public PortalSetup(SetupVariables Ctx, ModeExtension Ext)
: base(Ctx) : base(Ctx, Ext)
{ {
} }
@ -4280,7 +4367,7 @@ namespace WebsitePanel.Setup.Internal
SetupVars.SetupAction = Action; SetupVars.SetupAction = Action;
SetupVars.IISVersion = Global.IISVersion; SetupVars.IISVersion = Global.IISVersion;
AppConfig.LoadConfiguration(new ExeConfigurationFileMap { ExeConfigFilename = GetFullConfigPath(SetupVars) }); AppConfig.LoadConfiguration(new ExeConfigurationFileMap { ExeConfigFilename = GetFullConfigPath(SetupVars) });
return new PortalSetup(SetupVars); return new PortalSetup(SetupVars, GetModeExtension(Ctx));
} }
protected override void Install() protected override void Install()
{ {
@ -4306,17 +4393,11 @@ namespace WebsitePanel.Setup.Internal
} }
if (WiXThrow) if (WiXThrow)
InstallFailed(); InstallFailed();
else if (ModeExtension == ModeExtension.Restore)
{
Context.ComponentId = GetComponentID(Context);
AppConfig.LoadComponentSettings(Context);
new RestoreScript(Context).Run();
}
} }
else if (ModeExtension == ModeExtension.Restore) else if (ModeExtension == ModeExtension.Restore)
{ {
Context.ComponentId = GetComponentID(Context); Context.ComponentId = GetComponentID(Context);
Context.UpdateVersion = Context.Release;
AppConfig.LoadComponentSettings(Context); AppConfig.LoadComponentSettings(Context);
new RestoreScript(Context).Run(); new RestoreScript(Context).Run();
} }
@ -4348,8 +4429,15 @@ namespace WebsitePanel.Setup.Internal
} }
Script.Run(); Script.Run();
} }
protected override void Maintenance()
{
Context.ComponentId = GetComponentID(Context);
AppConfig.LoadComponentSettings(Context);
SetupScript Script = new MaintenanceScript(Context);
Script.Actions.Add(new InstallAction(ActionTypes.UpdateEnterpriseServerUrl) { Description = "Updating site settings..." });
Script.Run();
}
} }
#region WiXActionManagers #region WiXActionManagers
public class WiXServerActionManager : BaseActionManager public class WiXServerActionManager : BaseActionManager
{ {

View file

@ -0,0 +1,122 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Xml;
using Ionic.Zip;
namespace WebsitePanel.Setup.Internal
{
class BackupRestore
{
struct DirectoryTag
{
public string Name;
public DateTime Date;
public Version Version;
}
public const string MainConfig = "WebsitePanel.config";
const string BackupDirectory = "Backup";
const string ConfigDirectory = "Config";
const string AppZip = @"App\app.zip";
const string DateFormat = "yyyy-MM-dd";
public BackupRestore()
{
XmlFiles = new List<string>();
}
public static BackupRestore Find(string Root, string Product, string Id)
{
var Result = default(BackupRestore);
var Dir = Path.Combine(Root, BackupDirectory);
var FullId = GetFullId(Product, Id);
if (Directory.Exists(Dir))
{
var DirList = new List<DirectoryTag>();
foreach (var DateItem in Directory.GetDirectories(Dir))
{
DateTime date;
var DateName = new DirectoryInfo(DateItem).Name;
if (DateTime.TryParseExact(DateName, DateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out date))
{
foreach (var VersionItem in Directory.GetDirectories(DateItem))
{
var VersionName = new DirectoryInfo(VersionItem).Name;
if (VersionName.StartsWith(FullId, StringComparison.InvariantCultureIgnoreCase))
{
Version BckpVersion;
var StrVersion = VersionName.Substring(FullId.Length);
if (Version.TryParse(StrVersion, out BckpVersion))
{
DirList.Add(new DirectoryTag { Name = VersionItem, Date = date, Version = BckpVersion });
}
}
}
}
}
var ByVersion = from i in DirList where i.Version == (from v in DirList select v.Version).Max() select i;
var ByDate = from i in ByVersion where i.Date == (from v in ByVersion select v.Date).Max() select i;
var SrcTag = ByDate.First();
Result = new BackupRestore { Id = Id, Root = GetComponentRoot(SrcTag, Id), BackupFile = Path.Combine(SrcTag.Name, AppZip), BackupMainConfigFile = GetMainConfig(SrcTag) };
}
return Result;
}
private static string GetComponentRoot(DirectoryTag DirTag, string Id)
{
var Cfg = GetMainConfig(DirTag);
if (string.IsNullOrWhiteSpace(Cfg))
throw new Exception("Broken backup. Main config file not found.");
var XCfg = new XmlDocument();
XCfg.Load(Cfg);
var Component = XCfg.SelectSingleNode(string.Format("//component[.//add/@key='ComponentName' and .//add/@value='{0}']", Id));
var InstallFolder = Component.SelectSingleNode(".//add[@key='InstallFolder']");
return InstallFolder.Attributes["value"].Value;
}
private static string GetMainConfig(DirectoryTag DirTag)
{
return Path.Combine(DirTag.Name, ConfigDirectory, MainConfig);
}
private static string GetFullId(string Product, string Id)
{
return string.Format("{0} {1}", Product, Id);
}
public virtual void Restore()
{
using (var Bckp = new ZipFile(BackupFile))
{
foreach (var Xml in XmlFiles)
{
var SrcEntry = from Entry in Bckp.Entries where NormalizePath(Entry.FileName.ToLowerInvariant(), "/") == Xml.ToLowerInvariant() select Entry;
if (SrcEntry != null)
{
if (SrcEntry.LongCount() > 1)
throw new Exception(string.Format("Too many backup entries - {0}.", Xml));
var FileEntry = SrcEntry.FirstOrDefault();
if (FileEntry != null)
{
using (var InMem = new MemoryStream())
{
FileEntry.Extract(InMem);
InMem.Seek(0, SeekOrigin.Begin);
using (var OutFile = new FileStream(Path.Combine(Root, Xml), FileMode.Open, FileAccess.ReadWrite))
{
XmlDocumentMerge.Process(InMem, OutFile);
}
}
}
}
}
}
}
private string NormalizePath(string FilePath, string In)
{
return Path.Combine(FilePath.Split(new string[] { In }, StringSplitOptions.RemoveEmptyEntries));
}
public string Id { get; set; } // Component full name.
public string Comment { get; set; }
public string BackupFile { get; set; } // Should be zip archive.
public string BackupMainConfigFile { get; set; }
public IList<string> XmlFiles { get; set; } // Xml files (configs) to merge and update.
public string Root { get; set; }
}
}

View file

@ -0,0 +1,139 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml;
using System.Xml.XPath;
namespace WebsitePanel.Setup.Internal
{
public static class XmlDocumentMerge
{
const string SuccessFormat = "Success: {0}.";
const string ErrorFormat = "Error: {0}.";
const string MergeCompleted = "XmlDocumentMerge completed";
static XmlDocumentMerge()
{
KeyAttributes = new List<string> { "name", "id", "key" };
}
public static List<string> KeyAttributes { get; set; }
public static string Process(string Src, string Dst, string SaveTo = "")
{
var Result = string.Empty;
if (!File.Exists(Src))
Result = string.Format(ErrorFormat, string.Format("source document [{0}] does not exists", Src));
else if (!File.Exists(Dst))
Result = string.Format(ErrorFormat, string.Format("destination document [{0}] does not exists", Dst));
else
{
try
{
var InStream = new FileStream(Src, FileMode.Open, FileAccess.Read);
var OutStream = new FileStream(Dst, FileMode.Open, FileAccess.ReadWrite);
Result = Process(InStream,
OutStream,
SaveTo);
InStream.Close();
OutStream.Flush();
OutStream.Close();
}
catch (Exception ex)
{
Result = string.Format(ErrorFormat, ex.ToString());
}
}
return Result;
}
public static string Process(Stream InSrc, Stream OutDst, string SaveTo = "")
{
var Result = string.Format(SuccessFormat, MergeCompleted);
try
{
var SrcDoc = new XmlDocument();
SrcDoc.Load(InSrc);
var DstDoc = new XmlDocument();
DstDoc.Load(OutDst);
var DstNavi = DstDoc.CreateNavigator();
var DstIterator = DstNavi.SelectChildren(XPathNodeType.All);
while (DstIterator.MoveNext())
Merge(DstIterator.Current.Clone(), SrcDoc, string.Empty);
if (string.IsNullOrWhiteSpace(SaveTo))
{
OutDst.SetLength(0);
DstDoc.Save(OutDst);
}
else
DstDoc.Save(SaveTo);
}
catch (Exception ex)
{
Result = string.Format(ErrorFormat, ex.ToString());
}
return Result;
}
private static string NodePath(string Parent, string Current)
{
var Result = string.Empty;
if (!string.IsNullOrWhiteSpace(Parent) && !string.IsNullOrWhiteSpace(Current))
Result = string.Format("{0}/{1}", Parent, Current);
else if (!string.IsNullOrWhiteSpace(Parent))
Result = Parent;
else if (!string.IsNullOrWhiteSpace(Current))
Result = Current;
return Result;
}
private static string NodeView(XPathNavigator Navi)
{
foreach (var Attr in KeyAttributes)
{
var Value = Navi.GetAttribute(Attr, string.Empty);
if (!string.IsNullOrWhiteSpace(Value))
return string.Format("{0}[@{1}='{2}']", Navi.Name, Attr, Value);
}
return Navi.Name;
}
private static void Merge(XPathNavigator DstNavi, XmlDocument SrcDoc, string Parent)
{
if (DstNavi.NodeType == XPathNodeType.Element)
{
var SrcElem = SrcDoc.SelectSingleNode(NodePath(Parent, NodeView(DstNavi)));
if (SrcElem != null)
{
if (DstNavi.MoveToFirstAttribute())
{
do
{
var SrcElemAttr = SrcElem.Attributes[DstNavi.LocalName];
if (SrcElemAttr != null)
DstNavi.SetValue(SrcElemAttr.Value);
}
while (DstNavi.MoveToNextAttribute());
DstNavi.MoveToParent();
}
}
}
else if (DstNavi.NodeType == XPathNodeType.Text)
{
var SrcElem = SrcDoc.SelectSingleNode(NodePath(Parent, NodeView(DstNavi)));
if (SrcElem != null)
DstNavi.SetValue(SrcElem.InnerText);
}
var Here = NodeView(DstNavi);
if (DstNavi.MoveToFirstChild())
{
do
{
Merge(DstNavi, SrcDoc, NodePath(Parent, Here));
}
while (DstNavi.MoveToNext());
DstNavi.MoveToParent();
}
else if (DstNavi.NodeType == XPathNodeType.Element)
{
var SrcElem = SrcDoc.SelectSingleNode(NodePath(Parent, Here));
if (SrcElem != null && !string.IsNullOrWhiteSpace(SrcElem.InnerXml))
foreach (XmlNode Child in SrcElem.ChildNodes)
DstNavi.AppendChild(Child.CloneNode(true).CreateNavigator());
}
}
}
}

View file

@ -144,6 +144,8 @@
<Compile Include="EnterpriseServer10.cs" /> <Compile Include="EnterpriseServer10.cs" />
<Compile Include="EnterpriseServer20.cs" /> <Compile Include="EnterpriseServer20.cs" />
<Compile Include="Internal\Adapter.cs" /> <Compile Include="Internal\Adapter.cs" />
<Compile Include="Internal\BackupRestore.cs" />
<Compile Include="Internal\XmlDocumentMerge.cs" />
<Compile Include="Portal10.cs" /> <Compile Include="Portal10.cs" />
<Compile Include="Portal20.cs" /> <Compile Include="Portal20.cs" />
<Compile Include="Server10.cs" /> <Compile Include="Server10.cs" />

View file

@ -0,0 +1,55 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using Microsoft.Deployment.WindowsInstaller;
namespace WebsitePanel.WIXInstaller.Common
{
public class WiXLogFileListener : TraceListener
{
public const uint FileFlushSize = 4096;
public const string DefaultLogFile = "WSPInstallation.log.txt";
public static string LogFile { get; private set; }
private StringBuilder m_Ctx;
static WiXLogFileListener()
{
LogFile = Path.Combine(Path.GetTempPath() + DefaultLogFile);
}
public WiXLogFileListener(string LogFileName = DefaultLogFile)
: base("WiXLogFileListener")
{
m_Ctx = new StringBuilder();
}
~WiXLogFileListener()
{
Dispose(false);
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
Flush(true);
}
public override void Write(string Value)
{
m_Ctx.Append(Value);
Flush();
}
public override void WriteLine(string Value)
{
m_Ctx.AppendLine(Value);
Flush();
}
private void Flush(bool Force = false)
{
if(m_Ctx.Length >= FileFlushSize || Force)
{
using (var FileCtx = new StreamWriter(LogFile, true))
{
FileCtx.Write(m_Ctx.ToString());
}
m_Ctx.Clear();
}
}
}
}

View file

@ -54,6 +54,48 @@ namespace WebsitePanel.WIXInstaller
#region CustomActions #region CustomActions
[CustomAction] [CustomAction]
public static ActionResult MaintenanceServer(Session session)
{
var Result = ActionResult.Success;
Log.WriteStart("MaintenanceServer");
Result = ProcessInstall(session, WiXInstallType.MaintenanceServer);
Log.WriteEnd("MaintenanceServer");
return Result;
}
[CustomAction]
public static ActionResult MaintenanceEServer(Session session)
{
var Result = ActionResult.Success;
Log.WriteStart("MaintenanceEServer");
Result = ProcessInstall(session, WiXInstallType.MaintenanceEnterpriseServer);
Log.WriteEnd("MaintenanceEServer");
return Result;
}
[CustomAction]
public static ActionResult MaintenancePortal(Session session)
{
var Result = ActionResult.Success;
Log.WriteStart("MaintenancePortal");
Result = ProcessInstall(session, WiXInstallType.MaintenancePortal);
Log.WriteEnd("MaintenancePortal");
return Result;
}
[CustomAction]
public static ActionResult PreFillSettings(Session session)
{
PopUpDebugger();
var Ctx = session;
Ctx.AttachToSetupLog();
Log.WriteStart("PreFillSettings");
TryApllyNewPassword(Ctx, "PI_SERVER_PASSWORD");
TryApllyNewPassword(Ctx, "PI_ESERVER_PASSWORD");
TryApllyNewPassword(Ctx, "PI_PORTAL_PASSWORD");
TryApllyNewPassword(Ctx, "SERVER_ACCESS_PASSWORD");
TryApllyNewPassword(Ctx, "SERVERADMIN_PASSWORD");
Log.WriteEnd("PreFillSettings");
return ActionResult.Success;
}
[CustomAction]
public static ActionResult InstallWebFeatures(Session session) public static ActionResult InstallWebFeatures(Session session)
{ {
var Msg = string.Empty; var Msg = string.Empty;
@ -406,6 +448,7 @@ namespace WebsitePanel.WIXInstaller
[CustomAction] [CustomAction]
public static ActionResult FillIpListUI(Session session) public static ActionResult FillIpListUI(Session session)
{ {
PopUpDebugger();
var Ctrls = new[]{ new ComboBoxCtrl(session, "PI_SERVER_IP"), var Ctrls = new[]{ new ComboBoxCtrl(session, "PI_SERVER_IP"),
new ComboBoxCtrl(session, "PI_ESERVER_IP"), new ComboBoxCtrl(session, "PI_ESERVER_IP"),
new ComboBoxCtrl(session, "PI_PORTAL_IP") }; new ComboBoxCtrl(session, "PI_PORTAL_IP") };
@ -717,18 +760,27 @@ namespace WebsitePanel.WIXInstaller
case WiXInstallType.RemoveServer: case WiXInstallType.RemoveServer:
Install = ServerSetup.Create(Ctx.CustomActionData, SetupActions.Uninstall); Install = ServerSetup.Create(Ctx.CustomActionData, SetupActions.Uninstall);
break; break;
case WiXInstallType.MaintenanceServer:
Install = ServerSetup.Create(Ctx.CustomActionData, SetupActions.Setup);
break;
case WiXInstallType.InstallEnterpriseServer: case WiXInstallType.InstallEnterpriseServer:
Install = EServerSetup.Create(Ctx.CustomActionData, SetupActions.Install); Install = EServerSetup.Create(Ctx.CustomActionData, SetupActions.Install);
break; break;
case WiXInstallType.RemoveEnterpriseServer: case WiXInstallType.RemoveEnterpriseServer:
Install = EServerSetup.Create(Ctx.CustomActionData, SetupActions.Uninstall); Install = EServerSetup.Create(Ctx.CustomActionData, SetupActions.Uninstall);
break; break;
case WiXInstallType.MaintenanceEnterpriseServer:
Install = EServerSetup.Create(Ctx.CustomActionData, SetupActions.Setup);
break;
case WiXInstallType.InstallPortal: case WiXInstallType.InstallPortal:
Install = PortalSetup.Create(Ctx.CustomActionData, SetupActions.Install); Install = PortalSetup.Create(Ctx.CustomActionData, SetupActions.Install);
break; break;
case WiXInstallType.RemovePortal: case WiXInstallType.RemovePortal:
Install = PortalSetup.Create(Ctx.CustomActionData, SetupActions.Uninstall); Install = PortalSetup.Create(Ctx.CustomActionData, SetupActions.Uninstall);
break; break;
case WiXInstallType.MaintenancePortal:
Install = PortalSetup.Create(Ctx.CustomActionData, SetupActions.Setup);
break;
default: default:
throw new NotImplementedException(); throw new NotImplementedException();
} }
@ -751,6 +803,17 @@ namespace WebsitePanel.WIXInstaller
{ {
Debugger.Launch(); Debugger.Launch();
} }
private static void TryApllyNewPassword(Session Ctx, string Id)
{
var Pass = Ctx[Id];
if (string.IsNullOrWhiteSpace(Pass))
{
Pass = Guid.NewGuid().ToString();
Ctx[Id] = Pass;
Ctx[Id + "_CONFIRM"] = Pass;
Log.WriteInfo("New password was applied to " + Id);
}
}
} }
public static class SessionExtension public static class SessionExtension
{ {
@ -758,9 +821,9 @@ namespace WebsitePanel.WIXInstaller
{ {
WiXSetup.InstallLogListener(new WiXLogListener(Ctx)); WiXSetup.InstallLogListener(new WiXLogListener(Ctx));
WiXSetup.InstallLogListener(new InMemoryStringLogListener("WIX CA IN MEMORY")); WiXSetup.InstallLogListener(new InMemoryStringLogListener("WIX CA IN MEMORY"));
WiXSetup.InstallLogListener(new WiXLogFileListener());
} }
} }
internal enum WiXInstallType: byte internal enum WiXInstallType: byte
{ {
InstallServer, InstallServer,
@ -769,7 +832,8 @@ namespace WebsitePanel.WIXInstaller
RemoveServer, RemoveServer,
RemoveEnterpriseServer, RemoveEnterpriseServer,
RemovePortal, RemovePortal,
RemoveUpdate, MaintenanceServer,
RestoreUpdate MaintenanceEnterpriseServer,
MaintenancePortal
} }
} }

View file

@ -63,6 +63,7 @@
<Compile Include="Common\Tool.cs" /> <Compile Include="Common\Tool.cs" />
<Compile Include="Common\Prop.cs" /> <Compile Include="Common\Prop.cs" />
<Compile Include="Common\Util\IListCtrl.cs" /> <Compile Include="Common\Util\IListCtrl.cs" />
<Compile Include="Common\WiXLogFileListener.cs" />
<Compile Include="Common\WiXLogListener.cs" /> <Compile Include="Common\WiXLogListener.cs" />
<Compile Include="Common\YesNo.cs" /> <Compile Include="Common\YesNo.cs" />
<Compile Include="CustomAction.cs" /> <Compile Include="CustomAction.cs" />

View file

@ -8197,11 +8197,13 @@ AS
INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID
WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 3) WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 3)
ELSE IF @QuotaID = 558 BEGIN -- RAM of VPS2012 ELSE IF @QuotaID = 558 BEGIN -- RAM of VPS2012
DECLARE @Result1 int = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP DECLARE @Result1 int
SET @Result1 = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP
INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID
INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID
WHERE SIP.PropertyName = 'RamSize' AND PT.ParentPackageID = @PackageID) WHERE SIP.PropertyName = 'RamSize' AND PT.ParentPackageID = @PackageID)
DECLARE @Result2 int = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP DECLARE @Result2 int
SET @Result2 = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP
INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID
INNER JOIN ServiceItemProperties AS SIP2 ON INNER JOIN ServiceItemProperties AS SIP2 ON
SIP2.ItemID = SI.ItemID AND SIP2.PropertyName = 'DynamicMemory.Enabled' AND SIP2.PropertyValue = 'True' SIP2.ItemID = SI.ItemID AND SIP2.PropertyName = 'DynamicMemory.Enabled' AND SIP2.PropertyValue = 'True'
@ -8910,6 +8912,12 @@ INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDe
END END
GO GO
IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaID] = '572')
BEGIN
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (572, 33, 20, N'VPS2012.ReplicationEnabled', N'Allow user to Replication', 1, 0, NULL, NULL)
END
GO
IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [ProviderName] = 'HyperV2012R2') IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [ProviderName] = 'HyperV2012R2')
BEGIN BEGIN
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (350, 33, N'HyperV2012R2', N'Microsoft Hyper-V 2012 R2', N'WebsitePanel.Providers.Virtualization.HyperV2012R2, WebsitePanel.Providers.Virtualization.HyperV2012R2', N'HyperV2012R2', 1) INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (350, 33, N'HyperV2012R2', N'Microsoft Hyper-V 2012 R2', N'WebsitePanel.Providers.Virtualization.HyperV2012R2, WebsitePanel.Providers.Virtualization.HyperV2012R2', N'HyperV2012R2', 1)
@ -9590,6 +9598,13 @@ IF EXISTS (SELECT * FROM ResourceGroups WHERE GroupName = 'SharePoint')
BEGIN BEGIN
DECLARE @group_id INT DECLARE @group_id INT
SELECT @group_id = GroupId FROM ResourceGroups WHERE GroupName = 'SharePoint' SELECT @group_id = GroupId FROM ResourceGroups WHERE GroupName = 'SharePoint'
DELETE FROM PackageQuotas WHERE QuotaID IN (SELECT QuotaID FROM Quotas WHERE GroupID = @group_id)
DELETE FROM HostingPlanQuotas WHERE QuotaID IN (SELECT QuotaID FROM Quotas WHERE GroupID = @group_id)
DELETE FROM HostingPlanResources WHERE GroupId = @group_id
DELETE FROM PackagesBandwidth WHERE GroupId = @group_id
DELETE FROM PackagesDiskspace WHERE GroupId = @group_id
DELETE FROM PackageResources WHERE GroupId = @group_id
DELETE FROM ResourceGroupDnsRecords WHERE GroupId = @group_id
DELETE FROM Providers WHERE GroupID = @group_id DELETE FROM Providers WHERE GroupID = @group_id
DELETE FROM Quotas WHERE GroupID = @group_id DELETE FROM Quotas WHERE GroupID = @group_id
DELETE FROM VirtualGroups WHERE GroupID = @group_id DELETE FROM VirtualGroups WHERE GroupID = @group_id
@ -10020,6 +10035,145 @@ UPDATE [dbo].[UserSettings] SET [PropertyValue] = @UserPasswordResetLetterTextBo
GO GO
DECLARE @UserPasswordResetSMSBody nvarchar(2500)
Set @UserPasswordResetSMSBody = N'Password reset link:
#passwordResetLink#
'
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetLetter' AND [PropertyName]= N'PasswordResetLinkSmsBody' )
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetLetter', N'PasswordResetLinkSmsBody', @UserPasswordResetSMSBody)
END
ELSE
UPDATE [dbo].[UserSettings] SET [PropertyValue] = @UserPasswordResetSMSBody WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetLetter' AND [PropertyName]= N'PasswordResetLinkSmsBody'
GO
-- USER PASSWORD RESET EMAIL PINCODE TEMPLATE
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'From' )
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetPincodeLetter', N'From', N'support@HostingCompany.com')
END
GO
DECLARE @UserPasswordResetPincodeLetterHtmlBody nvarchar(2500)
Set @UserPasswordResetPincodeLetterHtmlBody = N'<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Password reset notification</title>
<style type="text/css">
.Summary { background-color: ##ffffff; padding: 5px; }
.Summary .Header { padding: 10px 0px 10px 10px; font-size: 16pt; background-color: ##E5F2FF; color: ##1F4978; border-bottom: solid 2px ##86B9F7; }
.Summary A { color: ##0153A4; }
.Summary { font-family: Tahoma; font-size: 9pt; }
.Summary H1 { font-size: 1.7em; color: ##1F4978; border-bottom: dotted 3px ##efefef; }
.Summary H2 { font-size: 1.3em; color: ##1F4978; }
.Summary TABLE { border: solid 1px ##e5e5e5; }
.Summary TH,
.Summary TD.Label { padding: 5px; font-size: 8pt; font-weight: bold; background-color: ##f5f5f5; }
.Summary TD { padding: 8px; font-size: 9pt; }
.Summary UL LI { font-size: 1.1em; font-weight: bold; }
.Summary UL UL LI { font-size: 0.9em; font-weight: normal; }
</style>
</head>
<body>
<div class="Summary">
<div class="Header">
<img src="#logoUrl#">
</div>
<h1>Password reset notification</h1>
<ad:if test="#user#">
<p>
Hello #user.FirstName#,
</p>
</ad:if>
<p>
We received a request to reset the password for your account. Your password reset pincode:
</p>
#passwordResetPincode#
<p>
If you have any questions regarding your hosting account, feel free to contact our support department at any time.
</p>
<p>
Best regards
</p>
</div>
</body>';
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'HtmlBody' )
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetPincodeLetter', N'HtmlBody', @UserPasswordResetPincodeLetterHtmlBody)
END
ELSE
UPDATE [dbo].[UserSettings] SET [PropertyValue] = @UserPasswordResetPincodeLetterHtmlBody WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'HtmlBody'
GO
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'Priority' )
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetPincodeLetter', N'Priority', N'Normal')
END
GO
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'Subject' )
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetPincodeLetter', N'Subject', N'Password reset notification')
END
GO
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'LogoUrl' )
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetPincodeLetter', N'LogoUrl', N'https://controlpanel.virtuworks.net/App_Themes/Default/Images/logo.png')
END
GO
DECLARE @UserPasswordResetPincodeLetterTextBody nvarchar(2500)
Set @UserPasswordResetPincodeLetterTextBody = N'=========================================
Password reset notification
=========================================
<ad:if test="#user#">
Hello #user.FirstName#,
</ad:if>
We received a request to reset the password for your account. Your password reset pincode:
#passwordResetPincode#
If you have any questions regarding your hosting account, feel free to contact our support department at any time.
Best regards'
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'TextBody' )
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetPincodeLetter', N'TextBody', @UserPasswordResetPincodeLetterTextBody)
END
ELSE
UPDATE [dbo].[UserSettings] SET [PropertyValue] = @UserPasswordResetPincodeLetterTextBody WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'TextBody'
GO
DECLARE @UserPasswordPincodeSMSBody nvarchar(2500)
Set @UserPasswordPincodeSMSBody = N'
Your password reset pincode:
#passwordResetPincode#'
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'PasswordResetPincodeSmsBody' )
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetPincodeLetter', N'PasswordResetPincodeSmsBody', @UserPasswordPincodeSMSBody)
END
ELSE
UPDATE [dbo].[UserSettings] SET [PropertyValue] = @UserPasswordPincodeSMSBody WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'PasswordResetPincodeSmsBody'
GO
-- Exchange setup EMAIL TEMPLATE -- Exchange setup EMAIL TEMPLATE
@ -10289,79 +10443,79 @@ GO
DECLARE @ExchangeMailboxSetupLetterTextBody nvarchar(2500) DECLARE @ExchangeMailboxSetupLetterTextBody nvarchar(2500)
Set @ExchangeMailboxSetupLetterTextBody = N'<ad:if test="#Email#"> Set @ExchangeMailboxSetupLetterTextBody = N'<ad:if test="#Email#">
Hello #Account.DisplayName#, Hello #Account.DisplayName#,
Thanks for choosing VirtuWorks as your Exchange hosting provider. Thanks for choosing VirtuWorks as your Exchange hosting provider.
</ad:if> </ad:if>
<ad:if test="#not(PMM)#"> <ad:if test="#not(PMM)#">
User Accounts User Accounts
The following user accounts have been created for you. The following user accounts have been created for you.
Username: #Account.UserPrincipalName# Username: #Account.UserPrincipalName#
E-mail: #Account.PrimaryEmailAddress# E-mail: #Account.PrimaryEmailAddress#
<ad:if test="#PswResetUrl#"> <ad:if test="#PswResetUrl#">
Password Reset Url: #PswResetUrl# Password Reset Url: #PswResetUrl#
</ad:if> </ad:if>
</ad:if> </ad:if>
================================= =================================
DNS DNS
================================= =================================
In order for us to accept mail for your domain, you will need to point your MX records to: In order for us to accept mail for your domain, you will need to point your MX records to:
<ad:foreach collection="#SmtpServers#" var="SmtpServer" index="i">#SmtpServer#</ad:foreach> <ad:foreach collection="#SmtpServers#" var="SmtpServer" index="i">#SmtpServer#</ad:foreach>
================================= =================================
Webmail (OWA, Outlook Web Access) Webmail (OWA, Outlook Web Access)
================================= =================================
https://mail.virtuworks.net/owa https://mail.virtuworks.net/owa
================================= =================================
Outlook (Windows Clients) Outlook (Windows Clients)
================================= =================================
To configure Outlook 2010 to work with VirtuWorks servers, please reference: To configure Outlook 2010 to work with VirtuWorks servers, please reference:
https://portal.virtuworks.net/whmcs/knowledgebase.php?action=displayarticle&id=2 https://portal.virtuworks.net/whmcs/knowledgebase.php?action=displayarticle&id=2
If you need to download and install the Outlook 2010 client: If you need to download and install the Outlook 2010 client:
Outlook 2010 Download URL: Outlook 2010 Download URL:
32 Bit - http://www.virtuworks.net/downloads/Outlook2010-32bit.zip 32 Bit - http://www.virtuworks.net/downloads/Outlook2010-32bit.zip
64 Bit - http://www.virtuworks.net/downloads/Outlook2010-64bit.zip 64 Bit - http://www.virtuworks.net/downloads/Outlook2010-64bit.zip
KEY: HXGFV-DY3HM-4W2BQ-3R7KQ-K8P49 KEY: HXGFV-DY3HM-4W2BQ-3R7KQ-K8P49
================================= =================================
ActiveSync, iPhone, iPad ActiveSync, iPhone, iPad
================================= =================================
Server: #ActiveSyncServer# Server: #ActiveSyncServer#
Domain: #SamDomain# Domain: #SamDomain#
SSL: must be checked SSL: must be checked
Your username: #SamUsername# Your username: #SamUsername#
================================= =================================
Password Changes Password Changes
================================= =================================
Passwords can be changed at any time using Webmail or the Control Panel (https://controlpanel.virtuworks.net). Passwords can be changed at any time using Webmail or the Control Panel (https://controlpanel.virtuworks.net).
================================= =================================
Control Panel Control Panel
================================= =================================
If you need to change the details of your account, you can easily do this using the Control Panel (https://controlpanel.virtuworks.net). If you need to change the details of your account, you can easily do this using the Control Panel (https://controlpanel.virtuworks.net).
================================= =================================
Support Support
================================= =================================
You have 2 options, email help@virtuworks.com or use the web interface at http://www.virtuworks.com/contact/' You have 2 options, email help@virtuworks.com or use the web interface at http://www.virtuworks.com/contact/'
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'ExchangeMailboxSetupLetter' AND [PropertyName]= N'TextBody' ) IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'ExchangeMailboxSetupLetter' AND [PropertyName]= N'TextBody' )
@ -10674,3 +10828,265 @@ SET ANSI_NULLS ON
GO GO
SET QUOTED_IDENTIFIER OFF SET QUOTED_IDENTIFIER OFF
GO GO
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetSearchObject')
DROP PROCEDURE GetSearchObject
GO
CREATE PROCEDURE [dbo].[GetSearchObject]
(
@ActorID int,
@UserID int,
@FilterColumn nvarchar(50) = '',
@FilterValue nvarchar(50) = '',
@StatusID int,
@RoleID int,
@SortColumn nvarchar(50),
@StartRow int,
@MaximumRows int = 0,
@Recursive bit,
@ColType nvarchar(50) = '',
@FullType nvarchar(50) = '',
@OnlyFind bit
)
AS
IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0
RAISERROR('You are not allowed to access this account', 16, 1)
DECLARE @columnUsername nvarchar(20)
SET @columnUsername = 'Username'
DECLARE @columnEmail nvarchar(20)
SET @columnEmail = 'Email'
DECLARE @columnCompanyName nvarchar(20)
SET @columnCompanyName = 'CompanyName'
DECLARE @columnFullName nvarchar(20)
SET @columnFullName = 'FullName'
DECLARE @curUsers cursor
DECLARE @curSpace cursor
DECLARE @sqlSpace nvarchar(2000)
DECLARE @sqlUsers nvarchar(2000)
DECLARE @sqlReturn nvarchar(4000)
IF @FilterColumn = '' AND @FilterValue <> ''
SET @FilterColumn = 'TextSearch'
SET @sqlUsers = '
DECLARE @HasUserRights bit
SET @HasUserRights = dbo.CheckActorUserRights(@ActorID, @UserID)
DECLARE @Users TABLE
(
ItemPosition int IDENTITY(0,1),
UserID int
)
INSERT INTO @Users (UserID)
SELECT '
IF @OnlyFind = 1
SET @sqlUsers = @sqlUsers + 'TOP ' + CAST(@MaximumRows AS varchar(12)) + ' '
SET @sqlUsers = @sqlUsers + 'U.UserID
FROM UsersDetailed AS U
WHERE
U.UserID <> @UserID AND U.IsPeer = 0 AND
(
(@Recursive = 0 AND OwnerID = @UserID) OR
(@Recursive = 1 AND dbo.CheckUserParent(@UserID, U.UserID) = 1)
)
AND ((@StatusID = 0) OR (@StatusID > 0 AND U.StatusID = @StatusID))
AND ((@RoleID = 0) OR (@RoleID > 0 AND U.RoleID = @RoleID))
AND @HasUserRights = 1
SET @curValue = cursor local for
SELECT
U.ItemID,
U.TextSearch,
U.ColumnType,
''Users'' as FullType,
0 as PackageID,
0 as AccountID
FROM @Users AS TU
INNER JOIN
(
SELECT ItemID, TextSearch, ColumnType
FROM(
SELECT U0.UserID as ItemID, U0.Username as TextSearch, @columnUsername as ColumnType
FROM dbo.Users AS U0
UNION
SELECT U1.UserID as ItemID, U1.Email as TextSearch, @columnEmail as ColumnType
FROM dbo.Users AS U1
UNION
SELECT U2.UserID as ItemID, U2.CompanyName as TextSearch, @columnCompanyName as ColumnType
FROM dbo.Users AS U2
UNION
SELECT U3.UserID as ItemID, U3.FirstName + '' '' + U3.LastName as TextSearch, @columnFullName as ColumnType
FROM dbo.Users AS U3) as U
WHERE TextSearch<>'' '' OR ISNULL(TextSearch, 0) > 0
)
AS U ON TU.UserID = U.ItemID'
SET @sqlUsers = @sqlUsers + ' open @curValue'
exec sp_executesql @sqlUsers, N'@UserID int, @FilterValue nvarchar(50), @ActorID int, @Recursive bit, @StatusID int, @RoleID int, @columnUsername nvarchar(20), @columnEmail nvarchar(20), @columnCompanyName nvarchar(20), @columnFullName nvarchar(20), @curValue cursor output',
@UserID, @FilterValue, @ActorID, @Recursive, @StatusID, @RoleID, @columnUsername, @columnEmail, @columnCompanyName, @columnFullName, @curValue=@curUsers output
SET @sqlSpace = '
DECLARE @ItemsService TABLE
(
ItemID int
)
INSERT INTO @ItemsService (ItemID)
SELECT '
IF @OnlyFind = 1
SET @sqlSpace = @sqlSpace + 'TOP ' + CAST(@MaximumRows AS varchar(12)) + ' '
SET @sqlSpace = @sqlSpace + 'SI.ItemID
FROM ServiceItems AS SI
INNER JOIN Packages AS P ON P.PackageID = SI.PackageID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
WHERE
dbo.CheckUserParent(@UserID, P.UserID) = 1
DECLARE @ItemsDomain TABLE
(
ItemID int
)
INSERT INTO @ItemsDomain (ItemID)
SELECT
D.DomainID
FROM Domains AS D
INNER JOIN Packages AS P ON P.PackageID = D.PackageID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
WHERE
dbo.CheckUserParent(@UserID, P.UserID) = 1
SET @curValue = cursor local for
SELECT
SI.ItemID as ItemID,
SI.ItemName as TextSearch,
STYPE.DisplayName as ColumnType,
STYPE.DisplayName as FullType,
SI.PackageID as PackageID,
0 as AccountID
FROM @ItemsService AS I
INNER JOIN ServiceItems AS SI ON I.ItemID = SI.ItemID
INNER JOIN ServiceItemTypes AS STYPE ON SI.ItemTypeID = STYPE.ItemTypeID
WHERE STYPE.Searchable = 1
UNION
SELECT
D.DomainID AS ItemID,
D.DomainName as TextSearch,
''Domain'' as ColumnType,
''Domain'' as FullType,
D.PackageID as PackageID,
0 as AccountID
FROM @ItemsDomain AS I
INNER JOIN Domains AS D ON I.ItemID = D.DomainID
WHERE D.IsDomainPointer=0
UNION
SELECT
EA.ItemID AS ItemID,
EA.AccountName as TextSearch,
''ExchangeAccount'' as ColumnType,
''ExchangeAccount'' as FullType,
SI2.PackageID as PackageID,
EA.AccountID as AccountID
FROM @ItemsService AS I2
INNER JOIN ServiceItems AS SI2 ON I2.ItemID = SI2.ItemID
INNER JOIN ExchangeAccounts AS EA ON I2.ItemID = EA.ItemID
';
SET @sqlSpace = @sqlSpace + ' open @curValue'
exec sp_executesql @sqlSpace, N'@UserID int, @FilterValue nvarchar(50), @ActorID int, @curValue cursor output',
@UserID, @FilterValue, @ActorID, @curValue=@curSpace output
SET @sqlReturn = '
DECLARE @ItemID int
DECLARE @TextSearch nvarchar(500)
DECLARE @ColumnType nvarchar(50)
DECLARE @FullType nvarchar(50)
DECLARE @PackageID int
DECLARE @AccountID int
DECLARE @EndRow int
SET @EndRow = @StartRow + @MaximumRows
DECLARE @ItemsAll TABLE
(
ItemPosition int IDENTITY(1,1),
ItemID int,
TextSearch nvarchar(500),
ColumnType nvarchar(50),
FullType nvarchar(50),
PackageID int,
AccountID int
)
FETCH NEXT FROM @curSpaceValue INTO @ItemID, @TextSearch, @ColumnType, @FullType, @PackageID, @AccountID
WHILE @@FETCH_STATUS = 0
BEGIN
INSERT INTO @ItemsAll(ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID)
VALUES(@ItemID, @TextSearch, @ColumnType, @FullType, @PackageID, @AccountID)
FETCH NEXT FROM @curSpaceValue INTO @ItemID, @TextSearch, @ColumnType, @FullType, @PackageID, @AccountID
END
FETCH NEXT FROM @curUsersValue INTO @ItemID, @TextSearch, @ColumnType, @FullType, @PackageID, @AccountID
WHILE @@FETCH_STATUS = 0
BEGIN
INSERT INTO @ItemsAll(ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID)
VALUES(@ItemID, @TextSearch, @ColumnType, @FullType, @PackageID, @AccountID)
FETCH NEXT FROM @curUsersValue INTO @ItemID, @TextSearch, @ColumnType, @FullType, @PackageID, @AccountID
END
DECLARE @ItemsReturn TABLE
(
ItemPosition int IDENTITY(1,1),
ItemID int,
TextSearch nvarchar(500),
ColumnType nvarchar(50),
FullType nvarchar(50),
PackageID int,
AccountID int
)
INSERT INTO @ItemsReturn(ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID)
SELECT ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID
FROM @ItemsAll AS IA WHERE (1 = 1) '
IF @ColType <> ''
SET @sqlReturn = @sqlReturn + ' AND IA.ColumnType in ( ' + @ColType + ' ) ';
IF @FullType <> ''
SET @sqlReturn = @sqlReturn + ' AND IA.FullType = ''' + @FullType + '''';
IF @FilterValue <> ''
SET @sqlReturn = @sqlReturn + ' AND IA.' + @FilterColumn + ' LIKE @FilterValue '
IF @SortColumn <> '' AND @SortColumn IS NOT NULL
SET @sqlReturn = @sqlReturn + ' ORDER BY ' + @SortColumn + ' '
SET @sqlReturn = @sqlReturn + '
SELECT COUNT(ItemID) FROM @ItemsReturn;
SELECT DISTINCT(ColumnType) FROM @ItemsReturn WHERE (1 = 1) ';
IF @FullType <> ''
SET @sqlReturn = @sqlReturn + ' AND FullType = ''' + @FullType + '''';
SET @sqlReturn = @sqlReturn + '; ';
SET @sqlReturn = @sqlReturn + '
SELECT ItemPosition, ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID
FROM @ItemsReturn AS IR WHERE (1 = 1)
'
IF @MaximumRows > 0
SET @sqlReturn = @sqlReturn + ' AND IR.ItemPosition BETWEEN @StartRow AND @EndRow';
exec sp_executesql @sqlReturn, N'@StartRow int, @MaximumRows int, @FilterValue nvarchar(50), @curSpaceValue cursor, @curUsersValue cursor',
@StartRow, @MaximumRows, @FilterValue, @curSpace, @curUsers
CLOSE @curSpace
DEALLOCATE @curSpace
CLOSE @curUsers
DEALLOCATE @curUsers
RETURN