VMware Cloud Community
zootsuitjeff
Enthusiast
Enthusiast

Path Differences Between Command line & running programs from Installbuilder on Mac

Hello Support,

Right now i am trying to set up properly git-lfs as part of my install process on the mac.  I've installed git successfully and installed git-lfs, so that it works correctly on the command prompt and git comands will work in installbuilder.  However either 'git-lfs' command or 'git lfs' are not found when invoked from <runProgram>  when i display the value of ${env(PATH)} within the installer i get:

${env(PATH)}:

/sbin:/usr/sbin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin

versus from the command prompt:

echo $PATH

/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

And since git-lfs is installed in usr/local/bin and that isn't included in the installbuilder version of the path I think that is the problem.  My question is why are these 2 variables different, and how can i change the path within installbuilder?

I've tried both <setEnvironmentVariable> & <addDirectorytoPath> to try to modify the path but neither seem to have an effect.  Also note i am turning on the flag <requireInstallationByRootUser> so i can have admin privileges for my installer, not sure if that is relevant to.this issue or not.

Thanks,

Jeff

Labels (1)
Reply
0 Kudos
7 Replies
zootsuitjeff
Enthusiast
Enthusiast

Anyone have any suggestions or ideas about this?  This is the main issue blocking me from completing the mac version of our installer.

Thanks so much,

Jeff

Reply
0 Kudos
gongomgra
VMware Employee
VMware Employee

Hi zootsuitjeff​,

Can you tell us if the PATH environment variable including the /usr/local/bin is defined in the ~/.zshrc or ~/.bashrc file? Which shell console are you using by default?

Reply
0 Kudos
zootsuitjeff
Enthusiast
Enthusiast

I'm running and testing on a VM with a clean install of a recent vesion of MacOS, I *think* it is using zsh, but of course I would want the installer to work on any recent Mac version.

Reply
0 Kudos
zootsuitjeff
Enthusiast
Enthusiast

my mistake, the clean installs of mac os are using bash for shell

I found a sort of workaround, in that i create symlinks for the commands i need to use later from /usr/local/bin to /usr/local/sbin, which is included in the ${env(PATH)}.  but this seems pretty hacky.

My question remains, why is the PATH variable within installbuilder different from the command line, where is it coming from, and how can i modify it in the installer?

thanks,

Jeff

Reply
0 Kudos
gongomgra
VMware Employee
VMware Employee

Hi,

Can you try setting it in the initializationActionList?

<initializationActionList>

  <setEnvironmentVariable>

  <name>PATH</name>

  <value>/usr/local/bin:${env(PATH)}</value>

  </setEnvironmentVariable>

</initializationActionList>

Reply
0 Kudos
zootsuitjeff
Enthusiast
Enthusiast

i tried checking the PATH during initialization. but that resulted in the same path as in other phases.  I did verify that <addDirectoryToPath>  does indeed change the PATH for the current user which is good.   But invoking programs during installation or checking the value of ${env(PATH)} during the install still results in something that isn't the current user's PATH variable.

Reply
0 Kudos
gongomgra
VMware Employee
VMware Employee

Hi zootsuitjeff,

I'm sorry for the late reply. We had some issues with this community forum and we missed your message. Did you manage to solve your issue?

Best regards,
Gonzalo

Reply
0 Kudos