Build your own iPhone Installer software source

Source: Internet
Author: User

Build for yourselfIPhone Installer software sourceThis document describes how to install a third-party software developed using the open-source SDK on the Jailbreak iPhone. Almost allIPhoneOr iPod Touch is installed.InstallerProgram, a bit similar to the apt tool on linux, you can directly accessSoftware SourceDownload and install third-party software.

This article briefly introduces how to build your ownIPhone Installer software sourceIn this way, you canIPhoneThe software is released so that users can install it directly. You only need to know a little about php and how to edit xml files in a text editor.

The iPhone mentioned below also applies to iPod Touch.

Preparations:

First, you need a web space or web server that supports php. Of course, you can test apache on your computer.

Next, download this example:

Http://iphone.nullriver.com/beta/demo.zip

Decompress the package. There are two files and two directories.

Index. php

This php basically does not need to be edited. It can be placed on your webserver as the homepage.

Repository. plist

This file is to be modified and is in the standard plist format. You can directly open it in a text editor.

You can modify the following content:

<Dict>
<Key> name </key>
<String> [name of your own installer source] </string>
<Key> maintainer </key>
<String> [Your name] </string>
<Key> contact </key>
<String> [your email address] </string>
<Key> url </key>
<String> [software source address] </string>
<Key> category </key>
<String> [category] </string>
</Dict>
Plists/

This directory stores the information about the software you are about to provide in the source. plists can contain multiple categories and arrange them by directory. A. plist file contains a software. Each category can have multiple. plist files.

Three. plist examples are provided in the directory. You can refer to their syntax. If you do not need these examples, move them directly to another directory. You can create a file containing the software information. plist.

Here, the. plist file mainly describes the software and defines the script before, after, during, update, and uninstall the software. In this way, the Installer in the iPhone can customize and install the content in the zip package provided in the software source based on these. plist files.

Here we will introduce the usage of each key in the. plist file, so that you can create a. plist file for your software:

BundleIdentifier must be a key value, which is a unique software package description. Once you specify this key, do not modify it in future software updates. Otherwise, the software may be confused. The naming method is similar to the java domain method. For example, if your software is called myapp, you can call your software com. mycompany. iphone. myapp.

Name must be a key value. This name will be displayed in the Installer list. For example, you can write "my software ".

Version must be a key value. version number. Currently, Installer can only install one unique version of a specific software. For example, you can write 1.0.

Location must be a key value and the installation location. It is used to specify the. ZIP file location of the software. If you want to install the execution file, you must retain the File Execution permission, such as 0755, during zip file compression. For example, you can write http://iphone.mycompany.com/zips/myapp.zip

Size must be a key value. The size of the zip file. This value must be exactly the same as your zip file; otherwise, the Installer will not install it to prevent damage to the iPhone.

Url can be a key value, more information link .. If the address is included in the plist file, you can click More Info in the Installer to directly point to this address. For example, you can write http://iphone.mycompany.com/myapp/info.html

Description: Optional key value. Software description. Be sure not to write too long.

You can select a key value for maintainer, which is the name of a third-party maintenance personnel. If the software is yours, you don't need to write this.

You can select a key value for contact and contact information of third-party maintenance personnel. If the software is yours, you do not need to write it.

RestartInstaller can be set to a key value. Do you need to restart it after installation?InstallerNote not to restartIPhone). This key value is set to true, after installationInstallerWill automatically restart.

Scripts must have a key value and a script for installation. This key value includes the following items:

You can select a key value for preflight to install or update the script that was previously executed. However, this script is not executed before the software is deleted. This key value is mainly used to check whether the software can be installed.

The install script must be a key value. You need to set this script to install the software on the iPhone.

You can select a key value for update to update the script. If the software needs to be upgraded, you can define the upgrade script in this key value. This script can be used for larger software only when upgrading some key programs or data. If this key value is not defined, the Installer will automatically overwrite the old version of the software using the installation script in install.

Postflight can be used to select the key value and the script executed after installation or update. However, this script is not executed after the software is deleted.

Uninstall: Optional key values, Software uninstall script. Although it is optional, it is strongly recommended that you define this part of the script. Otherwise, the Installer will not display the uninstall option, which means that your software cannot be correctly uninstalled.
Note: The script-related key values are displayed in arrays. Array Syntax:

CommandName parameter 1 parameter 2

CommandName is used to execute commands. It can contain any number of parameters and can even be nested. If the Installer executes an unrecognized command, it will exit the installation and notify the user. </P>

Commonly used commandnames include:

> CopyPath & nbsp;

Copy a file

Contains two parameters: the source file and the target file. It can be a file or a directory. If it is a directory,InstallerAll subdirectories under it are copied.

If the source file is not specified as an absolute path /),InstallerThe file will be considered in the zip package. If/is specified before the absolute path /),InstallerThe path isIPhone.

The path of the target file must be an absolute path. If you want to copy a directory, do not include a file name.

Example:

<Pre lang = "xml">
<Array>
<String> CopyPath </string>
<String> Launcher. app </string>
<String>/Applications/Launcher. app </string>
</Array>

The entire folder of Launcher. app in the zip package will be copiedIPhoneIn the/Applications/Launcher. app folder.

RemovePath

Delete an object.

Contains a parameter, that is, the file or directory to be deleted. To delete multiple files or directories, create multiple RemovePath commands.

Conclusion: build your ownIPhone Installer software sourceI hope this article will help you!

From: http://www.cocoachina.com/iphonedev/toolthain/2009/0611/208.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.