packages
packages copied to clipboard
No way to "update if newer" on installed files / Rsync not respecting Timestamps from internal scripts
This problem is twofold
Currently, when you select and install your files it overwrites everything - there is no way to tell the installer only to update the files if they are newer than what is already installed.
To circumvent this problem i installed the files to a new location and used "RSYNC -rvc --update" on the files to copy them to the new location IF they are newer. This is where we hit the second problem - This command works perfectly fine in terminal - copies only the new files. However, including it as a postinstall script doesn't work at all - it copies all of the files no matter what. So confusing.
I've added sudo to the command and i've added -t aswell to copy timestamps but no luck - just copies and overwrites everything.
So this is either a feature request to add a "install if newer" flag or it's a bug fix request for running Rsync as a script inside the PKG as it ignores the timestamps on files.
The .pkg installation format only supports versioning based on the bundle and framework versions.
Are you trying to install some files only if there are not already on disk? Or is it really a newer criteria? If it's the first case, you may find this Q&A useful:
http://s.sudre.free.fr/Software/Packages/Q&A_9.html
Yes I’m trying to a) install a folder of files and b) update them, if they exist. but I don’t want them overwritten in every install.
I use NSIS on windows and this has an update if newer option I can just turn on at this stage.
Running the rsync as a script doesn’t seem to work as expected.
For now im having a bit of luck with moving all of the existing files to another location - installing the installer files overwriting everything, and then using rsync to copy if newer on top from the backups - this seems to have better luck with picking up the time stamps for some reason ..
I can't imagine how a sandboxed app would survive that workflow. As Stephen stated, you've got to replace the whole enchilada.
@donmontalvo as long as the binaries in the bundle and any new/removed resources are accounted for in the various CodeResources files then the signature would technically remain intact, its not pretty and could entirely result in a corrupt binary post-install if something failed unexpectedly (which is why its much safer to replace the binary in full). a company i worked at did incremental updaters in the described manner because some resource files were massive but never updated, but part of the bundle.
my package consists of a main binary file that gets installed every time - an audio plugin.
Accompanying it are preset / template files written to a shared user preset area. - these files are user-writable from within the audio plugin, so a user can update them.
When a user runs the installer i don't want to overwrite a preset that a user has updated - which is why i'm looking for an update only if newer ( for specific folders )
@rudyrichter not trying to be Debbie Downer, but curious why not just replace and avoid risk?
On the other hand, Microsoft provides much smaller "updates" through Microsoft Auto Update.
@rudyrichter not trying to be Debbie Downer, but curious why not just replace and avoid risk?
On the other hand, Microsoft provides much smaller "updates" through Microsoft Auto Update.
In that specific case the unchanged data files that were part of the binary were 400MB alone.
When you write "This command works perfectly fine in terminal - copies only the new files.", do you mean when you install the files using the installation package and run the script/command from the Terminal? Or does it work when you copy the files manually and then run the script/command from the Terminal?
If the first case works, it might be worth trying to use /usr/bin/su $USER -c instead of sudo in your post-installation script.
The rsync command run directly from Terminal on the users computer will perform an update if newer.
if I use the same command in a script inside the pkg it doesn’t work.
If I make a copy of the original files - install the new ones and then run the rsync command on the newly copied ones then it does work weirdly.
I’ll try your option above