Skip to content

Commit aca7606

Browse files
Damodar Reddymurali-reddy
authored andcommitted
CLOUDSTACK-6563: Integrating dependencies as part of MSI installer so that those will get installed along with cloud stack installation
1 parent 94a7dee commit aca7606

6 files changed

Lines changed: 293 additions & 49 deletions

File tree

client/pom.xml

Lines changed: 70 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,7 @@
688688
<copy todir="./target">
689689
<fileset dir="../scripts/installer/windows/">
690690
<include name="start.bat"/>
691+
<include name="acs_license.rtf"/>
691692
</fileset>
692693
</copy>
693694
<copy todir="./target/client">
@@ -713,6 +714,23 @@
713714
</target>
714715
</configuration>
715716
</execution>
717+
<execution>
718+
<id>download-files</id>
719+
<phase>prepare-package</phase>
720+
<goals>
721+
<goal>run</goal>
722+
</goals>
723+
<configuration>
724+
<target>
725+
<!-- download file -->
726+
<get src="http://downloads.sourceforge.net/sevenzip/7z920-x64.msi" dest="target" verbose="false" usetimestamp="true"/>
727+
<get src="https://www.python.org/ftp/python/2.7.6/python-2.7.6.amd64.msi" dest="target" verbose="false" usetimestamp="true"/>
728+
<get src="http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.73-winx64.msi" dest="target" verbose="false" usetimestamp="true"/>
729+
<get src="http://mirror.sdunix.com/apache/tomcat/tomcat-6/v6.0.39/bin/apache-tomcat-6.0.39.exe" dest="target" verbose="false" usetimestamp="true"/>
730+
<get src="http://downloads.sourceforge.net/project/cdrtoolswin/1.0/Binaries/CDR-Tools.exe?r=&amp;ts=1398764640&amp;use_mirror=kaz" dest="target" verbose="false" usetimestamp="true"/>
731+
</target>
732+
</configuration>
733+
</execution>
716734
</executions>
717735
</plugin>
718736
<plugin>
@@ -805,37 +823,60 @@
805823
<groupId>org.bitbucket.joxley</groupId>
806824
<artifactId>wix-maven-plugin</artifactId>
807825
<version>1.1.1</version>
808-
<configuration>
809-
<workingDirectory>${basedir}/target</workingDirectory>
810-
<extensions>
811-
<extension>WixFirewallExtension</extension>
812-
<extension>WixUIExtension</extension>
813-
</extensions>
814-
<arguments>-dSourceClient=SourceDir\client -dSetupPathDir=SourceDir\setup -dUtilitiesPathDir=SourceDir\scripts -dPythonSitePackagesDir=SourceDir\python-site-packages</arguments>
815-
<sourceFiles>
816-
<sourceFile>../scripts/installer/windows/acs.wxs</sourceFile>
817-
<sourceFile>../scripts/installer/windows/WixInstallerDialog.wxs</sourceFile>
818-
<sourceFile>../scripts/installer/windows/Setup_Databases.wxs</sourceFile>
819-
<sourceFile>target/client.wxs</sourceFile>
820-
<sourceFile>target/setupdb.wxs</sourceFile>
821-
<sourceFile>target/utilities.wxs</sourceFile>
822-
<sourceFile>target/python-site-packages.wxs</sourceFile>
823-
</sourceFiles>
824-
<outputDirectory>target</outputDirectory>
825-
<objectFiles>
826-
<objectFile>target/acs.wixobj</objectFile>
827-
<objectFile>target/client.wixobj</objectFile>
828-
<objectFile>target/setupdb.wixobj</objectFile>
829-
<objectFile>target/utilities.wixobj</objectFile>
830-
<objectFile>target/WixInstallerDialog.wixobj</objectFile>
831-
<objectFile>target/Setup_Databases.wixobj</objectFile>
832-
<objectFile>target/python-site-packages.wixobj</objectFile>
833-
</objectFiles>
834-
<outputFile>target/acs.msi</outputFile>
835-
</configuration>
836826
<executions>
837827
<execution>
838-
<id>wix</id>
828+
<id>wix-acs</id>
829+
<configuration>
830+
<workingDirectory>${basedir}/target</workingDirectory>
831+
<extensions>
832+
<extension>WixFirewallExtension</extension>
833+
<extension>WixUIExtension</extension>
834+
<extension>WixUtilExtension</extension>
835+
</extensions>
836+
<arguments>-dSourceClient=SourceDir\client -dSetupPathDir=SourceDir\setup -dUtilitiesPathDir=SourceDir\scripts -dPythonSitePackagesDir=SourceDir\python-site-packages</arguments>
837+
<sourceFiles>
838+
<sourceFile>../scripts/installer/windows/acs.wxs</sourceFile>
839+
<sourceFile>../scripts/installer/windows/WixInstallerDialog.wxs</sourceFile>
840+
<sourceFile>../scripts/installer/windows/Setup_Databases.wxs</sourceFile>
841+
<sourceFile>target/client.wxs</sourceFile>
842+
<sourceFile>target/setupdb.wxs</sourceFile>
843+
<sourceFile>target/utilities.wxs</sourceFile>
844+
<sourceFile>target/python-site-packages.wxs</sourceFile>
845+
</sourceFiles>
846+
<outputDirectory>target</outputDirectory>
847+
<objectFiles>
848+
<objectFile>target/acs.wixobj</objectFile>
849+
<objectFile>target/client.wixobj</objectFile>
850+
<objectFile>target/setupdb.wixobj</objectFile>
851+
<objectFile>target/utilities.wixobj</objectFile>
852+
<objectFile>target/WixInstallerDialog.wixobj</objectFile>
853+
<objectFile>target/Setup_Databases.wixobj</objectFile>
854+
<objectFile>target/python-site-packages.wixobj</objectFile>
855+
</objectFiles>
856+
<outputFile>target/acs.msi</outputFile>
857+
</configuration>
858+
<goals>
859+
<goal>candle</goal>
860+
<goal>light</goal>
861+
</goals>
862+
</execution>
863+
<execution>
864+
<id>wix-final</id>
865+
<configuration>
866+
<workingDirectory>${basedir}/target</workingDirectory>
867+
<extensions>
868+
<extension>WixBalExtension</extension>
869+
<extension>WixUtilExtension</extension>
870+
</extensions>
871+
<sourceFiles>
872+
<sourceFile>../scripts/installer/windows/dependencies.wxs</sourceFile>
873+
</sourceFiles>
874+
<outputDirectory>target</outputDirectory>
875+
<objectFiles>
876+
<objectFile>target/dependencies.wixobj</objectFile>
877+
</objectFiles>
878+
<outputFile>target/acs-4.4.0.0.exe</outputFile>
879+
</configuration>
839880
<goals>
840881
<goal>candle</goal>
841882
<goal>light</goal>

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,7 @@
818818
<exclude>tools/ngui/static/bootstrap/*</exclude>
819819
<exclude>tools/ngui/static/js/lib/*</exclude>
820820
<exclude>**/.checkstyle</exclude>
821+
<exclude>scripts/installer/windows/acs_license.rtf</exclude>
821822
</excludes>
822823
</configuration>
823824
</plugin>

