'Using electron-builder, during the install of an app, is there a way to auto-create a folder in the user's "Documents" folder in Windows?

What am I trying to do?

When installing an Electron application on a Windows machine, I would like it to also put a folder in a user's "Documents" area, for example a folder called "Guides". The way I suspect the address of where to put it would be "C:\Users{some-user}\Documents".

What is the code that currently tries to do that?

package.json

{
  ...
  "build": {
    "extraFiles": [
      {
        "from": "./Guides",
        "to": "C:\Users\{some-user}\Documents"
        "filter": [
          "./Guides"
        ]
      }
    ],
  }
  ...
}

What do I expect the result to be?

To have the "Guides" folder in the "Documents" folder.

What is the actual result?

Does nothing from what I can tell.

What I think the problem could be?

I'm not sure if electron-builder even has the authority to create a directory like so into a user's Documents. If there a solution, I was wondering how it would be done so it's adaptive to any user, not a hard-coded user variable.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source