hi everyone I'm actually a newbie in programming for a mac. I've currently done something and just wanna make an installer(yes, I know about the "Drag&Drop" installation, but this isn't applicable for my apps since during the installation there're some script jobs needs to be done).
I knew that the installer can run scripts(referred as "postflight" etc in the documentation), but I simply can't make it run successfully after several failures.
several questions here:
1.How to make a text file a script file?
I've written a bash script, and saved it as test.sh, and chmod +x test.sh, and I can run it under Terminal, but under the finder it was described as a text file, instead of "Unix Executable".
2.How to make the script run after the installer copying files to the destination?
There's nothing about this in the documentation provided by apple. I've tried to name the script file as "postflight" and "preflight"(just as the samples in the documentation), but no luck at all. When I named it as "postflight", the installer turned out to be failed after its file copy. I can see nothing but "Can't run the script" in the install log.
3.My script include something that request administrator privilege, how to do that?
I've checked the "Require administrator privilege" checkbox in the installer wizard, but it didn't prompted me to enter my password during my tests. Is that because my script didn't run?
How to make my script run with administrator privilege? Do I have to write something like "sudo ****" instead of the original commands?
Thanks everyone!
I knew that the installer can run scripts(referred as "postflight" etc in the documentation), but I simply can't make it run successfully after several failures.
several questions here:
1.How to make a text file a script file?
I've written a bash script, and saved it as test.sh, and chmod +x test.sh, and I can run it under Terminal, but under the finder it was described as a text file, instead of "Unix Executable".
2.How to make the script run after the installer copying files to the destination?
There's nothing about this in the documentation provided by apple. I've tried to name the script file as "postflight" and "preflight"(just as the samples in the documentation), but no luck at all. When I named it as "postflight", the installer turned out to be failed after its file copy. I can see nothing but "Can't run the script" in the install log.
3.My script include something that request administrator privilege, how to do that?
I've checked the "Require administrator privilege" checkbox in the installer wizard, but it didn't prompted me to enter my password during my tests. Is that because my script didn't run?
How to make my script run with administrator privilege? Do I have to write something like "sudo ****" instead of the original commands?
Thanks everyone!