ScoopInstaller / Extras

📦 The Extras bucket for Scoop.
https://scoop.sh
The Unlicense
1.8k stars 1.38k forks source link

[Bug]: sweethome3d problem with storing preferences #13548

Open BlackBaroness opened 4 months ago

BlackBaroness commented 4 months ago

Prerequisites

Package Name

sweethome3d

Expected/Current Behaviour

Persistent file preferences.xml must be a file, but the installer creates it like a folder so the program can't write preferences

Besides that, I always get the "Can't save preferences in file system" when I launch the app even if I created that file manually. Something is wrong about it

Steps to Reproduce

Install the `sweethome3d` package, open it

Possible Solution

Make it create a file and not a directory. But I am not sure if it will help because I did it and still get the error at startup

Scoop and Buckets Version

Current Scoop version:
d337bb1f (HEAD -> master, tag: v0.4.2, origin/master, origin/HEAD) chore(release): Bump to version 0.4.2 (#5964)

'main' bucket:
53991304d (HEAD -> master, origin/master, origin/HEAD) yt-dlp: Update to version 2024.07.01

'extras' bucket:
5dabf06dd (HEAD -> master, origin/master, origin/HEAD) snappy-driver-installer-origin: Update to version 1.13.2.766

'versions' bucket:
9ae85c2eb (HEAD -> master, origin/master, origin/HEAD) yt-dlp-master: Update to version 2024.07.01.171149

'nonportable' bucket:
46c91904 (HEAD -> master, origin/master, origin/HEAD) sandboxie-plus-np: Update to version 1.14.3

'java' bucket:
fdb41b89 (HEAD -> master, origin/master, origin/HEAD) temurin17-nightly-jre: Update to version 17.0.12-6.0.ea

'games' bucket:
bcedbb644 (HEAD -> master, origin/master, origin/HEAD) warzone2100: Update to version 4.5.0

Scoop Config

last_update         scoop_repo                              scoop_branch
-----------         ----------                              ------------
7/2/2024 4:40:23 AM https://github.com/ScoopInstaller/Scoop master

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.4.3
PSEdition                      Core
GitCommitId                    7.4.3
OS                             Microsoft Windows 10.0.22631
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Additional Softwares

No response

milnak commented 2 months ago

I have a fixed manifest

Fix is to create the folder and empty file in pre_install, e.g.

    "pre_install": [
        "if (!(Test-Path \"$persist_dir\\data\\preferences.xml\" -PathType Leaf)) ",
        "{",
        "New-Item -Path \"$dir\\data\" -ItemType Directory | Out-Null",
        "New-Item -Path \"$dir\\data\\preferences.xml\" -ItemType File | Out-Null",
        "}"
    ],