Sachin Srivastava
Sachin Srivastava

Reputation: 31

Does packagesbuild support environment variable defined in the .pkgproj file?

I am trying to use packagesbuild to create packages in MacOS. I want to use generic template with environment variable so that I don't require to create separate pkgproj file for each app but packagesbuild is not able to recognize the environment variable defined in the template file.

After setting the environment variable in the terminal

export APP_PATH='/Users/sachin/Documents/Test/Client/Example.app'

and then using the same environment variable in example.pkgproj

...
<key>PATH</key>
<string>${APP_PATH}</string>
...

then triggering the command packagesbuild using the projectfile

packagesbuild example.pkgproj 

getting below eror

ERROR:

Description:

Unable to copy item at path 'APP_PATH' to '/private/tmp/S2EyTxCb/502/ExampleClient' because the item could not be found

http://s.sudre.free.fr/Software/Packages/about.html

Upvotes: 2

Views: 511

Answers (1)

fefanto
fefanto

Reputation: 46

from packages 1.2.10 you can add "user defined settings" - see manual

  • from packages GUI menu: view/show user defined settings.
  • define keys and values there
  • on some UI properties - see again manual - you can add '${USER_DEFINED_SETTING_NAME}' as value.
  • then launch : packagesbuild --project /path/to/the/project.pkgproj USER_DEFINED_SETTING_NAME="SOMEVALUE"

in brief you need and extra step : environment variable -> script launching packages build with user defined settings arg -> project variable

Upvotes: 0

Related Questions