nw.js
nw.js copied to clipboard
Setting --user-data-dir to custom location still causes AppData folder to be created
NWJS Version : 0.27.1 Operating System : Windows 10
Expected behavior
If user-data-dir is set to a custom location, no folder should be created in AppData\Local%appname%
Actual behavior
Empty folders are created in AppData\Local%appname%. Specifically a User Data and a User Data\CrashPad folder are created
How to reproduce
- Create a simple app with NWJS and then set the --user-data-dir to a custom location.
- Run the app
- Close the app
- Check AppData\Local%appname% to see if a folder exists
I can reproduce this issue on Linux/Windows with nwjs-sdk-v0.27.1.
Is this bug fixed yet? nw.js version 0.31.4 still has this problem, that's annoying.
By the way, nw.exe --user-data-dir=%APPDATA%\myapp
works well with cmd.exe
, but "chromium-args":"--user-data-dir=%APPDATA%\\myapp"
in the package.json
didnt work.
It just creates a folder named %APPDATA% in the current directory but not converts to system path, is that a bug or I'm using it in a wrong way?
I would like to add a [Feature Request] to simply not write the app_name (where app_name is the name field value in the package.json) not only from the \Local\AppData location, but do not write it anywhere if possible.
Here is a thread on the Google Group explaining more details with Roger: https://groups.google.com/forum/#!topic/nwjs-general/bQdFZEVXcBs
Is this bug fixed yet? nw.js version 0.31.4 still has this problem, that's annoying. By the way,
nw.exe --user-data-dir=%APPDATA%\myapp
works well withcmd.exe
, but"chromium-args":"--user-data-dir=%APPDATA%\\myapp"
in thepackage.json
didnt work. It just creates a folder named %APPDATA% in the current directory but not converts to system path, is that a bug or I'm using it in a wrong way?
I'm having the same issue. The environment variables aren't being expanded, but are being used as literals. nwjs:0.32.4
@rogerwang is there a plan to fix this? Or at least offer an nwjs api/setting to use %APPDATA% rather than %LOCALAPPDATA% which is the default now. This bug makes it impossible to have the user-data-dir in each users roaming folder.
Version: 0.45.5
{
"name": "test",
"version": "0.0.1",
"main": "app.js"
"chromium-args": [
"--user-data-dir=./data"
]
}
Does not work for me.
@rogerwang here is a pull request that fixes this issue. https://github.com/nwjs/nw.js/pull/7477 . At Mitel we use nwjs for our UC client and need to have local storage in the roaming folder (%APPDATA%) rather than %LOCALAPPDATA%. Please have a look.
Has this issue been fixed? From the PR it looks like it's all done.
I just tested this out and it's still broken. @rogerwang This is a P3 issue, would you mind fixing it if you got the time to?
My steps to reproduce (sample: package.zip):
- Run blank app (includes "--user-data-dir=test")
- Close running app
- Notice "test" folder being created as expected
- Notice "UserdirTEST" folder also being created, despite using custom path [C:\Users\YOURNAMEHERE\AppData\Local\UserdirTEST]
@TheRealDannyyy yes its working really well ;). Be careful to use single quotes to handle paths with spaces. Here is an example with single quotes in two places. "chromium-args": "--user-data-dir='%APPDATA%'\TheProduct\'User Data'"
@mkilburn60 Based on my test case it doesn't. It seems like crashpad is causing a userdir to be created inside the appdata folder.
@TheRealDannyyy note you two backslash for each of the path separators but this page removes one when it renders.
@TheRealDannyyy thats true - crash dumps still go to the default.
@TheRealDannyyy I'm guessing the same fix would need to be applied to --crash-dumps-dir
@TheRealDannyyy the expansion is applied to the whole command line so try setting --crash-dumps-dir to %APPDATA%
Hi guys, is the problem still not solved? when installing our application, a folder like nw_817_813871837 (numbers may vary) is created in c:/Program Files, it is empty. If you turn off (close) the application this folder disappears. If you uninstall and reinstall the folder is not created. If you install another version of the application, the folder appears again. Sometimes it is not deleted after closing. Windows defender reacts to all this. Very much need help, in our application windows defender plays a big role