scripts/common/keys/ssl-keys.py

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,27 @@
2727
import socket
2828
import sys
2929
import os
30+
import subprocess
31+
import traceback
3032

3133
def generateSSLKey(outputPath):
32-
hostName = socket.gethostbyname(socket.gethostname())
33-
keyFile = outputPath + os.sep + "cloud.keystore"
34-
print("HostName = %s" % hostName)
35-
print("OutputPath = %s" % keyFile)
36-
dname='cn="Cloudstack User",ou="' + hostName + '",o="' + hostName + '",c="Unknown"';
37-
print("dname = %s" % dname)
38-
return_code = call(["keytool", "-genkey", "-keystore", keyFile, "-storepass", "vmops.com", "-keypass", "vmops.com", "-keyalg", "RSA", "-validity", "3650", "-dname", dname])
39-
print("SSL key generated is : %s" % return_code)
34+
logf = open("ssl-keys.log", "w")
35+
hostName = socket.gethostbyname(socket.gethostname())
36+
keyFile = outputPath + os.sep + "cloud.keystore"
37+
logf.write("HostName = %s\n" % hostName)
38+
logf.write("OutputPath = %s\n" % keyFile)
39+
dname='cn="Cloudstack User",ou="' + hostName + '",o="' + hostName + '",c="Unknown"';
40+
logf.write("dname = %s\n" % dname)
41+
logf.flush()
42+
try :
43+
return_code = subprocess.Popen(["keytool", "-genkey", "-keystore", keyFile, "-storepass", "vmops.com", "-keypass", "vmops.com", "-keyalg", "RSA", "-validity", "3650", "-dname", dname],shell=True,stdout=logf, stderr=logf)
44+
return_code.wait()
45+
except OSError as e:
46+
logf.flush()
47+
traceback.print_exc(file=logf)
48+
logf.flush()
49+
logf.write("SSL key generated is : %s" % return_code)
50+
logf.flush()
4051

