VMware Cloud Community
AnonymousDefaul
Enthusiast
Enthusiast

Permissions Errors on Mac

I'm testing out InstallBuilder but am having issues on a few (but not all) test machines where the program can't write to our program directory within the users Documents folder. This happens despite requiring install by root user on the Mac. I'm a bit stuck and can't commit to purchasing the software until we know it works for all of our users. Thanks for any assistance.


<requireInstallationByRootUser>1</requireInstallationByRootUser>




Labels (1)
0 Kudos
5 Replies
michiel_dhont
Enthusiast
Enthusiast

Hi,

Are you running the installer on macOS Catalina? For Catalina, Apple has started adding additional restrictions to ~/Documents and ~/Desktop. Regardless of if the installer or uninstaller is running as root or regular user, you will find issues with those locations.

Because of these new restrictions, we would recommend you moving those directories to a different location, at least when running on Catalina and newer.

Regards,

Michiel

0 Kudos
AnonymousDefaul
Enthusiast
Enthusiast

Yes, it's on Catalina and installing user files to the Documents folder, app goes to Applications and that works fine. We just switched our software to save to the Documents folder last year after being informed that was the preferred location. It also seems to work on some Catalina machines and not others. Since most of these are user created files, where should it all be stored? Is there any way to get this to work considering we're mostly upgrading existing installs and having users move all their files would be an issue.

0 Kudos
AnonymousDefaul
Enthusiast
Enthusiast

You could set the installbuilder_experimental_catalina_features variable, (available from version 19.12.0) that will make the installer trigger the system dialog asking for permissions to access the Desktop. However, please note that if the user denies the permissions, the process will still fail and the popup will not be displayed in future executions.
<project>
   ...
   <preBuildActionList>
      <setInstallerVariable>
          <name>installbuilder_experimental_catalina_features</name>
          <value>1</value>
      </setInstallerVariable>
    </preBuildActionList>
    ...
    <preInstallationActionList>
       <!-- This should trigger the permissions dialog -->
       <touchFile abortOnError= or ' 0 or '  showMessageOnError= or ' 0 or ' >
          <path>~/Desktop/.test</path>
       </touchFile>
       <!-- Cleanup the file -->
       <deleteFile abortOnError= or ' 0 or '  showMessageOnError= or ' 0 or ' >
           <path>~/Desktop/.test</path>
       </deleteFile>
     </preInstallationActionList>
</project>
This feature will make InstallBuilder use a minimal launcher binary to bootstrap installbuilder.sh.
   $> grep -A1 CFBundleExecutable sample-1.0-osx-installer.app/Contents/Info.plist
           <key>CFBundleExecutable</key>
           <string>launcher</string>
0 Kudos
tlongabaugh
Contributor
Contributor

Hi,

Is there any way to prompt the user for access to ~/Documents without using the installbuilder_experimental_catalina_features flag previously suggested?

Our issue is we need to copy some files out of ~/Documents to a new location (we previously used ~/Documents, but obviously can't any longer), but using installbuilder_experimental_catalina_features prevents the installer from running natively on M1. This seems to be due to the launcher executable being x86_64.

Any advice on how we could prompt the user for access to ~/Documents while also being M1-native compatible?

Thanks!

0 Kudos
michieldhont_
Hot Shot
Hot Shot

Hi @tlongabaugh,

Could you contact us in private support?

Regards,

Michiel

0 Kudos