Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

xmax

macrumors member
Original poster
Jul 3, 2008
33
0
Hello,
I have written one script to delete the files from Users home directory if exist.
And I have added that script to post-Install script when i am making package for my application.
The Application is not installing and i am getting error "Installation failed".
And if I removed the part of Post-installation script and I again installed application. It installed successfully. but i was not able to see my application in destination directory.

Now I am not able to install any package made by me.
I am always getting one warning that is ".app is word writable".how can i resolve this warning.
So, what do i need to take care while setting post installation scripts ?


And If there exist my application in applications directory and i want to uninstall that application then what is the procedure to make uninstaller?




Thanks.
 
You want to delete the files in the user's home directory on install?!?!

What would be the legitimate purpose of that?
 
oh,
I just missed to mention.
The file that is stored as com.mycompany.product name from Preferences.
And One directory named as product name stored in Library/Application Support folder.

That is the purpose only.



Thanks.
 
Its giving me following error while installing:

Code:
Mar 16 19:12:05 pc-00075 /private/tmp/scripts.97LF/./postinstall[2155]: /private/tmp/scripts.97LF/__Installer_Script_Springboard__: line 13: /private/tmp/scripts.97LF/./postinstall: cannot execute binary file
Mar 16 19:12:05 pc-00075 Installer[2145]: Install failed: The following install step failed: run postupgrade script for emptyapp. Contact the software manufacturer for assistance.
Mar 16 19:12:05 pc-00075 Installer[2145]: Displaying 'Install Failed' UI.
Mar 16 19:12:05 pc-00075 Installer[2145]: 'Install Failed' UI displayed message:'The following install step failed: run postupgrade script for emptyapp. Contact the software manufacturer for assistance.'.
 
Is the execute bit set on the script? And are the permissions correct?
Also, can you post the script itself, or at least the first few lines?
 
I research on it and i came to know that i need to make Postflight Scripts.
I don't understand how to make it and include in package maker.


Thanks,
 
Re: Package Maker with Post Install Script

I too had the need for deleting a temp folder (after the installation) created by me in user's home directory. I used shell script to do "rm -rf" and set it as postinstall script in package maker. I kept getting the error for installation failure.

I changed the script to perl and run "rm -rf" with the function system() and set it as postinstall script in package maker. It solved my problem. :)
I still do not know why did shell script not work.
 
Just so people know in the future, the two main reasons I see people's scripts not working is because they either forgot to include the all-important "#!/bin/sh" (chaithrika's problem I believe) or equivalent, or the execute bit isn't set via "chmod +x script.sh" (OP's problem).
 
As a long-term sys-admin I can say with some authority that almost every time you need to do something like this it is because you are wrongly trying to cover up mistakes made in other parts of software development in the installer. This is almost always a bad move, and will just lead to more problem.

If you installer needs to clean up temporary items created durring install, then you are doing the install wrong, and need to re-evaluate the situation that got you to that point. Trying to hack your way out of it is the wrong approach, and will just cause massive problem later.

My position is that only sys-admins should create installers that have install scripts. That is people directly responsible for the computers that will run the installers should ever do this. That is because those are the same people who are going to be accountable for cleaning up the mess when it goes wrong (and it will).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.