Liked what you read? Please subscribe for more technical updates, so you won't miss any nice tips or tricks I have to share with you. =)

Subscribe in a reader

March 20, 2008

Fix "Main Script Execution Failed"

I had to restore my iPod Touch twice, but I couldn't figure out the main problem.

However, there is a script lying around that allows you to fix your "Main Script Execution Failed" while trying to download any packages off in the Installer.

If you have wifi, you're in luck. If you're using a wifi hotspot (like me!) then it depends on your luck.

For my case (since I'm a non-wifi user), here's what I did until I hit the error:
- DFU Mode
- Restored into 1.1.4
- Jailbreak using ZiPhone
- Now I go look for a wifi hotspot... Found!
- I fix the "keyboard freezing" by going to contacts and entering some rubbish, then exiting it
- I added sources in the Installer app, the keyboard doesn't freeze! Yey!
- Download BSD Subsystem and Term-vt100 (plus other things not worth mentioning, but missed out quite a lot of things too!)
- Went home
- Synced some songs
- *the next day* Went to hotspot again, because it seems I can't use Term-vt100. Asks for a stupid password! So after some research, it looks like I need to install "Term-vt100 SUID Fix"
- Huh? Main Script Execution Failed? I just download 50 apps yesterday with no problems!

So I guess, I'm out of luck. Since I have no wifi, and my Terminal app is not working, I have no choice but to do a complete restore and try all over again.

I have a working wifi!

Now, if I had wifi, or I had a working terminal app (Term-vt100 or TerminalV should be good), I can issue these commands (you can use this using Putty via WinSCP):

cd /
cd Applications/
wget http://repository.apptapp.com/packages/System/Installer.zip
rm -rf Installer.app
unzip Installer.zip
chmod +s Installer.app/Installer
chown -R root:wheel Installer.app

Now, if everything is working fine, and there's no problems with the Installer, issue this last command:
rm Installer.zip

But I don't have wifi?

Now, if you don't have wifi (like me!), you can still issue these. Only you'll need to do an additional step.

Prerequisite: You must have already installed "ZiPhone iBrickr Fix", "Term SUID Lib Fix", and any terminal app like "Term-vt100" or "TerminalV", if not, you definitely need a working wifi and follow the previous step.

Step 1: Download and install iphonebrowser (google it, I'm sure it's the first one)

Step 2: Using your normal browser, download the Installer file from this site http://repository.apptapp.com/packages/System/Installer.zip

Step 3: Unzip it, and you should have a folder named "Installer.app"

Step 4: Now launch iphonebrowser, then delete /Applications/Installer.app from your device

Step 5: Now, copy the newly unzipped Installer.app into /Applications folder

Step 6: Now launch Term-vt100 (or TerminalV) on your iPhone and type in:
chmod -R 777 /Applications/*

That's all! Now you should reboot your iPhone, and try again. If it works, good for you! If it doesn't, then type this (after the above methods fails, this step might not be necessary):
chmod +s /Applications/Installer.app/Installer
chown -R root:wheel /Applications/Installer.app

This, effectively re-installs Installer app with another version, and setting all the permissions and owners respectively.

Now, that solved MY problem.

Cydia anyone?

Update: Added instructions for using only the iPhone without wifi.
Update: Updated instructions, based on a friendly user feedback. Thanks!

6 comments:

Frederick said...

Yusry,

Since I have problem with the wget command in putty. I had to use your non wifi way. After I installed the new installer.app, it did fix the main script error. Although, I have to reset my permission to 777 before it can launch. May be you want to add that info in your post. Thanks for the clear instruction.

One thing you still haven't saying how to resolve the missing wget problem.

Yusry said...

Thanks for the comment.

I found out that you can install "wget package" via Installer.app.

But that defeats this whole tutorial, because you would be having the Installer problem by the time you tried to install wget from Installer.

Anyway, thanks for telling me to change my permissions after that. I must have missed that imporant info out.

Cheers.

Frederick said...

You know what? After I apply your step to my iphone. I just found out that I am getting the main script error again. Although I am getting the script error when install psx4iphone, but I am not able to install any thing else. Every time when I try to install any app, I will get the main script error. Do you know how to revert back to my old installer app? At lease my old one works better.

Yusry said...

I doubt you could get back to the old Installer app. However, you should update the new installer app with the link I provided here. The main script error has something to do with some bugs, which I'm not sure if the developers are working on it.

Just re-do this whole step (described in the post) to install a new Installer app. After that, make sure you change the permissions to it, and everything should be fine.

Frederick said...

yusry,

I have fixed the porblem. But here is what I did.

1. unzip the installer.app.
2. Copy over to \Applications\
3. Type in: chmod -R 777 /Applications/*

That did the trick. No main script error and able to install as well. :)

Yusry said...

Thanks for sharing! I'll try to edit my post to make it more friendly.

Yusry is a technology freak, he plays a lot with his iPod Touch since day 1. He is also into programming and gets excited trying out new softwares. He is also a member of a local Singaporean band named Dermapthera. You can read his other blog at http://dermapthera.wordpress.com