Zip utility changed to 7z

This commit is contained in:
feodor_fitsner 2012-10-26 15:31:39 -07:00
parent ace6802cee
commit 6cc1f1e8cc
2 changed files with 16 additions and 119 deletions

View file

@ -20,6 +20,7 @@
<DiffCmd>$(TrunkFolder)\Tools\Diff.exe</DiffCmd>
<SqlCmd>"C:\Program Files\Microsoft SQL Server\110\Tools\Binn\sqlcmd.exe" -S (local)\SQLEXPRESS -E</SqlCmd>
<ZipCmd>"C:\Program Files\7-Zip\7z.exe"</ZipCmd>
<MSDeployPath Condition="Exists('$(ProgramFiles)\IIS\Microsoft Web Deploy\msdeploy.exe')">"$(ProgramFiles)\IIS\Microsoft Web Deploy\msdeploy.exe"</MSDeployPath>
<MSDeployPath Condition="Exists('$(ProgramFiles)\IIS\Microsoft Web Deploy V3\msdeploy.exe')">"$(ProgramFiles)\IIS\Microsoft Web Deploy V3\msdeploy.exe"</MSDeployPath>
@ -588,10 +589,10 @@
<Zip Files="@(StandaloneInstallFiles)" ZipFileName="$(DeployFolder)\WebsitePanel-StandaloneServerSetup-$(Version).zip" WorkingDirectory="$(StandaloneInstall)" />
-->
<Exec Command="cscript $(TrunkFolder)\zip.vbs &quot;$(DeployFolder)\WebsitePanel-Portal-$(Version).zip&quot; &quot;$(PortalInstall)&quot;" />
<Exec Command="cscript $(TrunkFolder)\zip.vbs &quot;$(DeployFolder)\WebsitePanel-EnterpriseServer-$(Version).zip&quot; &quot;$(EnterpriseServerInstall)&quot;" />
<Exec Command="cscript $(TrunkFolder)\zip.vbs &quot;$(DeployFolder)\WebsitePanel-Server-$(Version).zip&quot; &quot;$(ServerInstall)&quot;" />
<Exec Command="cscript $(TrunkFolder)\zip.vbs &quot;$(DeployFolder)\WebsitePanel-StandaloneServerSetup-$(Version).zip&quot; &quot;$(StandaloneInstall)&quot;" />
<Exec Command="$(ZipCmd) a &quot;$(DeployFolder)\WebsitePanel-Portal-$(Version).zip&quot; &quot;$(PortalInstall)\*&quot;" />
<Exec Command="$(ZipCmd) a &quot;$(DeployFolder)\WebsitePanel-EnterpriseServer-$(Version).zip&quot; &quot;$(EnterpriseServerInstall)\*&quot;" />
<Exec Command="$(ZipCmd) a &quot;$(DeployFolder)\WebsitePanel-Server-$(Version).zip&quot; &quot;$(ServerInstall)\*&quot;" />
<Exec Command="$(ZipCmd) a &quot;$(DeployFolder)\WebsitePanel-StandaloneServerSetup-$(Version).zip&quot; &quot;$(StandaloneInstall)\*&quot;" />
<!-- zip updates
@ -611,11 +612,11 @@
<Zip Files="@(InstallerUpdateFiles)" ZipFileName="$(DeployFolder)\WebsitePanel-Installer-$(Version)-Update.zip" WorkingDirectory="$(InstallerBuild)" />
-->
<Exec Command="cscript $(TrunkFolder)\zip.vbs &quot;$(DeployFolder)\WebsitePanel-Portal-$(Version)-Update.zip&quot; &quot;$(PortalUpdate)&quot;" />
<Exec Command="cscript $(TrunkFolder)\zip.vbs &quot;$(DeployFolder)\WebsitePanel-EnterpriseServer-$(Version)-Update.zip&quot; &quot;$(EnterpriseServerUpdate)&quot;" />
<Exec Command="cscript $(TrunkFolder)\zip.vbs &quot;$(DeployFolder)\WebsitePanel-Server-$(Version)-Update.zip&quot; &quot;$(ServerUpdate)&quot;" />
<Exec Command="cscript $(TrunkFolder)\zip.vbs &quot;$(DeployFolder)\Manual-Update.zip&quot; &quot;$(UpdateFolder)&quot;" />
<Exec Command="cscript $(TrunkFolder)\zip.vbs &quot;$(DeployFolder)\WebsitePanel-Installer-$(Version)-Update.zip&quot; &quot;$(InstallerBuild)&quot;" />
<Exec Command="$(ZipCmd) a &quot;$(DeployFolder)\WebsitePanel-Portal-$(Version)-Update.zip&quot; &quot;$(PortalUpdate)\*&quot;" />
<Exec Command="$(ZipCmd) a &quot;$(DeployFolder)\WebsitePanel-EnterpriseServer-$(Version)-Update.zip&quot; &quot;$(EnterpriseServerUpdate)\*&quot;" />
<Exec Command="$(ZipCmd) a &quot;$(DeployFolder)\WebsitePanel-Server-$(Version)-Update.zip&quot; &quot;$(ServerUpdate)\*&quot;" />
<Exec Command="$(ZipCmd) a &quot;$(DeployFolder)\Manual-Update.zip&quot; &quot;$(UpdateFolder)\*&quot;" />
<Exec Command="$(ZipCmd) a &quot;$(DeployFolder)\WebsitePanel-Installer-$(Version)-Update.zip&quot; &quot;$(InstallerBuild)\*&quot;" />
<!-- zip tools
<Zip Files="@(ImportCsvInstallFiles)" ZipFileName="$(ToolsFolder)\WebsitePanel-Import-CsvBulk-$(Version).zip" WorkingDirectory="$(ImportCsvInstall)" />
@ -626,12 +627,12 @@
<Zip Files="@(WSPTransportAgentInstallFiles)" ZipFileName="$(ToolsFolder)\WebsitePanel-WSPTransportAgent-$(Version).zip" WorkingDirectory="$(WSPTransportAgentInstall)" />
-->
<Exec Command="cscript $(TrunkFolder)\zip.vbs &quot;$(DeployFolder)\WebsitePanel-Import-CsvBulk-$(Version)-Update.zip&quot; &quot;$(ImportCsvInstall)&quot;" />
<Exec Command="cscript $(TrunkFolder)\zip.vbs &quot;$(DeployFolder)\WebsitePanel-HyperVUtils-$(Version)-Update.zip&quot; &quot;$(HyperVUtilsInstall)&quot;" />
<Exec Command="cscript $(TrunkFolder)\zip.vbs &quot;$(DeployFolder)\WebsitePanel-VMConfig-$(Version)-Update.zip&quot; &quot;$(VMConfigInstall)&quot;" />
<Exec Command="cscript $(TrunkFolder)\zip.vbs &quot;$(DeployFolder)\WebsitePanel-Import-Enterprise-$(Version)-Update.zip&quot; &quot;$(ImportEnterpriseInstall)&quot;" />
<Exec Command="cscript $(TrunkFolder)\zip.vbs &quot;$(DeployFolder)\WebsitePanel-AWStatsViewer-$(Version)-Update.zip&quot; &quot;$(AWStatsViewerInstall)&quot;" />
<Exec Command="cscript $(TrunkFolder)\zip.vbs &quot;$(DeployFolder)\WebsitePanel-WSPTransportAgent-$(Version)-Update.zip&quot; &quot;$(WSPTransportAgentInstall)&quot;" />
<Exec Command="$(ZipCmd) a &quot;$(DeployFolder)\WebsitePanel-Import-CsvBulk-$(Version)-Update.zip&quot; &quot;$(ImportCsvInstall)\*&quot;" />
<Exec Command="$(ZipCmd) a &quot;$(DeployFolder)\WebsitePanel-HyperVUtils-$(Version)-Update.zip&quot; &quot;$(HyperVUtilsInstall)\*&quot;" />
<Exec Command="$(ZipCmd) a &quot;$(DeployFolder)\WebsitePanel-VMConfig-$(Version)-Update.zip&quot; &quot;$(VMConfigInstall)\*&quot;" />
<Exec Command="$(ZipCmd) a &quot;$(DeployFolder)\WebsitePanel-Import-Enterprise-$(Version)-Update.zip&quot; &quot;$(ImportEnterpriseInstall)\*&quot;" />
<Exec Command="$(ZipCmd) a &quot;$(DeployFolder)\WebsitePanel-AWStatsViewer-$(Version)-Update.zip&quot; &quot;$(AWStatsViewerInstall)\*&quot;" />
<Exec Command="$(ZipCmd) a &quot;$(DeployFolder)\WebsitePanel-WSPTransportAgent-$(Version)-Update.zip&quot; &quot;$(WSPTransportAgentInstall)\*&quot;" />
</Target>

View file

@ -1,104 +0,0 @@
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