Unique Product Identification Code - Deciphering the IProductCode

Unique Product Identification Code - Deciphering the IProductCode

Michael Lv8

Unique Product Identification Code - Deciphering the IProductCode

Table of Contents

Disclaimer: This post includes affiliate links

If you click on a link and make a purchase, I may receive a commission at no extra cost to you.

IProductCode

This interface is meant to edit the “Product Code” for specific languages present in the project.

Declaration

IProductCode: IDispatch

https://techidaily.com

Methods

GetProductCode(Int LangId) returns ProductCode
Returns product code (ex: {6B6C73EB-EC6B-4CA1-872C-2075A622E0EF}) for a specified language id as detailed in theMicrosoft documentation .

UpdateProductCode(String ProductCode, Int LangId)
Updates the product code for the specified language id with the value provided by the second parameter.

GenerateProductCode(Int LangId) returns ProductCode
Updates the product code for the specified language id with a generated value for product code and returns the new value.

SetDifferentValues()
Sets different values for product codes if there are multiple languages in the project.

SetSameValue()
If there are multiple languages in the project, they will share the same value as product code.

GenerateAll()
Generates a new product code for all languages in the project.

PrintProductCodes() returns ProductCodes
Returns a string with all the product codes and the corresponding languages.

Examples

$advinst = new-object -comObject “AdvancedInstaller”
$proj = $advinst.CreateProject($advinst.ProjectTypes.Architect)

https://techidaily.com

generate new product code

$proj.ProductDetails.ProductCode.GenerateAll()
$new_prodCode = $proj.ProductDetails.ProductCode.GetProductCode()

https://techidaily.com

generate upgrade code

$upgradeCode = $proj.ProductDetails.UpgradeCode.UpgradeCode
$new_upgradeCode = $proj.ProductDetails.UpgradeCode.GenerateUpgradeCode()

https://techidaily.com

load a project with multiple languages

$projPath = “C:\Tests\Powershell COM\multi-language.aip”

generate different product codes for each language

$projPath.ProductDetails.ProductCode.SetDifferentValues()

get product code per language package

$pc_en = $projPath.ProductDetails.ProductCode.GetProductCode(1033)
$pc_fr = $projPath.ProductDetails.ProductCode.GetProductCode(1036)
$pc_tr = $projPath.ProductDetails.ProductCode.GetProductCode(1055)
$pc_de = $projPath.ProductDetails.ProductCode.GetProductCode(1031)

Copy

See also

IAdvinstProject

Product Details Tab

IUpgradeCode

Did you find this page useful?

Please give it a rating:

Thanks!

Report a problem on this page

Information is incorrect or missing

Information is unclear or confusing

Something else

Can you tell us what’s wrong?

Send message

Also read:

  • Title: Unique Product Identification Code - Deciphering the IProductCode
  • Author: Michael
  • Created at : 2024-10-27 00:11:47
  • Updated at : 2024-10-28 18:15:29
  • Link: https://fox-where.techidaily.com/unique-product-identification-code-deciphering-the-iproductcode/
  • License: This work is licensed under CC BY-NC-SA 4.0.