【electron-updater】How to get update cache directory
See original GitHub issue- Version: ^22.9.1
- Electron Version: 11.1.1
- Electron-updater Version: 4.3.5
- Target: windows
I want to get the cache path before updating, Some people see others get it in this way
import { autoUpdater } from 'electron-updater'
autoUpdater.app.baseCachePath,
And then I saw a error
The property "app" is protected and can only be accessed in class "AppUpdater" and its subclasses.
I went and looked at the type declaration
export interface AppAdapter {
readonly baseCachePath: string;
}
So how do I get it?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:7
Top Results From Across the Web
Auto Update - electron-builder
Install electron -updater as an app dependency. ... Auto update relies only on the first provider in the list (you can specify several...
Read more >Updating Applications | Electron
The easiest way to use this service is by installing update-electron-app, a Node.js module preconfigured for use with update.electronjs.org. Install the module ...
Read more >Updating electron's update server value with an app update
Directory for cached update will be cleaned Download block maps ... to C:\Users\USERNAME\AppData\Local\APPNAME-updater\pending\update.exe.
Read more >CacheStorage - Web APIs | MDN
Provides a master directory of all the named caches that can be accessed by a ... Use CacheStorage.open() to obtain a Cache instance....
Read more >Electron-Differential-updater
Built on top of electron-updater. Differential Update for mac. Progress for differential update on mac/win. Cache location customization. Many Bug Fixes.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@idanwork This is how I solve my problem, but it is not an effective way.
In
AppUpdater.d.ts
, remove theprotected
ofapp
or useautoUpdater.app.baseCachePath
like thisautoUpdater[app].baseCachePath
. But I think this is unreasonable.Logically speaking, the app should be accessible by its class. I have also seen people using the app in other blogs.
Then I tried your way and it really works. But the cache paths of different platforms are different. This is more troublesome and you need to write them one by one.
Thank you, I can use this method first, this looks more reliable than modifying the type file
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.