Zip task in build.xml replaced with VB script
This commit is contained in:
parent
0d0b1d2ff8
commit
ace6802cee
2 changed files with 135 additions and 5 deletions
|
@ -559,12 +559,14 @@
|
||||||
<EnterpriseServerInstallFiles Include="$(EnterpriseServerInstall)\**\*.*" />
|
<EnterpriseServerInstallFiles Include="$(EnterpriseServerInstall)\**\*.*" />
|
||||||
<ServerInstallFiles Include="$(ServerInstall)\**\*.*" />
|
<ServerInstallFiles Include="$(ServerInstall)\**\*.*" />
|
||||||
|
|
||||||
|
<!--
|
||||||
<ImportCsvInstallFiles Include="$(ImportCsvInstall)\**\*.*" />
|
<ImportCsvInstallFiles Include="$(ImportCsvInstall)\**\*.*" />
|
||||||
<HyperVUtilsInstallFiles Include="$(HyperVUtilsInstall)\**\*.*" />
|
<HyperVUtilsInstallFiles Include="$(HyperVUtilsInstall)\**\*.*" />
|
||||||
<VMConfigInstallFiles Include="$(VMConfigInstall)\**\*.*" />
|
<VMConfigInstallFiles Include="$(VMConfigInstall)\**\*.*" />
|
||||||
<ImportEnterpriseInstallFiles Include="$(ImportEnterpriseInstall)\**\*.*" />
|
<ImportEnterpriseInstallFiles Include="$(ImportEnterpriseInstall)\**\*.*" />
|
||||||
<AWStatsViewerInstallFiles Include="$(AWStatsViewerInstall)\**\*.*" />
|
<AWStatsViewerInstallFiles Include="$(AWStatsViewerInstall)\**\*.*" />
|
||||||
<WSPTransportAgentInstallFiles Include="$(WSPTransportAgentInstall)\**\*.*" />
|
<WSPTransportAgentInstallFiles Include="$(WSPTransportAgentInstall)\**\*.*" />
|
||||||
|
-->
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<!-- Assemble "Standalone" package -->
|
<!-- Assemble "Standalone" package -->
|
||||||
|
@ -573,18 +575,26 @@
|
||||||
<Copy SourceFiles="@(ServerInstallFiles)" DestinationFolder="$(StandaloneInstall)\Server\%(RecursiveDir)" />
|
<Copy SourceFiles="@(ServerInstallFiles)" DestinationFolder="$(StandaloneInstall)\Server\%(RecursiveDir)" />
|
||||||
|
|
||||||
|
|
||||||
<!-- zip full distributives -->
|
<!-- zip full distributives
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<StandaloneInstallFiles Include="$(StandaloneInstall)\**\*.*" />
|
<StandaloneInstallFiles Include="$(StandaloneInstall)\**\*.*" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!--
|
||||||
<Zip Files="@(PortalInstallFiles)" ZipFileName="$(DeployFolder)\WebsitePanel-Portal-$(Version).zip" WorkingDirectory="$(PortalInstall)" />
|
<Zip Files="@(PortalInstallFiles)" ZipFileName="$(DeployFolder)\WebsitePanel-Portal-$(Version).zip" WorkingDirectory="$(PortalInstall)" />
|
||||||
<Zip Files="@(EnterpriseServerInstallFiles)" ZipFileName="$(DeployFolder)\WebsitePanel-EnterpriseServer-$(Version).zip" WorkingDirectory="$(EnterpriseServerInstall)" />
|
<Zip Files="@(EnterpriseServerInstallFiles)" ZipFileName="$(DeployFolder)\WebsitePanel-EnterpriseServer-$(Version).zip" WorkingDirectory="$(EnterpriseServerInstall)" />
|
||||||
<Zip Files="@(ServerInstallFiles)" ZipFileName="$(DeployFolder)\WebsitePanel-Server-$(Version).zip" WorkingDirectory="$(ServerInstall)" />
|
<Zip Files="@(ServerInstallFiles)" ZipFileName="$(DeployFolder)\WebsitePanel-Server-$(Version).zip" WorkingDirectory="$(ServerInstall)" />
|
||||||
<Zip Files="@(StandaloneInstallFiles)" ZipFileName="$(DeployFolder)\WebsitePanel-StandaloneServerSetup-$(Version).zip" WorkingDirectory="$(StandaloneInstall)" />
|
<Zip Files="@(StandaloneInstallFiles)" ZipFileName="$(DeployFolder)\WebsitePanel-StandaloneServerSetup-$(Version).zip" WorkingDirectory="$(StandaloneInstall)" />
|
||||||
|
-->
|
||||||
|
|
||||||
|
<Exec Command="cscript $(TrunkFolder)\zip.vbs "$(DeployFolder)\WebsitePanel-Portal-$(Version).zip" "$(PortalInstall)"" />
|
||||||
|
<Exec Command="cscript $(TrunkFolder)\zip.vbs "$(DeployFolder)\WebsitePanel-EnterpriseServer-$(Version).zip" "$(EnterpriseServerInstall)"" />
|
||||||
|
<Exec Command="cscript $(TrunkFolder)\zip.vbs "$(DeployFolder)\WebsitePanel-Server-$(Version).zip" "$(ServerInstall)"" />
|
||||||
|
<Exec Command="cscript $(TrunkFolder)\zip.vbs "$(DeployFolder)\WebsitePanel-StandaloneServerSetup-$(Version).zip" "$(StandaloneInstall)"" />
|
||||||
|
|
||||||
|
|
||||||
<!-- zip updates -->
|
<!-- zip updates
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PortalUpdateFiles Include="$(PortalUpdate)\**\*.*" />
|
<PortalUpdateFiles Include="$(PortalUpdate)\**\*.*" />
|
||||||
<EnterpriseServerUpdateFiles Include="$(EnterpriseServerUpdate)\**\*.*" />
|
<EnterpriseServerUpdateFiles Include="$(EnterpriseServerUpdate)\**\*.*" />
|
||||||
|
@ -593,19 +603,35 @@
|
||||||
<InstallerUpdateFiles Include="$(InstallerBuild)\**\*.*" />
|
<InstallerUpdateFiles Include="$(InstallerBuild)\**\*.*" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
<Zip Files="@(PortalUpdateFiles)" ZipFileName="$(DeployFolder)\WebsitePanel-Portal-$(Version)-Update.zip" WorkingDirectory="$(PortalUpdate)" />
|
<Zip Files="@(PortalUpdateFiles)" ZipFileName="$(DeployFolder)\WebsitePanel-Portal-$(Version)-Update.zip" WorkingDirectory="$(PortalUpdate)" />
|
||||||
<Zip Files="@(EnterpriseServerUpdateFiles)" ZipFileName="$(DeployFolder)\WebsitePanel-EnterpriseServer-$(Version)-Update.zip" WorkingDirectory="$(EnterpriseServerUpdate)" />
|
<Zip Files="@(EnterpriseServerUpdateFiles)" ZipFileName="$(DeployFolder)\WebsitePanel-EnterpriseServer-$(Version)-Update.zip" WorkingDirectory="$(EnterpriseServerUpdate)" />
|
||||||
<Zip Files="@(ServerUpdateFiles)" ZipFileName="$(DeployFolder)\WebsitePanel-Server-$(Version)-Update.zip" WorkingDirectory="$(ServerUpdate)" />
|
<Zip Files="@(ServerUpdateFiles)" ZipFileName="$(DeployFolder)\WebsitePanel-Server-$(Version)-Update.zip" WorkingDirectory="$(ServerUpdate)" />
|
||||||
<Zip Files="@(ManualUpdateFiles)" ZipFileName="$(DeployFolder)\Manual-Update.zip" WorkingDirectory="$(UpdateFolder)" />
|
<Zip Files="@(ManualUpdateFiles)" ZipFileName="$(DeployFolder)\Manual-Update.zip" WorkingDirectory="$(UpdateFolder)" />
|
||||||
<Zip Files="@(InstallerUpdateFiles)" ZipFileName="$(DeployFolder)\WebsitePanel-Installer-$(Version)-Update.zip" WorkingDirectory="$(InstallerBuild)" />
|
<Zip Files="@(InstallerUpdateFiles)" ZipFileName="$(DeployFolder)\WebsitePanel-Installer-$(Version)-Update.zip" WorkingDirectory="$(InstallerBuild)" />
|
||||||
|
-->
|
||||||
|
|
||||||
|
<Exec Command="cscript $(TrunkFolder)\zip.vbs "$(DeployFolder)\WebsitePanel-Portal-$(Version)-Update.zip" "$(PortalUpdate)"" />
|
||||||
|
<Exec Command="cscript $(TrunkFolder)\zip.vbs "$(DeployFolder)\WebsitePanel-EnterpriseServer-$(Version)-Update.zip" "$(EnterpriseServerUpdate)"" />
|
||||||
|
<Exec Command="cscript $(TrunkFolder)\zip.vbs "$(DeployFolder)\WebsitePanel-Server-$(Version)-Update.zip" "$(ServerUpdate)"" />
|
||||||
|
<Exec Command="cscript $(TrunkFolder)\zip.vbs "$(DeployFolder)\Manual-Update.zip" "$(UpdateFolder)"" />
|
||||||
|
<Exec Command="cscript $(TrunkFolder)\zip.vbs "$(DeployFolder)\WebsitePanel-Installer-$(Version)-Update.zip" "$(InstallerBuild)"" />
|
||||||
|
|
||||||
<!-- zip tools -->
|
<!-- zip tools
|
||||||
<Zip Files="@(ImportCsvInstallFiles)" ZipFileName="$(ToolsFolder)\WebsitePanel-Import-CsvBulk-$(Version).zip" WorkingDirectory="$(ImportCsvInstall)" />
|
<Zip Files="@(ImportCsvInstallFiles)" ZipFileName="$(ToolsFolder)\WebsitePanel-Import-CsvBulk-$(Version).zip" WorkingDirectory="$(ImportCsvInstall)" />
|
||||||
<Zip Files="@(HyperVUtilsInstallFiles)" ZipFileName="$(ToolsFolder)\WebsitePanel-HyperVUtils-$(Version).zip" WorkingDirectory="$(HyperVUtilsInstall)" />
|
<Zip Files="@(HyperVUtilsInstallFiles)" ZipFileName="$(ToolsFolder)\WebsitePanel-HyperVUtils-$(Version).zip" WorkingDirectory="$(HyperVUtilsInstall)" />
|
||||||
<Zip Files="@(VMConfigInstallFiles)" ZipFileName="$(ToolsFolder)\WebsitePanel-VMConfig-$(Version).zip" WorkingDirectory="$(VMConfigInstall)" />
|
<Zip Files="@(VMConfigInstallFiles)" ZipFileName="$(ToolsFolder)\WebsitePanel-VMConfig-$(Version).zip" WorkingDirectory="$(VMConfigInstall)" />
|
||||||
<Zip Files="@(ImportEnterpriseInstallFiles)" ZipFileName="$(ToolsFolder)\WebsitePanel-Import-Enterprise-$(Version).zip" WorkingDirectory="$(ImportEnterpriseInstall)" />
|
<Zip Files="@(ImportEnterpriseInstallFiles)" ZipFileName="$(ToolsFolder)\WebsitePanel-Import-Enterprise-$(Version).zip" WorkingDirectory="$(ImportEnterpriseInstall)" />
|
||||||
<Zip Files="@(AWStatsViewerInstallFiles)" ZipFileName="$(ToolsFolder)\WebsitePanel-AWStatsViewer-$(Version).zip" WorkingDirectory="$(AWStatsViewerInstall)" />
|
<Zip Files="@(AWStatsViewerInstallFiles)" ZipFileName="$(ToolsFolder)\WebsitePanel-AWStatsViewer-$(Version).zip" WorkingDirectory="$(AWStatsViewerInstall)" />
|
||||||
<Zip Files="@(WSPTransportAgentInstallFiles)" ZipFileName="$(ToolsFolder)\WebsitePanel-WSPTransportAgent-$(Version).zip" WorkingDirectory="$(WSPTransportAgentInstall)" />
|
<Zip Files="@(WSPTransportAgentInstallFiles)" ZipFileName="$(ToolsFolder)\WebsitePanel-WSPTransportAgent-$(Version).zip" WorkingDirectory="$(WSPTransportAgentInstall)" />
|
||||||
|
-->
|
||||||
|
|
||||||
|
<Exec Command="cscript $(TrunkFolder)\zip.vbs "$(DeployFolder)\WebsitePanel-Import-CsvBulk-$(Version)-Update.zip" "$(ImportCsvInstall)"" />
|
||||||
|
<Exec Command="cscript $(TrunkFolder)\zip.vbs "$(DeployFolder)\WebsitePanel-HyperVUtils-$(Version)-Update.zip" "$(HyperVUtilsInstall)"" />
|
||||||
|
<Exec Command="cscript $(TrunkFolder)\zip.vbs "$(DeployFolder)\WebsitePanel-VMConfig-$(Version)-Update.zip" "$(VMConfigInstall)"" />
|
||||||
|
<Exec Command="cscript $(TrunkFolder)\zip.vbs "$(DeployFolder)\WebsitePanel-Import-Enterprise-$(Version)-Update.zip" "$(ImportEnterpriseInstall)"" />
|
||||||
|
<Exec Command="cscript $(TrunkFolder)\zip.vbs "$(DeployFolder)\WebsitePanel-AWStatsViewer-$(Version)-Update.zip" "$(AWStatsViewerInstall)"" />
|
||||||
|
<Exec Command="cscript $(TrunkFolder)\zip.vbs "$(DeployFolder)\WebsitePanel-WSPTransportAgent-$(Version)-Update.zip" "$(WSPTransportAgentInstall)"" />
|
||||||
|
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
|
104
WebsitePanel/zip.vbs
Normal file
104
WebsitePanel/zip.vbs
Normal file
|
@ -0,0 +1,104 @@
|
||||||
|
If WScript.Arguments.Count <> 2 Then
|
||||||
|
WScript.Echo "Usage: cscript zip.vbs <zipPath> <dirToZip>"
|
||||||
|
Else
|
||||||
|
CreateZip WScript.Arguments(0), WScript.Arguments(1)
|
||||||
|
End If
|
||||||
|
|
||||||
|
Sub NewZip(pathToZipFile)
|
||||||
|
|
||||||
|
'WScript.Echo "Newing up a zip file (" & pathToZipFile & ") "
|
||||||
|
|
||||||
|
Dim fso
|
||||||
|
Set fso = CreateObject("Scripting.FileSystemObject")
|
||||||
|
Dim file
|
||||||
|
Set file = fso.CreateTextFile(pathToZipFile)
|
||||||
|
|
||||||
|
file.Write Chr(80) & Chr(75) & Chr(5) & Chr(6) & String(18, 0)
|
||||||
|
|
||||||
|
file.Close
|
||||||
|
Set fso = Nothing
|
||||||
|
Set file = Nothing
|
||||||
|
|
||||||
|
WScript.Sleep 500
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Sub CreateZip(pathToZipFile, dirToZip)
|
||||||
|
|
||||||
|
'WScript.Echo "Creating zip (" & pathToZipFile & ") from (" & dirToZip & ")"
|
||||||
|
|
||||||
|
Dim fso
|
||||||
|
Set fso= Wscript.CreateObject("Scripting.FileSystemObject")
|
||||||
|
|
||||||
|
pathToZipFile = fso.GetAbsolutePathName(pathToZipFile)
|
||||||
|
dirToZip = fso.GetAbsolutePathName(dirToZip)
|
||||||
|
|
||||||
|
If fso.FileExists(pathToZipFile) Then
|
||||||
|
'WScript.Echo "That zip file already exists - deleting it."
|
||||||
|
fso.DeleteFile pathToZipFile
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not fso.FolderExists(dirToZip) Then
|
||||||
|
'WScript.Echo "The directory to zip does not exist."
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
NewZip pathToZipFile
|
||||||
|
|
||||||
|
dim sa
|
||||||
|
set sa = CreateObject("Shell.Application")
|
||||||
|
|
||||||
|
Dim zip
|
||||||
|
Set zip = sa.NameSpace(pathToZipFile)
|
||||||
|
|
||||||
|
'WScript.Echo "opening dir (" & dirToZip & ")"
|
||||||
|
|
||||||
|
Dim d
|
||||||
|
Set d = sa.NameSpace(dirToZip)
|
||||||
|
|
||||||
|
' Look at http://msdn.microsoft.com/en-us/library/bb787866(VS.85).aspx
|
||||||
|
' for more information about the CopyHere function.
|
||||||
|
zip.CopyHere d.items, 4
|
||||||
|
|
||||||
|
Do Until d.Items.Count <= zip.Items.Count
|
||||||
|
Wscript.Sleep(200)
|
||||||
|
Loop
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Sub ExtractFilesFromZip(pathToZipFile, dirToExtractFiles)
|
||||||
|
|
||||||
|
Dim fso
|
||||||
|
Set fso = CreateObject("Scripting.FileSystemObject")
|
||||||
|
|
||||||
|
pathToZipFile = fso.GetAbsolutePathName(pathToZipFile)
|
||||||
|
dirToExtractFiles = fso.GetAbsolutePathName(dirToExtractFiles)
|
||||||
|
|
||||||
|
If (Not fso.FileExists(pathToZipFile)) Then
|
||||||
|
WScript.Echo "Zip file does not exist: " & pathToZipFile
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not fso.FolderExists(dirToExtractFiles) Then
|
||||||
|
WScript.Echo "Directory does not exist: " & dirToExtractFiles
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
dim sa
|
||||||
|
set sa = CreateObject("Shell.Application")
|
||||||
|
|
||||||
|
Dim zip
|
||||||
|
Set zip = sa.NameSpace(pathToZipFile)
|
||||||
|
|
||||||
|
Dim d
|
||||||
|
Set d = sa.NameSpace(dirToExtractFiles)
|
||||||
|
|
||||||
|
' Look at http://msdn.microsoft.com/en-us/library/bb787866(VS.85).aspx
|
||||||
|
' for more information about the CopyHere function.
|
||||||
|
d.CopyHere zip.items, 4
|
||||||
|
|
||||||
|
Do Until zip.Items.Count <= d.Items.Count
|
||||||
|
Wscript.Sleep(200)
|
||||||
|
Loop
|
||||||
|
|
||||||
|
End Sub
|
Loading…
Add table
Add a link
Reference in a new issue