Major/Minor/Bug version = 0 when unzipped and run by LaunchAgent

I have something strange going on with an app running on OS X Yosemite. The desktop app is downloaded and run by a xojo console app that is started by a LaunchAgent.

When I build the desktop app, its App.MajorVersion, App.MinorVersion, and App.BugVersion are all giving expected values (in this case 1, 4, and 39). I then go through the following steps:
a. compress (zip) the app
b. encrypt the zipped file using command line openssl
c. upload the file to server

The LaunchAgent (running as root) then fires up the console app, which downloads the zipped, encrypted desktop app, and proceeds to decrypt and unzip it, then run it using the following command line:

shell.WriteLine "su - " + userName + " -c " + chr(34) + “/Library/Application\ Support/fvfde/InstallFVFDE.app/Contents/MacOS/InstallFVFDE” + chr(34)

The desktop app runs, but it shows App.MajorVersion, App.MinorVersion, and App.BugVersion as all being 0.

I am having a hard time coming up with ideas as to why this is happening. Anyone out there have any thoughts?

Thanks

  1. look in the plist as they are read from there
  2. if they are set as expected check read permissions on the enclosed files in the bundle - unzipping it may restore with an invalid user

Do you happen to be running AppWrapper? There’s an option in there to make the version more “compatible” with Apple, but it mangles the constants.

Sounds like your permissions may be getting screwed, you need to make sure they’re good before you zip the application and Ideally you should use a Zip processor that stores the ACL information.

Thanks everyone for your help. Yes, it was a permissions problem. I hadn’t realized that zip/unzip does not preserve permissions. By changing the process to use a tar file instead, the problem was solved.