damienvanrobaeys / Run-in-Sandbox

Run PS1, VBS, CMD, EXE, MSI, Intunewin, MSIX, or extract ISO, ZIP in Windows Sandbox very quickly just from a right-click
https://www.systanddeploy.com/2023/06/runinsandbox-quick-way-to-runextract.html
740 stars 83 forks source link

Improper file structure causes catastrophic failure #7

Closed SeasonalFerret closed 3 years ago

SeasonalFerret commented 4 years ago

Can't open any programs, can't open any folders, can't even open network configuration without it opening a windows sandbox. Have to type this from my phone since I can't even open chrome without this script forcing chrome to open in a sandbox.

Everything results in "unknown file association", I can't even open direct .exe apps because it doesn't know what to open the .exe with (wtf??)

No guide on how to remove, no backup registry keys, no way to fix. Can't even follow #3 because I can't download any of the reg key and can't even open cmd/regedit without it opening in the sandbox instead.

Wouldn't recommend using this script until the developer fixes this crucial flaw.

Got two blue screens of death due to this script, but luckily I recently installed a program that made a restore point a few weeks ago so I didn't have to reset everything.

damienvanrobaeys commented 4 years ago

Hello, Would it be possible to send me a mail ? damien.vanrobaeys@gmail.com I'm currently working on the issue but can not reproduce.

SeasonalFerret commented 4 years ago

After testing, causing the issue twice, and having to reset my pc 3 times, I've narrowed down the issue.

The issue appears to be caused by not putting the files in the right place.

The proper structure folder appears to be:

MAIN FOLDER
│─Add_Structure.ps1
│
└───Sources
    └───Run_in_Sandbox
        │  └RunInSandbox.ps1
        │  └sandbox.ico . . etc
        │
        ├───assembly
        │     └MahApps.Metro.dll . . etc
        │
        └───Languages_XML
              └ Language_de-DE.xml . . etc

If the user runs Add_Structure.ps1 without the file structure being exactly correct, it causes the .ps1 file to overwrite the pc's associated files and result in errors across the computer.

The best fix for users who have had this happen is to attempt to recover via a restore point previously made.

A possible fix the developer can use is to have the script MAKE SURE that all files are in the right place before executing the main code.

SeasonalFerret commented 4 years ago

You can test this by deleting the Sources folder and just running the script. The result is having the same effect that I had when I made this issue.

I would like to blame the fact that there is no proper guide in the github, but since this is a user error it is my fault.

damienvanrobaeys commented 4 years ago

You can test this by deleting the Sources folder and just running the script. The result is having the same effect that I had when I made this issue.

I would like to blame the fact that there is no proper guide in the github, but since this is a user error it is my fault.

Thx, nope I will say it's my fault too. I haven't tested this case. I will test again and update it. Thx again for the feedback

damienvanrobaeys commented 4 years ago

Indeed I tested like you said and can reproduce, it helped me a lot to understand.

cmiles74 commented 4 years ago

I am also seeing this issue. I installed on another machine a couple weeks ago without issue, but when I installed on my laptop is was rendered unuseable.

damienvanrobaeys commented 4 years ago

I am also seeing this issue. I installed on another machine a couple weeks ago without issue, but when I installed on my laptop is was rendered unuseable.

Hello, did you use the full folder strutcure with sources folder and other file ?

cmiles74 commented 4 years ago

I think so, I cloned the repository. I ran the script and the menus were in French. I edited the configuration file and then ran it again. At this point I now had two of every context menu (one in French, one in English) and it was then that I noticed I couldn't run anything.

SeasonalFerret commented 4 years ago

I installed on another machine a couple weeks ago

In the past couple of weeks, the changelog states that the author fixed the default language being french. And considering this issue cropped up when you moved it from one pc to your laptop, chances are you didn't copy the full file structure or windows may have left out a few files by accident.

The best you can do is to attempt a recovery, either by using a restore point or using "Reset This PC". Then re-install this script after a few bugs are fixed.

Yharooer commented 4 years ago

Hi everyone,

Firstly, thanks @damienvanrobaeys for providing this. It's a very nice shortcut which I wish was enabled by default. It's a shame that it breaks some computers though.

It might be worth saying that I was able to reproduce this. It would be nice if there was a warning in the README file. I should've realised something was not quite right, but instead I downloaded the Add_Structure.ps1 file from an old commit and it ended up breaking my computer like above.

For anyone affected by this, this is how I fixed my computer.

If the script is executed incorrectly, you won't be able to run .exe files. However, the open with menu still works. You can then right click on a file and click open with a Google Chrome / Internet Explorer / Edge which will open the browser. Then navigate to #3 as mentioned above and restore the default file type associations for exe, msi, zip and ps1 files from here.

Hope this helps someone who is struggling to fix their computer! Hope to see a safe working version soon! :)

damienvanrobaeys commented 3 years ago

Hello, I uploaded again the add_structure file and added some controls:

If you have a test computer don't hesitate to test.