I have to run an application when the installation is taking progress. But I get the error message that the permission is denied when it is executed during the installation like shown in the image below,

alt text

asked 03 May '13, 06:02

Codename%20K's gravatar image

Codename K
accept rate: 50%

It is also possible that you are trying to directly execute an application bundle directly (the black boxes do not let me see the extension :)). In that case, you will either have to call its CFBundleExecutable (defined under application.app/Contents/Info.plist) as:

       <!-- Uncomment the below if you need to call it in backcground -->
       <!-- <programArguments>&amp;</programArguments>-->

Or use the open program:


The above will call it in the background. If you need to do it in the foreground, you will need the -W argument:

       <programArguments>-W /Applications/application.app</programArguments>

answered 03 May '13, 06:34

juanjo's gravatar image

juanjo ♦♦
accept rate: 23%

By default, the open command brings the application which it opens to the foreground. To prevent it from bringing the application it opens to the foreground, use the -g flag. The -W flag should be used in order to wait until the opened application exits (similar to opening the application via its executable file).

See the man page.

(03 May '13, 06:45) Dirk Stegemann

Yes, that is what I meant :). When I was talking about foreground and background I was referring to blocking or not the execution, not to if the window would be brought to the foreground.

(03 May '13, 06:56) juanjo ♦♦

Splendid! your solution worked like a charm. We need to run the binary inside the app file (or folder)

(03 May '13, 08:28) Codename K

You'll want to elevate your installer program's file access permissions. The easiest way to to this is to add the <requireInstallationByRootUser>1</requireInstallationByRootUser> property to your project.

Then, upon launch of your installation program, the user is asked to enter their administrative credentials, and your installer program can perform administrative tasks (such as running scripts with administrative permissions).


answered 03 May '13, 06:14

Dirk%20Stegemann's gravatar image

Dirk Stegemann
accept rate: 31%

Thanks for you help. The solution was helpful.

(03 May '13, 08:28) Codename K
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 03 May '13, 06:02

Seen: 4,830 times

Last updated: 03 May '13, 09:07