-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
files are deleted after update #2181
Comments
@ricaralan do not store your db into your application folder ! This is a bad practice. Use by example the path given by |
@popod thanks for your comment that is right and fortunately I could solve it yesterday and yes. It is very bad I'll leave the stackoverflow link where there is also the solution plus my configuration code and again thanks https://stackoverflow.com/questions/46677957/auto-update-files-are-deleted-after-auto-update |
Hi, i'm surprised by this response. The nsis installer doesn't delete all file in the install folder, so why does the update do that ? Is it a possibility to desactivate this behavior ? Or maybe list some 'conf' file like in a the Debian manifest file ? Thanks for any advise. |
Application dir must be immutable due to security reasons. |
ok, you're right. I will change my code. But just to know is nsis or electron builder ? |
NSIS allows you to do whatever you want. It is electron-builder behaviour to ensure security. |
This behavior is extremely annoying for my use case. I am developing the launcher for a game, so it downloads multiple gigabytes of files. I can't dump that much data into the AppData folder when the user specifically selected the install location to be somewhere else, such as a completely different (less full) drive. It seems my only option would be to bundle the game and launcher together, but that creates a huge installer instead of the ~40MB one that is currently created. I don't want to use the web installer either as then it would be using that interface to download the game rather than the actual launcher. Is there any other way to disable or get around it? Or at least explain what security concerns this causes. I don't understand what the issue is with being access its own folder... |
I know that this is an old issue but took us a day from finding this thread to actually find the solution that was implemented 24 Feb 2017 - #1300 |
Hi, I know this is very old and there is a solution to it. However, I still have an issue... Every time my app updates and if the user has installed it in a custom folder ("allowToChangeInstallationDirectory" is set to true), it will download everything inside that folder. To illustrate, suppose I have an app called "MyApp" and I install it in "C:/CustomFolder". When it gets updated, if the parent folder is not named "MyApp" (which is "CustomFolder" here), it will create a new folder "C:/CustomFolder/MyApp" and then it downloads everything there. It does work properly if the folder name is the same as productName set in package.json. Here's what I have in my package.json:build And in my installer.nsh I am developing a launcher for a game as well, trying to achieve:
Any suggestions? |
I'm trying to achieve this too. How can I use |
If you want to keep certain folders when updating an Electron app, you can use the asarUnpack field in the app's package.json file. The asarUnpack field specifies a list of glob patterns that match the files and directories that should be unpacked when the app is packaged as an ASAR (Atom Shell Archive). For example, to keep the assets and node_modules directories when updating the app, you can add the following lines to the package.json file:
This will cause the assets and node_modules directories to be extracted to a separate folder when the app is packaged, and they will not be overwritten when the app is updated. Note that the asarUnpack field is only used when packaging the app as an ASAR. If you are not using ASAR packaging, you can use a different approach to preserve certain directories during updates. |
Hello everyone I build the installer with nsis ia32 arch, I use sqlite3 and everything works fine until the update is downloaded since it replaces all the files in the installation folder.
Then my database file is deleted, how can I prevent my database file from being deleted with the new versions?
electron-builder v19.33.0
electron-updater v2.10.1
thanks o/
The text was updated successfully, but these errors were encountered: