Before a backup or restore operation can begin, the UI needs to know which drives are available and where the user wants to work. These four methods handle all drive enumeration and folder selection. Drive data comes from PowerShell’sDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Pachanga12/Kopia_Desk_Beta_1/llms.txt
Use this file to discover all available pages before exploring further.
Get-Volume cmdlet so it reflects the live state of the system; folder dialogs delegate to Electron’s native dialog.showOpenDialog so the user gets the standard Windows file picker.
listDrives()
Returns a list of every volume that has a drive letter, together with its label and space figures. The underlying PowerShell command is:
Promise<DriveInfo[]>
Drive root path, e.g.
"E:\\". Formed as DriveLetter + ":\\".Volume label from
FileSystemLabel. Empty string "" when the volume has no label.Bytes of free space (
SizeRemaining). 0 if PowerShell reports no value.Total volume capacity in bytes (
Size). 0 if PowerShell reports no value.true when this drive letter matches process.env.SystemDrive (e.g. "C:"). Used by the UI to visually distinguish the system drive from external targets.listDrives() returns []—never rejects—when PowerShell is unavailable or returns an error. Always check the array length before rendering drive selection UI.selectFolder()
Opens Electron’s native dialog.showOpenDialog configured for directory selection. The dialog title is "Seleccionar carpeta de origen". Returns the path the user chose, or null if the dialog was cancelled.
Parameters: none
Returns: Promise<string | null>
Absolute path to the selected directory (e.g.
"C:\\Users\\User\\Pictures"), or null when the user closes the dialog without choosing a folder.selectRestoreTarget()
Identical to selectFolder() except the dialog title is "Seleccionar carpeta destino para restaurar", making its purpose clear to the user when restoring files. Returns the path of the chosen destination folder, or null if cancelled.
Parameters: none
Returns: Promise<string | null>
Absolute path to the selected restore destination, or
null if the dialog was cancelled.Both
selectFolder() and selectRestoreTarget() use the openDirectory property of dialog.showOpenDialog—file selection is not possible through either method.quickFolders()
Returns the user’s standard Windows folders so the UI can offer one-click shortcuts instead of requiring navigation through the folder dialog. The method iterates a fixed list of Electron app.getPath keys and filters out any folder that does not actually exist on the current machine via fs.existsSync.
The full candidate list, in order:
app.getPath key | Display name |
|---|---|
pictures | Imágenes |
documents | Documentos |
downloads | Descargas |
music | Música |
videos | Videos |
desktop | Escritorio |
Promise<QuickFolder[]>
Human-readable display name in Spanish (e.g.
"Imágenes").Absolute path to the folder as returned by
app.getPath, e.g. "C:\\Users\\User\\Pictures".Folders that do not exist (e.g.
Music on a PC that has never had a Music directory) are silently omitted. If app.getPath throws for a given key, that entry is also skipped. The returned array can therefore be shorter than six items.