PDA

View Full Version : Package Maker with Post Install Script




xmax
Mar 16, 2009, 05:56 AM
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.



iSee
Mar 16, 2009, 06:41 AM
You want to delete the files in the user's home directory on install?!?!

What would be the legitimate purpose of that?

xmax
Mar 16, 2009, 06:46 AM
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.

xmax
Mar 16, 2009, 08:46 AM
Its giving me following error while installing:

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.'.

iSee
Mar 16, 2009, 04:58 PM
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?

xmax
Mar 16, 2009, 11:26 PM
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,

luckystar09
Aug 20, 2009, 02:04 AM
I'm very interested! I would love to find out more.
script install (http://globolstaff.com/)

chaithrika
Oct 20, 2010, 07:26 AM
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.

DESNOS
Aug 29, 2011, 12:00 AM
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).

larkost
Aug 29, 2011, 01:25 AM
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).