mirror of
https://github.com/ckamte/adobe-packager-windows.git
synced 2026-11-21 13:05:38 -05:00
Add batch download function
This commit is contained in:
10
README.md
10
README.md
@@ -15,7 +15,7 @@ Arguments:
|
||||
"-l", "--installLanguage", "Language code (eg. en_US)"
|
||||
"-o", "--osLanguage", "OS Language code (eg. en_US)"
|
||||
"-p", "--appPlatform", "Application platform (eg. win64)"
|
||||
"-s", "--sapCode", "SAP code for desired product (eg. PHSP)"
|
||||
"-s", "--sapCode", "SAP code for desired product (eg. PHSP). For batch download use comma to separate products"
|
||||
"-v", "--version", "Version of desired product (eg. 21.0.3)"
|
||||
"-d", "--destination", "Directory to download installation files to"
|
||||
"-u", "--urlVersion", "Get app info from v4/v5/v6 url (eg. v6)"
|
||||
@@ -36,3 +36,11 @@ Arguments:
|
||||
6. Optional - Delete downloaded zip files in "acc_sources" directory to reduce installer size (Not necessary because omitting the folder if the whole installation is packed is valid and if kept, used for other products)
|
||||
7. Run Set-up.exe to install the product.
|
||||
8. Note - Make sure AdobePIM.dll file version in "resources" folder matches the Set-Up.exe file version.
|
||||
|
||||
## Note
|
||||
|
||||
1. You can manually download CC Library packge using *libs* sapcode and *kfnt* for Adobe fonts.
|
||||
2. Batch download is available now.
|
||||
```
|
||||
python ccdl-win.py -u 6 -l en_US -p win64 -s phsp,idsn,ilst -x
|
||||
```
|
||||
|
||||
77
ccdl-win.py
77
ccdl-win.py
@@ -160,37 +160,18 @@ def app_platform():
|
||||
|
||||
return appPlatform
|
||||
|
||||
|
||||
def product_code(sapCodes):
|
||||
selectedCode = args.sapCode
|
||||
if selectedCode:
|
||||
selectedCode = selectedCode.upper()
|
||||
|
||||
if selectedCode and selectedCode not in sapCodes:
|
||||
print("\nProvided SAP code ({}) is not available\n".format(selectedCode))
|
||||
answer = None
|
||||
while answer is None:
|
||||
answer = input("Are you want to continue? (y/n): ")
|
||||
if answer.lower() in ["y", "yes"]:
|
||||
print("")
|
||||
selectedCode = None
|
||||
elif answer.lower() in ["n", "no"]:
|
||||
print("\nProgram terminated!\n")
|
||||
exit()
|
||||
else:
|
||||
print("\nPlease enter yes or no!")
|
||||
answer = None
|
||||
|
||||
if not selectedCode or selectedCode is None:
|
||||
def select_product(products, sapCodes):
|
||||
for s, d in sapCodes.items():
|
||||
print("[{}]{}{}".format(s, (10 - len(s)) * " ", d))
|
||||
|
||||
while selectedCode is None:
|
||||
slectedProduct = None
|
||||
|
||||
while slectedProduct is None:
|
||||
val = input(
|
||||
"\nPlease enter the SAP Code of the desired product from the list above: "
|
||||
).upper()
|
||||
if products.get(val):
|
||||
selectedCode = val
|
||||
slectedProduct = val
|
||||
elif val == "":
|
||||
print("No product selected! Please use a value from the list above.")
|
||||
else:
|
||||
@@ -199,8 +180,46 @@ def product_code(sapCodes):
|
||||
val
|
||||
)
|
||||
)
|
||||
return selectedCode
|
||||
return slectedProduct
|
||||
|
||||
# for batch download
|
||||
def product_code(products, sapCodes):
|
||||
codeList = []
|
||||
toDown = args.sapCode
|
||||
if toDown:
|
||||
toDown = toDown.upper().split(',')
|
||||
for prodToDown in toDown:
|
||||
if prodToDown in sapCodes:
|
||||
print("\nAdd {} to download list".format(prodToDown))
|
||||
codeList.append(prodToDown)
|
||||
|
||||
else:
|
||||
print("\n{} is not available!\n".format(prodToDown))
|
||||
answer = None
|
||||
while answer is None:
|
||||
answer = input("Are you want to continue? (y/n): ")
|
||||
if answer.lower() in ["y", "yes"]:
|
||||
answer = select_product(products, sapCodes)
|
||||
# for duplicate entry
|
||||
while answer in codeList:
|
||||
print("\nAdd {} already exist in donload list".format(answer))
|
||||
answer = input(
|
||||
"\nPlease enter the SAP Code of the desired product from the list above: "
|
||||
).upper()
|
||||
else:
|
||||
print("\nAdd {} to download list".format(answer))
|
||||
codeList.append(answer)
|
||||
elif answer.lower() in ["n", "no"]:
|
||||
print("\nProgram terminated!\n")
|
||||
else:
|
||||
print("\nPlease enter yes or no!")
|
||||
answer = None
|
||||
|
||||
else:
|
||||
toDown = select_product(products, sapCodes)
|
||||
codeList.append(toDown)
|
||||
|
||||
return codeList
|
||||
|
||||
def product_version(product, versions):
|
||||
version = None
|
||||
@@ -898,7 +917,9 @@ def package_download(json, pkg_dir, language, selectedPlatform):
|
||||
def run_ccdl(products, cdn, sapCodes, selectedPlatform):
|
||||
"""Run Main execution."""
|
||||
# get product list
|
||||
sapCode = product_code(sapCodes)
|
||||
productLists = product_code(products, sapCodes)
|
||||
|
||||
for sapCode in productLists:
|
||||
product = products.get(sapCode)
|
||||
|
||||
# version select
|
||||
@@ -990,7 +1011,7 @@ if __name__ == "__main__":
|
||||
parser.add_argument(
|
||||
"-s",
|
||||
"--sapCode",
|
||||
help="SAP code for desired product (eg. PHSP)",
|
||||
help="SAP code for desired product (eg. PHSP). For batch download use comma to separate products",
|
||||
action="store",
|
||||
)
|
||||
parser.add_argument(
|
||||
@@ -1042,6 +1063,8 @@ if __name__ == "__main__":
|
||||
while True:
|
||||
try:
|
||||
run_ccdl(products, cdn, sapCodes, selectedPlatform)
|
||||
# cleanup old sapcodes
|
||||
args.sapCode = None
|
||||
if args.noRepeatPrompt or not questiony(
|
||||
"\n\nDo you want to download another package"
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user