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

Some files don't get written to when launching from "Run Program" menu #4398

Open
desseim opened this issue Nov 26, 2024 · 4 comments
Open
Labels
Confirmation Pending Further confirmation is requested

Comments

@desseim
Copy link

desseim commented Nov 26, 2024

Describe what you noticed and did

Encountered this trying to run "Holocure" (a free game using GameMaker).
Some (but not all!) of the files the program creates / writes to are not created / written to when it is launched through the "Run Program" option within Sandboxie-Plus UI; when starting the program through Windows Explorer's "Run Sandboxed" context menu on the other hand, all files are properly created / written to within the selected sandbox.

I fully uninstalled / reinstalled Sandboxie-Plus to confirm this behaviour, and reproduced on two separate HW and SW environments.
Tried with a new "Standard Sandbox" (yellow) and a new "Application Compartment Box" (green) and the behavior was the same.

Steps to reproduce (assuming HoloCure.zip is downloaded and extracted to C:\Users\theuser\HoloCure\):

  1. Create a new default sandbox. Use all defaults settings, except for enabling the "Block Internet Access" preset. Assuming henceforth it is called "holobox".
  2. Right-click on the newly created "holobox" sandbox, select "Run" -> "Run Program".
  3. Navigate to the C:\Users\theuser\HoloCure\ directory and select the HoloCure.exe file, click "Open".
  4. Click "OK".
  5. The program launches successfully, and immediately creates a C:\Sandbox\theuser\holobox\user\current\HoloCure\version.ini file.
  6. After the game launches, select configuration options (language, player name, etc) randomly and skip the intro cinematic to reach the game main menu, then exit the game.
  7. Redo steps 2. to 4.: notice how the same configuration options appear on startup, as they haven't been saved. Exit the game.
  8. Open Windows Explorer and navigate to C:\Users\theuser\HoloCure\, right-click the HoloCure.exe file and select "Run Sandboxed".
  9. Select the "holobox" sandbox created at step 1.
  10. Notice how this time the program immediately creates a C:\Sandbox\theuser\holobox\user\current\HoloCure\settings.json and a C:\Sandbox\theuser\holobox\user\current\HoloCure\save_n.dat file.
  11. Redo step 6.
  12. Redo steps 2. to 4., or 8. to 9., and notice how this time the initial configuration options don't show up at startup as they have been successfully saved to the settings.json file.

Interestingly, when Sandboxie-Plus is installed in portable mode and the program is started through the "Run Program" option within Sandboxie (steps 2. to 4. above), the settings.json and save_n.dat files are created and written to; however, they are incorrectly created within the Sandboxie portable "installation" directory (i.e. C:\Sandbox\theuser\holobox\path\to\sandboxie_portable_install_dest\), while the version.ini file is created inside the directory HoloCure.exe resides in (i.e. C:\Sandbox\theuser\holobox\path\to\HoloCure.zip_extraction_dest\).

How often did you encounter it so far?

Always reproducible following the above steps.

Expected behavior

In step 5., C:\Sandbox\theuser\holobox\user\current\HoloCure\settings.json and C:\Sandbox\theuser\holobox\user\current\HoloCure\save_n.dat files are created.
In step 6. C:\Sandbox\theuser\holobox\user\current\HoloCure\settings.json is written to.

Affected program

HoloCure v0.7.1731852466

Download link

https://kay-yu.itch.io/holocure

Where is the program located?

The program is installed both inside and outside the sandbox.

Did the program or any related process close unexpectedly?

No, not at all.

Crash dump

No response

What version of Sandboxie are you running now?

Sandboxie Plus 1.14.10 (x64)

Is it a new installation of Sandboxie?

I recently did a new clean installation.

Is it a regression from previous versions?

I tried with Sandboxie Plus 1.13.7 in portable mode and the behavior was the same as 1.14.10; didn't test any further.

In which sandbox type you have this problem?

In a standard isolation sandbox (yellow sandbox icon).

Can you reproduce this problem on a new empty sandbox?

I can confirm it also on a new empty sandbox.

What is your Windows edition and version?

Reproduced on Windows 10 Home 22H2 and Windows 11 Pro 22H2

In which Windows account you have this problem?

A local account (Administrator).

Please mention any installed security software

Only Microsoft ones built-in and enabled by default in Windows.

Did you previously enable some security policy settings outside Sandboxie?

No response

Trace log

No response

Sandboxie.ini configuration

No response

@desseim desseim added the Confirmation Pending Further confirmation is requested label Nov 26, 2024
@offhub
Copy link
Collaborator

offhub commented Nov 26, 2024

A problem related to the working directory.

To run the program, you can use a command like: cmd /c start "" /d "C:\Users\theuser\HoloCure" HoloCure.exe. However, using the 'Run Program' dialog directly to run a program may cause the working directory to default to System32 or SBIEHome.

@DavidXanatos
Copy link
Member

that should be fixed in the 1.15.x line

@offhub
Copy link
Collaborator

offhub commented Nov 27, 2024

"Run > Run Program" still uses the system32 path. (1.15.2)

@desseim
Copy link
Author

desseim commented Dec 4, 2024

I just tested with the newly released 1.15.3: when launched through the "Run Program" option from within Sandboxie, settings.json and save_n.dat files are incorrectly read from and written to the sandbox drive\C\Windows\System32 directory (so as @offhub suggested).

However, if the program has at least once previously been started through Windows Explorer's contextual menu and settings.json and save_n.dat files have been created in the program directory, (when started through "Run Program") it will read from these files (in the program directory) but will write to the ones in System32.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Confirmation Pending Further confirmation is requested
Projects
None yet
Development

No branches or pull requests

3 participants