Skip to content
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

Windows app fails to get documents path at startup #1572

Open
3 of 4 tasks
dmnsea opened this issue Nov 29, 2024 · 5 comments
Open
3 of 4 tasks

Windows app fails to get documents path at startup #1572

dmnsea opened this issue Nov 29, 2024 · 5 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@dmnsea
Copy link

dmnsea commented Nov 29, 2024

Describe the bug.

I've tried all installation methods: for current user only, for all users, with both default and custom locations.

Each try finishes with:

An error occured during startup
Failed to get 'documents' path

Steps to reproduce:

  1. Install (for any user) v2.10.0 from https://github.com/klembot/twinejs/releases/download/2.10.0/Twine-2.10.0-Windows.exe
  2. Launch with shortcut from Desktop

Expected behavior:

Launched Twine window

Additional context on this problem.

I've launched in CLI mode as suggested at Twine troubleshooting / Won't start #Windows, and there's what i've got:

PS C:\Users\LocalUser> C:\Users\LocalUser\Desktop\Twine.lnk
PS C:\Users\LocalUser>
Couldn't read app prefs file; continuing Error: C:\Users\LocalUser\AppData\Roaming\Twine\app-prefs.json: ENOENT: no such file or directory, open 'C:\Users\LocalUser\AppData\Roaming\Twine\app-prefs.json'
    at Object.openSync (node:fs:601:3)
    at Object.func [as openSync] (node:electron/js2c/asar_bundle:2:2131)
    at Object.readFileSync (node:fs:469:35)
    at Object.readFileSync (node:electron/js2c/asar_bundle:2:9462)
    at readFileSync (C:\Users\LocalUser\AppData\Local\Programs\Twine\resources\app.asar\node_modules\jsonfile\index.js:50:22)
    at loadJsonFileSync (C:\Users\LocalUser\AppData\Local\Programs\Twine\resources\app.asar\electron-build\main\src\electron\main-process\json-file.js:22:40)
    at loadAppPrefs (C:\Users\LocalUser\AppData\Local\Programs\Twine\resources\app.asar\electron-build\main\src\electron\main-process\app-prefs.js:40:56)
    at Object.<anonymous> (C:\Users\LocalUser\AppData\Local\Programs\Twine\resources\app.asar\electron-build\main\src\electron\main-process\index.js:10:30)
    at Module._compile (node:internal/modules/cjs/loader:1271:14)
    at Object..js (node:internal/modules/cjs/loader:1326:10) {
  errno: -4058,
  syscall: 'open',
  code: 'ENOENT',
  path: 'C:\\Users\\LocalUser\\AppData\\Roaming\\Twine\\app-prefs.json'
}
App pref backupFolderPath set to undefined
App pref disableHardwareAcceleration set to undefined
App pref scratchFolderPath set to undefined
App pref scratchFileCleanupAge set to undefined
App pref storyLibraryFolderPath set to undefined
Initializing i18next without locale
Adding i18next translation resources
Getting locale preference
i18next::backendConnector: No backend was added via i18next.use. Will not load resources.
i18next: languageChanged en-us
i18next: initialized {
  debug: true,
  initImmediate: true,
  ns: [ 'translation' ],
  defaultNS: [ 'translation' ],
  fallbackLng: [ 'en-us' ],
  fallbackNS: false,
  whitelist: false,
  nonExplicitWhitelist: false,
  supportedLngs: false,
  nonExplicitSupportedLngs: false,
  load: 'currentOnly',
  preload: false,
  simplifyPluralSuffix: true,
  keySeparator: '.',
  nsSeparator: ':',
  pluralSeparator: '_',
  contextSeparator: '_',
  partialBundledLanguages: false,
  saveMissing: false,
  updateMissing: false,
  saveMissingTo: 'fallback',
  saveMissingPlurals: true,
  missingKeyHandler: false,
  missingInterpolationHandler: false,
  postProcess: false,
  postProcessPassResolved: false,
  returnNull: true,
  returnEmptyString: true,
  returnObjects: false,
  joinArrays: false,
  returnedObjectHandler: false,
  parseMissingKeyHandler: false,
  appendNamespaceToMissingKey: false,
  appendNamespaceToCIMode: false,
  overloadTranslationOptionHandler: [Function: handle],
  interpolation: { escapeValue: false },
  lng: 'en-us'
}
Preference couldn't be loaded, using default locale

PS C:\Users\LocalUser>

I've looked what's stored there at all and here's only "Local State" file:

PS C:\Users\LocalUser\AppData\Roaming> wsl tree Twine
Twine
└── Local State

0 directories, 1 file
PS C:\Users\LocalUser\AppData\Roaming>

P.S.: I've picked web build for temporarily usage unless desktop issue won't be solved

Twine version number

2.10.0

Does this problem occur with the web version of Twine or the desktop app?

Desktop app

What operating system does this problem occur on?

Windows

If this problem is occurring with the web version of Twine, what browser does it occur on?

None

Presubmission checklist

  • I am interested in working on code that would fix this bug. (This is not required to submit a bug report.)
  • I have done a search and believe that an issue does not already exist for this bug in the GitHub repository.
  • If this problem is occurring with the app version of Twine, it still happens after I remove the user.css file from my Twine folder. (You would've added this file yourself. If you don't understand this question, you can safely check this box.)
  • I have read and agree to abide by this project's Code of Conduct.
@dmnsea dmnsea added the bug Something isn't working label Nov 29, 2024
@greyelf
Copy link

greyelf commented Nov 29, 2024

@dmnsea
A couple of questions:

  • Which Version and Edition of Windows are you using?
  • Have you enabled Windows' "OneDrive Backup" feature?
  • Have you relocated your My Documents folder to another drive?

@dmnsea
Copy link
Author

dmnsea commented Nov 30, 2024

  • Windows 11 Pro, 22H2, Build 22621.2715
  • Windows Feature Experience Pack 1000.22677.1000.0 (if needed)

"OneDrive Backup" is disabled, documents folder returned back to %homePath%.

System language in windows is russian, so instead of %homePath%\Documents it's reachable by %homePath%\Документы (if this matters)

@klembot klembot changed the title Incorrect installation for Windows with Twine v2.10.0 Windows app fails to get documents path at startup Dec 8, 2024
@klembot
Copy link
Owner

klembot commented Dec 8, 2024

This is a tough one because I think it is bound up with how Electron, the library we use to build executables, works. The exact call that is failing here is App.getPath('documents'). The docs say that this can error but doesn't say possible reasons why, so it's hard to say what is going wrong. It does seem significant that it seems to think that your home path is C:\Users\LocalUser -- is that the name of your user account?

Tagging this as help-wanted because I have a feeling this is related to a nuance of Windows I'm not aware of.

@klembot klembot added the help wanted Extra attention is needed label Dec 8, 2024
@dmnsea
Copy link
Author

dmnsea commented Dec 9, 2024

It does seem significant that it seems to think that your home path is C:\Users\LocalUser -- is that the name of your user account?

Yes, that's the homedir of my user profile

@klembot
Copy link
Owner

klembot commented Dec 10, 2024

Hmm. My one guess was that it was looking in th wrong place, but that’s incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants