Terminate and replace app with earlier version to do upgrade install - objective-c

I'm a newbie in Mac OSx & Objective-C development.
I'd like to ask some help on how to terminate as well as replacing an existing app (with an earlier version) when a later version of the app is being installed or upgraded?
I am aware about updating an app when a new version is available in the App Store or an external server. I've got that covered already. But this one is an implementation for a mac with no internet connection. Upgrading is done manually by installing the app whenever there's a new version available.
Behavior when installing:
It should check if there's an existing copy of the app in the system. It should prompt the user to continue and remove the app or cancel the installation.
If an existing copy of the app is currently running, it should prompt the user to quit the running copy of the app or cancel the installation. When the user selects to quit the app, it should automatically terminate the app and continue with the installation. The app with the previous version should be replaced by the newly installed copy of the app with the later version.
Any help would be much appreciated.

The PackageMaker can do all of this for you. Prepare an installer using this app by Apple. If you are using Mountain Lion then download it from
https://developer.apple.com/downloads "Auxiliary tools for Xcode"
Launch the application and click the edit button in the actions tab below preinstall actions.
In the sheet that is presented add the Quit application action.

Related

How can I force my app into the Applications/ folder?

I am currently developing a desktop app in OS X which has a requirement for Autostart on Boot. I have implemented autostart and it works well when I install my app and put it in the Applications/ folder, but I can't expect users to move the file. I am distributing the app using HockeyApp.
So I've started building .pkg files with Packages. This works great and was really easy, but fails to update when used in HockeyApp. After downloading the update, I get a message saying An error occurred while trying to extract the archive. Please try again later. [Cancel Update]
Things I have tried:
Signing the update
Not signing the update
Downloading the most recent version instead of updating (works perfectly fine)
Zipping the .pkg (Fails to upload to HockeyApp)
How can I force my app into the user's Applications/ folder? Should I just ask my handful of (technologically challenged) beta testers to delete their app and download the new version? Can I make a change to my .pkg method to make it work? Should I add code into the app which moves itself (Sounds hacky and painful)?
You cannot force the user to install into /Applications, however if you get the app to arrange the auto-start itself (for example via the App Preferences) then it should use the current location of the app (probably obtained from [[NSBundle mainBundle] bundlePath]) and that will work fine.
You might want to periodically check if the app has moved after this has been turned-on.

OSX How to display only one icon in dockbar for same application launched from 2 different locations

I have an application with FinderSync extension support.
I want to achieve silent update for this application. The only approach that I came up with at this moment, is installing the new version of the app into ~/Library/Application Support/../..., and whenever clicks the app from /Applications, redirect the user to Application Support one.
That means I will end up with two versions for the same app. One in /Applications and the other one in Application Support.
I have some issues after launching the application from both above locations.
If the user first starts the App from /Applications, selects Keep in dock, closes the app, updates the app by copying the new app to App Support and after that starts the app from App Support, I will end up with two dock icons.
Whenever I start the application, the FinderSync extension is automatically installed by the OS. It can be viewed in System Preferences->Extensions. Once the user quits the app and deletes the bundle, the OS automatically deletes the extension, so is no longer available in Extensions pref pane. However if I opened the application from both above locations, deleting the app from /Applications does not remove entirely the FinderSync extension from Extensions pref pane. Only after I remove the second application(the one from App Support), the FinderSync extension is removed from Extensions pref pane.
Are there any ways to overcome the above issues?
Please note that I have another question posted on a similar topic, while attempting to get rid of the above behavior using another technique, but I gave up using that approach a while ago:
OSX two dock icons for same application
Thanks

How to Distribute OS X application Update which is distributed outside the Mac App Store

I would like to know which is the best way to distribute a Mac App's Update to my existing app users.
App is distribute out side the Mac App Store so can not use the app store to distribute the update
I would like to do similar to VyprVPN like Download the new version close the app install new version and relaunch the app and this whole thing done without any user interaction.
I want to do like, Application Installed on my user's Mac now I release new version of my Application then how can I update Application already installed ( Previous Version ) in my user's Mac.
Edits:
I tried to Implement the Sparkle Framework for app update features.
But when i try to update my app I receive the PopUp saying new version of application is available but when I tried to install the new version error occurs saying UPDATE Error An error occurred while downloading the update. Please try again later.
Now I could not find reason of this behaviour. Can any one help me in this?
Thanks in advance
You can build the Sparkle framework into your app, and then your app can discover and install future updates.

iOS Application update with one Localization language removed

I'm working about one application for iOS. Application is already on App Store. But in new version, I have to remove one from Localization languages (Germany). After this, i observed very strange behaviors: When i deploy application on my phone without old version previous application, then everything is okay - if i has iOS set to Germany, application is in English. But when i deploy it when old version is already installed, then application does not show English translation, but only keys form unexisting Germany version ("terms_header" and so...).
My question is: How application will behave, when i send new version to App Store, and users will updates their phones to new version of my application?
When you update the application on any iOS device, it's bundle resources always get updated. However you can test the scenario using
- Install old application from xcode with localization
- Test if localization is working properly
- Update application with new build from xcode
- Re-test the application by changing language.
During updates only user generated data stay intact and bundle resources get updated.
What happens if you remove the application from the organiser and then reinstall it?
Ok, i found it. There is the way to check, how application will behave when is updatet from App Store:
Remove application from device
Generate Archive from old version of your app via Xcode (Product->Archive)
Distribute archived application as Ad-Hoc Deployment
Repeat points 2 and 3. for NEW version off your application.
Put .ipa file with old version of your app into iTune.
Install it on you device via iTune and synchronize device.
Check old version of application on you device.
Put .ipa file with new version of your app into iTune.
Press "Update" in iTunes, and synchronize device.
Check new version of application on your device.
In this case, my application is works.

Strange Issue: Application does not show in Main Menu after installation

I am developing an application for Symbian S60 V3. The application can be run properly on Simulator on PC. It can be transferred to Phone. On Phone, it can be clicked to installed. But after installation, I cannot find the installed application for running. It just disappear.
Is there any hint ?
Did you create the application with user interface? If it's just some bacjground process without icon and GUI then it won't be visible.
Did you check under Applications link (or Installed or whatever it is called in different systems).
Do you see your app listed in Settings -> Application Manager?