4152
argsSize=len(sys.argv)
4253
if argsSize != 2:

scripts/installer/windows/acs.wxs

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
99
OF ANY KIND, either express or implied. See the License for the specific
1010
language governing permissions and limitations under the License. -->
11-
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:fire='http://schemas.microsoft.com/wix/FirewallExtension'>
11+
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:fire='http://schemas.microsoft.com/wix/FirewallExtension' xmlns:util='http://schemas.microsoft.com/wix/UtilExtension'>
1212
<Product Name='ACS' Id='eea70ed5-5950-4f01-b4aa-4a07636359bb'
1313
UpgradeCode='d6208c34-7b50-4512-b19e-b904dcc1373e' Language='1033'
1414
Codepage='1252' Version='4.4.0' Manufacturer='Apache Cloud Stack'>
@@ -79,7 +79,7 @@
7979
Value="-XX:MaxPermSize=512m -Xmx1024m -Xms256m" />
8080
<Environment Id="Path" Action="set" Name="Path"
8181
Permanent="yes" System="yes" Part="last"
82-
Value="[JAVA_HOME]\bin;[PYTHON_HOME];[SEVENZ_HOME]" />
82+
Value="[JAVA_HOME]\bin;[PYTHON_HOME];[SEVENZ_HOME];[ProgramFilesFolder]\cdrtools" />
8383
</Component>
8484
</Directory>
8585
</Directory>
@@ -101,13 +101,20 @@
101101
Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\Tomcat6"
102102
Type="raw" Win64="yes" />
103103
</Property>
104+
<util:Group Id="Administrators" Name="Administrators"/>
104105
<Component Id="ServiceInstaller" Directory="INSTALLDIR"
105106
Guid="dfebb4bb-cac0-4cef-aa91-342bafa18349">
107+
<util:User Id="AccountCreation" CreateUser="yes" FailIfExists="no" Name="cloud" Password="C!0ud" RemoveOnUninstall="yes" UpdateIfExists="yes" LogonAsService="yes">
108+
<util:GroupRef Id="Administrators" />
109+
</util:User>
106110
<File Id='ACSServiceEXEFile' Name='start.exe' Source='start.bat'
107111
KeyPath='yes' />
108112
<ServiceInstall Id='InstallACSService' Name='ACSService'
109113
Description='ACS Service' ErrorControl='normal' Start='auto'
110-
Type='ownProcess' Vital='yes' />
114+
Type='ownProcess' Vital='yes'>
115+
<util:PermissionEx User="cloud" GenericAll="yes" ServiceStart="yes" ServiceStop="yes" ServicePauseContinue="yes" ServiceInterrogate="yes" ServiceChangeConfig="yes" ServiceEnumerateDependents="yes"
116+
ServiceQueryConfig="yes" ServiceQueryStatus="yes" ServiceUserDefinedControl="yes" />
117+
</ServiceInstall>
111118
<ServiceControl Id='UninstallACSService' Name='ACSService'
112119
Remove='uninstall' Wait='yes' />
113120
<RegistryValue Root='HKLM'
@@ -221,14 +228,14 @@
221228
Value="[TOMCATDIRECTORY]\bin\Tomcat6.exe">
222229
</CustomAction>
223230
<CustomAction Id="UpdateTomcatCatalinaBase"
224-
ExeCommand='//US//Tomcat6 --JvmOptions=-Dcatalina.base=[CSMANAGEMENT];-Djava.io.tmpdir=[CSMANAGEMENT]\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Dcatalina.home="[TOMCATDIRECTORY]";-Xms512m;-Xmx1024m;-XX:MaxPermSize=512m'
231+
ExeCommand='//US//Tomcat6 --JvmOptions=-Dcatalina.base=[CSMANAGEMENT];-Djava.io.tmpdir=[CSMANAGEMENT]\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Dcatalina.home="[TOMCATDIRECTORY]";-Xms512m;-Xmx1024m;-XX:MaxPermSize=512m;-Duser.name=cloud'
225232
Property="TOMCATDIRECTORY1" Execute="commit" Return="check" />
226233
<CustomAction Id="UpdateTomcatClassPath"
227234
ExeCommand='//US//Tomcat6 --Classpath="[TOMCATDIRECTORY]\bin\bootstrap.jar";"[TOMCATDIRECTORY]\bin\tomcat-juli.jar";[CSMANAGEMENT]\conf;[CSMANAGEMENT]\lib;[CSMANAGEMENT]\setup'
228235
Property="TOMCATDIRECTORY1" Execute="commit" Return="check" />
229236
<CustomAction Id="CopySitePackages" Directory='INSTALLDIR'
230237
ExeCommand='[SystemFolder]cmd.exe /c xcopy /S "[INSTALLDIR]\python-site-packages" [PYTHON_HOME]\Lib\site-packages'
231-
Execute="commit" Return="check" />
238+
Execute="commit" Return="check"/>
232239
<CustomAction Id="DeleteDirectory" Directory='INSTALLDIR'
233240
ExeCommand='[SystemFolder]cmd.exe /c RD /S /Q "[INSTALLDIR]\python-site-packages"'
234241
Execute="commit" Return="check" />
@@ -246,20 +253,20 @@
246253
Execute="commit" Return="check" />
247254

