-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Application updates #66
Comments
Potentially useful pieces:
|
I don't have any concrete steps to reproduce this, but I have seen examples where running a new version of the installer on top of an existing installation does not work correctly, whilst a clean installation does. On both occasions, the updated installer has contained a newer version of |
If the application updates itself and adds new files, will uninstalling still remove all of the files? |
@prc33 that sounds like it's not compiling the .pyc files correctly. I can imagine that may be the case if the timestamps of the .pyc files (from when it was first installed) are newer than the timestamps of the new .py files. @Siecje yes, I think so. The new install will rewrite the uninstaller. If the new version has fewer files, then it's possible for the files that were only in the earlier version to be missed on uninstall. But Pynsist mostly tries to remove entire directories to minimise that problem. |
I meant without using a new installer, just replacing and adding files in the install directory. But it sounds like it just deletes the install directory so it shouldn't be a problem. |
It will be OK for files in subdirectories, like the packages. It may cause
a problem if it adds files in the top level directory. The guidelines for
writing uninstallers with NSIS said that it's discouraged to just remove
everything in the installation directory, in case the user has installed
multiple things in one directory. So it removes the specific files it
places in the install directory.
…On 16 January 2017 at 13:28, Cody Scott ***@***.***> wrote:
I meant without using a new installer, just replacing and adding files in
the install directory. But it sounds like it just deletes the install
directory so it shouldn't be a problem.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#66 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAUA9Yc458ptzChTOnPd4Kn4P-l-JBu_ks5rS3CHgaJpZM4Inl6v>
.
|
I actually like this behaviour because my app writes a .conf file in the install directory. It allows to preserve the configuration across updates. |
In general, it's probably not advisable to write config in your application directory. If a user installs it systemwide ('for all users'), the application may not be able to write files in its install directory. There are other places you can store config. See the Note here: https://pynsist.readthedocs.io/en/latest/faq.html#using-data-files |
That's the reason why I created a custom .nsi file wich install my app in C:\MyApp. I wanted it systemwide with the ability for my users to write in. |
Why not save config and user created data elsewhere? There are folders for these purposes already, like |
You're right, just moved my configuration to |
Yes, this case is important. For example, if an application discovers its submodules (e.g. Django automatically loads Fun fact: pip had a similar bug a few years ago. |
+1 for this. It's much better than nothing, and a good starting point! There could be an entry for this in the config file:
or something similar. |
I've been working on rewriting our project's Windows installer build config and came accross this issue which we've been working around with custom logic that overwrites files with empty content, which is far from ideal, so I was checking whether the issue has been fixed so I don't have to re-implement this ugly workaround. Apparently the issue is still not resolved. According to the linked issues / pull requests on this thread, the certbot repo has applied a fix for that issue in this pull request: This change adds RMDir /r "$INSTDIR\pkgs" at the start of the This means that one of these three solutions need be implemented here in order to fix the issue for everyone:
@takluyver Could you please give me your opinion on this before I open a PR? |
Thanks for the information. :-) I'm least keen on option 2 (adding a config parameter). Between 1 and 3, I'm less sure - I might go for 3, as this is the same command run by the uninstaller, and doesn't seem to have caused any problems yet. I seem to remember reading somewhere that your uninstaller shouldn't just delete I guess it's worth noting that removing |
I should probably add that I don't have much time to spend on Pynsist these days, and I'm not currently using it myself. I haven't abandoned it, but so far as possible it's ticking over in a fairly low maintenance mode. |
The correct behavior would be capturing a list of all files written by the installer and deleting each file and directory explicitly in the uninstaller in reverse (which is what a package manager on sane OSes would do). Recursive deletion is dangerous when done on the root install dir. I've already done this mistake in the past in a different non-pynsist NSIS build script and caused one of my users to nuke their entire programs dir, because they changed the install location and didn't install it in a separate directory, which is what I didn't think about. For the Regarding additional files written by the installer, this can probably only be fixed by running the (previously created) uninstaller with an explicit files+dirs list, as just mentioned. But since I'm not affected by this issue, my solution here only focuses on the pkgs subdir, which causes issues when python modules get loaded dynamically, hence why we need to overwrite certain files with empty content in our case. I would prefer adding a simple template block for now and letting pynsist users override/extend it themselves. Then they can decide themselves if they want a recursive delete command in their installer. Would that be okay? |
That's fine. 🙂 |
I've mostly ignored the question of updating applications. Running a new version of the installer will presumably overwrite existing files and update existing folders, so it should mostly work, although old files will not be removed. At a minimum, we should investigate and check this behaviour.
Another super simple approach would be to look for an existing uninstall.exe and run that from the installer before installing a new version; this is not very efficient.
There are more advanced possibilities like delivering patch updates, but I doubt that's worth the added complexity at the moment.
Should Pynsist also provide any support for 'check for updates' features inside applications?
The text was updated successfully, but these errors were encountered: