PackageMaker installs nothing - xcode

i have a problem, which is exactly as here http://compgroups.net/comp.sys.mac.apps/PackageMaker-not-installing-my-app (no solution is offered)
simply said, with PackageMaker i create an installer, which should just copy the .app inside /Applications
all goes well, the installer has the apropriate size of 150MB, the install starts, iam promped for the install location and admin password, i click install, progress shows up and a window that installation was successfull, but when i look at the Applications, or the custom folder specified, its nothing there
i tryed the PackageManager from Xcode 3 and also 4, but the result is the same, i also tryed to set the file permission for everybody, so they are world writable, but no success

Are you testing the installer on the same machine where you are building the installer? If you've set the "Allow Relocation" box a install will simply overwrite your already existing app you used for packaging instead of installing to /Applications.

Don't create the package just to move the app inside /Applications.
Just zip your app bundle so that it becomes YourApp.app.zip, which is a perfectly acceptable way to distribute your app. Then the user can place the app bundle (after unpacking the zip) wherever the user wants.

Do you have "Include root in package" enabled for the package's contents? See this answer for an explanation of what it does and why you probably need it.

Related

install4j how to create custom installer for macOS single bundle archive

To create installer for macOS (i4j 9.0.2) I used option "Installer-macOS single bundle". But it is deprecated now. As advised I use "Archive-macOS single bundle archive" instead. I want to have same installation dialogs as before. So, I selected "Use setup application" and had to create custom installer application in section "Installer". I created new application same as default "Installer" - manually added there all screens and actions with the same values as in "Installer".
Is this correct?
Anyway installation dialogs on Mac run without icons and images. Also installation wizard default location is not "Applications". What is wrong?
I created new application same as default "Installer" - manually added there all
screens and actions with the same values as in "Installer". Is this correct?
You can put all the screens that you want to use in the macOS setup application into a screen group and then add a link to that screen group in the setup application. In that way you do not have to duplicate them.
Anyway installation dialogs on Mac run without icons and images
I do not see that behavior here. Please contact support#ej-technologies.com with a download link to a media file that exhibits this behavior together with the .install4j project file.
Also installation wizard default location is not "Applications".
The media file type is an archive, it does not have an installation directory, but the user drags the application bundle to the desired location. This is the default installation procedure on macOS. You can style the DMG so that it shows a symbolic link to /Applications as a target in the window. This makes it easier for the user. For more information on that topic, see
https://www.ej-technologies.com/resources/install4j/help/doc/concepts/dmgStyling.html

How to trigger GateKeeper quarantine without uploading/ downloading the file/ installer?

I made a pkg installer and I'm trying to debug the codesigning issue where GateKeeper has put the quarantine flag on the installer.
This quarantine translates to the permission denied when the application through the CLI, or when double clicking, or when right clicking > open:
It does this only when the installer gets downloaded. I think I have figured out why the installer gets quarantined by GateKeeper, but the only way I can test this is by uploading it and then downloading it. This is slow, and I would like to run GateKeeper checks without wasting time uploading to the internet.
I read somewhere that zip`ing the file and unzipping it might work, it doesn't.
The quickest solution I came up with is to drag and drop the file onto a web browser and re-download it from the browser. This doesn't use any internet. It still passes through GateKeeper since the quarantine flag is re-added to the .pkg file.
Even Apple doesn't suggest this:
Quarantine a copy of your app. You can do this in either of the following ways:
Email the app to yourself and use the copy that Mail downloads.
Host the app on your own local or remote server and use the copy that Safari downloads

How to programmatically uninstall App that install DriverKit system extension

I have an app that installs a DriverKit system extension when it launches.
If I then drag this app to the Bin from /Applications then I am prompted about that the app also manages a system extension and that the system extension also will be removed.
I would like to have an uninstaller that removes the app. I have tried to remove the app in the uninstaller with rm -rf, but then the system extension is not removed.
I have also tried the trash terminal utility (can be installed with brew install trash) to check if something similar could be used from the uninstaller, but without luck.
Is there a way to programmatically remove an app and also the system extension that the app installs.
Good question! I don't have a fully baked answer, but enough suggestions to try that they won't fit in a comment, so here goes anyway:
Try using Cocoa APIs for "trashing" files. This answer gives a good rundown. I don't know how this will cope with the system extension confirmation though.
If you definitely want to pop up the confirmation dialog, using AppleScript to tell the Finder to delete the file is a great approach. I can confirm the solution given in this answer works but it will show the confirmation dialog, which may or may not be what you want.
You can uninstall a system extension (including a dext) using the systemextensionsctl uninstall command. Unfortunately, this will always pop up an authentication dialog, even if you run it with root privileges. But depending on what you're doing, that might be preferable to the above.

Launch Service register application bundle

I have some internal application bundles inside my main application bundle (in Resources). After installing (with Installer), my application is placed in /Applications, but I can't find my "internal" application by their bundle ids.
If I manually go to the /Applications, select my application and navigate to its content in Finder, my "internal" application became visible.
I know that lsregister is responsible to register application bundles, I have this script in my postflight in pkg:
SREGISTER="/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister"
$LSREGISTER "/Applications/MY.app/Contents/Resources/MyMini.app"
But I need administration privileges in my installer, that's why this command is executed by root and does no effect to current user.
Is there any solution for this problem?
Thanks!
You could register your helper apps the first time your main app runs, rather than during installation. You'll need to find them by name and location rather than bundle ID. And instead of using the lsregister tool, you can use the LSRegisterURL function. Remember that an NSURL* can be cast to a CFURLRef by toll-free bridging.
It seems that there is no solution for this. Because I need to run the lsreginster for every user of the system, and newly created users after the installation will not see this helpers app.
The only way is put this application outside the main bundle (in subdirectory of the /Applications for example)

Remove Sandboxing

I have another question dealing with app sandboxing. So I need access to the users' home directory and at the same time the app should be able to shut down the Mac. This requires to not using sandboxing.
My problem is that I don't know how to remove sandboxing and being able to submit the app to the Mac App Store. I think that the archives are sandboxed because I had turned it on once..
How to remove sandboxing from the archives properly?
Thanks for your help!
On Xcode 11, you can turn off Sandboxing by removing it from the Signing & Capabilities tab:
If I understand what you are asking correctly, you'll need to remove the entitlements.plist from your project and make sure that the Summary view of your target in Xcode has sandboxing turned off:
As Derek Wade pointed out, you can make an App like GarageBand X (which behaves obnoxiously with third party plugins like Amplitube due to Sandboxing) NOT run in a sandbox by editing the binary itself with a HEX editor like HexFiend. Look for:
<key>com.apple.security.app-sandbox</key>
Immediately following that bit you'll see the true tag, which as suggested I switched to 'fals' (no extra bytes) and now GarageBand will happily interact with third party VST plugins. Huzzah.
I found if you go into the .app package, under Contents/MacOS, there should be a binary file that matches the name of your app. Copy that file to your desktop. Edit the desktop copy of the file with TextEdit. You should find within the file, the text representation (xml) of the Entitlements for the app. Find the Sandbox entitlement flag (usually set to <true/>) and change it to <false/>. You will have to unlock the file when editing. Save the file (located on the desktop). Rename the original file in the .app package (i.e. append .old to the filename). Copy the desktop file back to the .app Package location (you may have to authorize it). This should remove the sandboxing.
You cannot remove Sandbox if the user ran you application via Sandbox.
That's the whole point - don't you think ?

Resources