248255
<InstallExecuteSequence>
249-
<InstallServices Sequence="4999"></InstallServices>
256+
<InstallServices Sequence="4990"></InstallServices>
250257
<Custom Action="TomcatPath" Before="UpdateTomcatClassPath">NOT Installed</Custom>
251258
<Custom Action="UpdateTomcatClassPath" Before="UpdateTomcatCatalinaBase">NOT Installed
252259
</Custom>
253-
<Custom Action="UpdateTomcatCatalinaBase" Before="CopySitePackages">NOT
260+
<Custom Action="UpdateTomcatCatalinaBase" Before="DeleteFiles">NOT
254261
Installed</Custom>
255-
<Custom Action="CopySitePackages" Before="DeleteFiles">NOT Installed</Custom>
256-
<Custom Action="DeleteFiles" Before="DeleteDirectory">NOT Installed</Custom>
257-
<Custom Action="DeleteDirectory" Before="GenerateSSLKey">NOT Installed</Custom>
262+
<Custom Action="DeleteFiles" Before="GenerateSSLKey">NOT Installed</Custom>
258263
<Custom Action="GenerateSSLKey" Before="InstallFinalize">NOT Installed
259264
</Custom>
260-
<Custom Action="DeployDB" Before="InstallFinalize">(NOT Installed) AND (CREATE_DATABASE = "1")
265+
<Custom Action="CopySitePackages" Before="InstallFinalize">NOT Installed</Custom>
266+
<Custom Action="DeleteDirectory" After="CopySitePackages">NOT Installed</Custom>
267+
<Custom Action="DeployDB" After="DeleteDirectory">(NOT Installed) AND (CREATE_DATABASE = "1")
261268
</Custom>
262-
<Custom Action="SetupDatabases" Before="InstallFinalize">(NOT Installed) AND (<![CDATA[CREATE_DATABASE <> "1"]]>)
269+
<Custom Action="SetupDatabases" After="DeleteDirectory">(NOT Installed) AND (<![CDATA[CREATE_DATABASE <> "1"]]>)
263270
</Custom>
264271
</InstallExecuteSequence>
265272
<Feature Id='Complete' Title='ACS' Description='The complete package.'

0 commit comments

Comments
 (0)