3

I'm upgrading our build system to use sfdx, and I'm trying to automate all packaging operations for our managed package.

Once a new package version has been created via sfdx, I would like to retrieve the package installation URL so that I can document it somewhere. I tried using sfdx force:package1:version:display, but I was surprised to see that it only returns things I already know and supplied at build time (package name, version and ID). There is no sign of the package install URL.

Is there a way to programmatically retrieve the install URL from a package that I just created with sfdx?

Edit: apparently the install URL can be created like this:

https://login.salesforce.com/packaging/installPackage.apexp?p0=<package version ID>

Would this work?

Edit: I'm using 1st generation packaging (1GP). I'm not planning to use 2GP.

8

You can add the --verbose flag to sfdx force:package:version:list and it will give you the Installation URLs

sfdx force:package:version:list --verbose
1
  • How did this have zero votes before today?? This is exactly the programmatic (and hindsight) way to retrieve these that I was looking for. Thank you Samir! πŸ™ May 18 '20 at 22:06
1

You can use this command

sfdx force:package:installed:list

Once you've got your 1GP package Id, you can use DX to install the package to your org, eg:

sfdx force:package:install -p 04tf2000002Fg1SAAS
1
  • Thanks for the tip. This is not exactly what I'm looking for. I want an install URL so that I can share that URL with other colleagues. They, in turn, can install that package on our customers' orgs without having to run sfdx, just by using the URL. Thanks
    – mkorman
    Dec 11 '19 at 11:42
1

This is the solution I used in the end. I build the install URL by concatenating a well-known string with the package ID, as follows:

https://login.salesforce.com/packaging/installPackage.apexp?p0=<package version ID>

This is working well so far for us, although it feels like a workaround

0

package:version:create:report

Retrieves details about a package version creation request in the Dev Hub org.

sfdx force:package:version:create:list -v DevHub1

sfdx force:package:version:create:report -i 08c2v000000KzJsAAK -v DevHub1

*=== Package Version Create Request NAME VALUE ───────────────────────────── ───────────────────────────────────────────────────────────────────────────────── ID 08c2v000000KzJsAAK Status Success Package Id 0Ho2v000000bleCCAQ Package Version Id 05i2v000000TNQ5AAO Subscriber Package Version Id 04t2v************G Tag Branch Created Date 2019-12-05 18:43 Installation URL https://login.salesforce.com/packaging/installPackage.apexp?p0=04t2v************G*

2
  • 1
    The asker is using 1GP, not 2GP.
    – David Reed
    Dec 9 '19 at 17:01
  • Yes, sorry, I'm using 1GP
    – mkorman
    Dec 10 '19 at 10:30

Your Answer

By clicking β€œPost Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.