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

thriii

macrumors 6502
Original poster
Hopefully there is an answer to this..

I replaced a file inside of the contents of an application and I was wondering if there is a way I could lock the file or somethin so it never gets replaced.. is this possible in any way? if not.. what else can I do to make sure the file works after updates?
 
why o why do i feel this is dealing with piracy?

call me a skeptic

what exactly are you worried about replacing op?
 
Depends on what you mean by "never." From Finder, select file > Get Info > checkbox for Locked. That should be a reasonable effect. Admin will always be able to replace if desired, there's no getting around that.
 
You are really not giving details, and all the important information is in the details. But you might want to take a look at the man page for 'chflags'. There are both the 'uchange' and the 'schange' flags that might do what you want to do.
 
i laughed at the replies 😛 this doesnt have to deal with piracy at all.. I have 1Password and if you have it you know that it places an Icon which is usually "1P" in your browser bar by the back/forward buttons. it does this by putting a file in the firefox applications folder telling it to get the button image from inside the 1Password contents folder.. So I modded the Icon so it matches my firefox theme (just gotta figure out how to move the button down!)
screenshot01d.jpg


I just dont want the png file for the button to be replaced if I upgrade 1password

So as you can see! no piracy! 🙂
 
I suppose you can change the permissions to the file to read only, and that may "protect" it.
 
I just dont want the png file for the button to be replaced if I upgrade 1password

The lock suggestion I gave may help, but something you want to think about is that if the updater cannot copy in a new file it could cause an error and break 1Password.
 
i laughed at the replies 😛 this doesnt have to deal with piracy at all..

As you can see from this thread, it helps if you fully describe what your problem is and what you're trying to accomplish. That way, you'll get more useful replies.
 
There is one reason why someone may change a file in a package. 1Password does not support Camino 2 at this time. Thus we have to change a plist file for supported browsers. This is an official "hack" for 1Password to get Camino 2 to work. Nothing illegal about it. And it would be annoying to have to replace that change should 1Password do an update and over-write that file.

If a file is part of a package (single file application), I'm not sure you can prevent it from being replaced. The best bet is to create a folder mimicking the structure of the package and put a copy of the edited file there so it can be easily replaced as needed.
 
As you can see from this thread, it helps if you fully describe what your problem is and what you're trying to accomplish. That way, you'll get more useful replies.

As you can see from this thread, it helps if you don't jump to conclusions and just give people the benefit of the doubt. That way you don't waste your time falsely accusing people.
 
sudo chflags schg name_of_file.png

Is the daddy of file locking. Set this and not even root can remove the file. It is system immutable...

If you do want to remove afterward, boot your mac into single user mode with command+s. cd to the relevant directory and enter:

chflags noschg name_of_file.png

No one can say if a 1Password update will fail if it tries to update the file. A case of try and see, and if it does you can unset the flag and make a backup copy of the image. to re-apply after.

Job as they say is a good un. 🙂
 
As you can see from this thread, it helps if you don't jump to conclusions and just give people the benefit of the doubt. That way you don't waste your time falsely accusing people.

I didn't jump to any conclusions. Nor did I make any assumptions about or accuse anyone of anything. Reading comprehension is a good thing! You should try it!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.