OS X: Run my application automatically right after installing this .pkg file - macos

I have developed a mac application and using Product->Archive->Share in Xcode to create a .pkg file and will be submitting to Appstore. I would like to run my application automatically right after installing this .pkg file doing this way. I know using PackageMaker, it is possible to write pre and post scripts. But, Appstore is not accepting any .pkg file which are created using PackageMaker, so i'm using Product->Archive->Share in Xcode to create pkg file.
Could someone advise how can i run my application automatically right after installing this .pkg file?
Thank you!

You're not supposed to be able to do this. Part of the point of the App Store is that there's a uniform, consistent installation experience—the app downloads, installs silently, then shows up in LaunchPad for you to run if you want to.
Remember when getting Xcode from the App Store used to mean you got an app called "Install Xcode.app" in /Applications, and then you had to run that installer? That confused half of Xcode's users, who are about as technically savvy a user base as any app is likely to have, and it's from Apple, and even they couldn't get around the problem by auto-launching "Install Xcode.app".

Related

How submit macOS screensaver(.saver file) to Appstore?

I created a mac screensaver & I'm able to test it with archiving it & installing the '.saver' file.
But how can I submit this '.saver' file to Appstore?
The 'Transporter' app is not accepting it.
I could't find any tutorial about it.
I have 2 targets in my project, the default one is that I mentioned above, another one can run on my mac directly from Xcode as an app.
I'm not sure about submitting this one, What if it didn't placed on user's mac screensavers window...?
Because when I run this on my mac, it runs as a normal mac application in a window!
Update
OK, I submitted it on the Appstore and it approved! but, as I expected, it installs like a normal macOS app & doesn't appear on screensavers list.
how can I submit this '.saver' file to Appstore?
Update 2
I researched a lot about it and found out as 'Max' said on comments, its not an app and should not be on the Appstore itself, we should build and app to copy 'screensaver.saver' file in to it, and then copy the screensaver file to user system, or run it from user OSX so it will install automatically.
Now the real deal and the huge problem and the mother of all headaches appear here!
The Notarization Process!
Now if a user install our screensaver & everything works fine, still the screensaver will not run, and user will see a message like this when he/she wants to run it:
OK, now we need to notarize our 'screensaver.saver' file to fix this.
I tried very hard to do that, but I failed, because of its complicated process... and because all of them was about PKG & DMG files.
But I'll put the references here to help others, Please help yourself & if you found out how to do it right, post an answer here & help other non professional developers who can't speak Alien languages...
Awesome explanation #1
Awesome explanation #2
Awesome explanation #3
Some related question that might help
Cheers!

How can I run my .app from my server and have the wrong version?

I have an AppleScript script that I saved as a .app file and I am simply moves directories in the correct location. The script works perfectly when on my local machine but when I upload it to my server and download from my server (trying to create the user experience) then the script has has a circle and a line running through it with this error:
"You can’t use this version of the application “myapp” with this version of macOS. You have macOS 10.12.3. The application requires macOS 2573.6 or later."
I tried googling macOS 2573.6 and nothing comes up and I have no idea what that is. I don't even think that is a real macOS version. If anyone has any idea how to fix this issue I would be extremely grateful.
You are likely breaking all kinds of attributes in the App Bundle during the transfer.
Compress the app bundle first, then copy that to the server. Then, to test, re-download that archive and uncompress it locally.
It should run.

How to generate an installer package for Mac app?

How can I create a single installer package for an OS X binary as well as a few configuration and script files?
Final folders should look like this:
Any help would be appreciated. Thanks.
Installers are great if you want various things to be placed in different spots – app here, documentation there, support files over here, etc. They're also great for providing configurability of the installation experience (optional extras), or hand-holding for an unusual type of installation that the user might not otherwise understand, or extra work (configuration scripts, permissions modifications, authentication, compatibility checking, etc.) that need to run during the installation process. There is nothing wrong with installers, contrary to the answer from #d00dle, although there is also nothing wrong with distributing your app through the App Store, or as a dmg.
For setting up your own installers, I highly recommend a program called Packages (http://s.sudre.free.fr/Software/Packages/about.html). I am in no way connected to it, but I use it to build the installer for an app that I work on. It greatly smoothes the process of making a complex installer, and has an excellent GUI interface.
There's also macOS Installer Builder, which is a CLI you can use to create an installer wizard for your .pkg: https://github.com/KosalaHerath/macos-installer-builder
macOS does not normally use installers. Applications are packaged in app containers with the extension .app. This container is "executable" but you're also able to dig in and see what is inside. This is also the format distributed through App Store.
You can create .pkg or .dmg "installers" if necessary, however this is clearly not something apple aims to be standard. I would advise to use the .app pattern and any scripts needed should be self contained and executed on first run.
You can use .dmg to distribute your application outside of App Store (this is still fairly normal).
macOS also includes a terminal program called productbuild that builds a product archive for the macOS Installer or the Mac App Store. Enter man productbuild into the Terminal on a Mac for the manual page.

Installers and productbuild on OSX for Mac App Store

I have a product that I would like to distribute on the Mac App Store. For context, this is a Qt (5.3) app written in C++ on OSX 10.9 with Xcode 5.1.1. I have two questions:
1) When I use productbuild like such:
productbuild --component /path/to/my/Program.app /Applications Product-Installer.pkg
I get the Product-Installer.pkg as expected (this took some effort since the man pages made no mention that the bundle has to be signed before this will work) but when I run the installer, I do not see my app in /Applications. Even though the installer says it installed successfully, I am unable to find any evidence that Program.app was installed anywhere on my system. I am wondering if there is something I'm missing, similar to how not signing the bundle caused productbuild to give me a "The component [component] is not a bundle error?
2) My program has configuration files and I'm not sure what the best way is to handle these on install. For example, in the Windows-world, I would just install a config.ini file (for example) into the user's data folder during install. However, the way the docs read regarding Mac Store Apps, my take is that that's really not done...? I'm wondering then if the best way to handle this is to just generate the config.ini upon the first run of the app? How is this typically handled with App Store apps?
Thank you!
2) you would install them in the Application Support directory in your sandbox container.
Typically the configuration is called User Defaults and implemented with CFPreferences in plain old C or NSUserDefaults with Objective C. You would ship your UserDefaults.plist inside your package/bundle and register it on each launch of the app with registerDefaults:.

How do I include one application inside another?

Our .app download includes a tool (another, smaller, app) with it that we'd like to allow users to run from the "Applications" folder, but we don't want them to have to download more than one file.
Is there a way to include one .app inside another that will result in the OS automatically adding both of them to the Applications folder when the user drags and drops it in there from the dmg file we distribute? Or would we have to use a package that extracts two separate applications?
Thanks for your help.
I don't think that apps bundled inside other apps (i.e. helper apps) would show up in Mac OS X's (Lion) Launch Pad. Much less from the Finder for end-users.
Apple distributes Xcode through the Mac App Store and it has many apps : Xcode, Intruments, Quartz Composer, etc. Perhaps downloading an installer from the Store (as is done with Xcode) would be an option for you.
I realize it's an extra step for the user but I don't see how you can bundle multiple distinct apps in the App Store.
Aside from that, perhaps offer each software as a seperate download. Or revisite if the apps actually do need to be their own islands. Good luck!

Resources