Atlas icon indicating copy to clipboard operation
Atlas copied to clipboard

[BUG] - PATH variable is overwritten

Open DRGFL opened this issue 1 year ago • 16 comments
trafficstars

Description

  • This is what i said in previous bug report: After install the new version of AtlasOS, i cant run .cmd files: the cmd window shows up and then close immediently. I tried to open CMD but some common commands does not work (image below)
  • I reported this bug in https://github.com/Atlas-OS/Atlas/issues/1072 but it's closed because my Windows edition is IoT Enterprise which is not recommended. image
  • Then I tried to reinstall AtlasOS on my clean Windows 11 Pro but i still get that bug, pls take a closer look. image

Steps to reproduce

  1. Double click to open a .cmd file or run some commands in cmd.

  2. Watch it doesnt work like you expected.

Expected behavior

It supposes to run normally.

Actual behavior

image image

Atlas Edition

Atlas for Windows 11 23H2

Desktop information

Operating System: Windows 11 Pro System Manufacturer: Acer System Model: Aspire A715-43G Processor: AMD Ryzen 5 5625U with Radeon Graphics (12 CPUs), ~2.3GHz Memory: 24576MB RAM Card name: NVIDIA GeForce RTX 3050 Laptop GPU

Additional content

[Update] Simply fixed it by looking up missing paths in this link and adding them back, those commands now work normally again.

DRGFL avatar Apr 12 '24 15:04 DRGFL

btw cmd commands don't use -, they use / (so help is usually /?)

However dism should work as normal, so check your PATH (if cmd is crashing, it's probably because of these command not found errors, you may also want to try changing your default terminal emaulator to Windows Terminal as is the win11 default)

Ast3risk-ops avatar Apr 12 '24 16:04 Ast3risk-ops

btw cmd commands don't use -, they use / (so help is usually /?)

yeah i was wrong at that point, but what ever it is, the 'sfc' still can not be recognized. i tried everthing i could but nothing get better, maybe i need to reinstall my windows again and wait for new atlas version...

DRGFL avatar Apr 12 '24 16:04 DRGFL

btw cmd commands don't use -, they use / (so help is usually /?)

yeah i was wrong at that point, but what ever it is, the 'sfc' still can not be recognized. i tried everthing i could but nothing get better, maybe i need to reinstall my windows again and wait for new atlas version...

You may not have reinstalled correctly, what were your steps?

Ast3risk-ops avatar Apr 12 '24 16:04 Ast3risk-ops

what were your steps?

just like everyone else: install ventoy on an usb stick, boot up an official iso and start to install windows normally. i had run those commands normally before installed Atlas so i pretty sure that Atlas causes this bug.

DRGFL avatar Apr 12 '24 16:04 DRGFL

what were your steps?

just like everyone else: install ventoy on an usb stick, boot up an official iso and start to install windows normally. i had run those commands normally before installed Atlas so i pretty sure that Atlas causes this bug.

That's not the steps, and if you're gonna use a USB, wipe your disk to ensure the install is clean (you don't even need to use a USB)

https://docs.atlasos.net/getting-started/installation/

Ast3risk-ops avatar Apr 12 '24 18:04 Ast3risk-ops

That's not the steps

That's the MAIN STEPS I did, I just want you to understand that I know how to install Windows correctly, and the bug only appears after installing AtlasOS.

DRGFL avatar Apr 13 '24 02:04 DRGFL

That's not the steps

That's the MAIN STEPS I did, I just want you to understand that I know how to install Windows correctly, and the bug only appears after installed AtlasOS

During USB install if you just clicked your C: drive you didn't fully wipe windows, so reinstall again, and wipe your drive (erase all partitions)

Ast3risk-ops avatar Apr 13 '24 02:04 Ast3risk-ops

During USB install if you just clicked your C: drive you didn't fully wipe windows

Nahh I didnt do that bro, i deleted every windows partitions and used diskpart to wipe my drive so pls understand that i know how to install windows correctly. The bug only appears after installing AtlasOS (2 times in 2 different windows edition!!).

DRGFL avatar Apr 13 '24 02:04 DRGFL

are you sure you didn't delete anything from PATH? i have tried 0.4 and sfc, dism all work fine

trolljoe avatar Apr 13 '24 03:04 trolljoe

are you sure you didn't delete anything from PATH?

yes, i ran some .cmd files and those command before installing AtlasOS so im pretty sure that everything was run normaly

i have tried 0.4 and sfc, dism all work fine

that's so weird, i tried 0.4 on 2 different editons of windows (both are clean installation) and still got that bug...

DRGFL avatar Apr 13 '24 03:04 DRGFL

Can you please send the TIOutput.txt in the Atlas folder inside of %ProgramData%\AME\Logs? The PATH variable is somehow messed up.

he3als avatar Apr 13 '24 12:04 he3als

Unfortunately, I have just reinstalled Windows and no longer have that file 😔. I will try installing AtlasOS in a VM to see if the bug appears again; then I will send you the file. If it doesn't, I will close this report. Thanks for your reply.

(Btw, I really love your EdgeRemover script, it helps me a lot 🙌).

DRGFL avatar Apr 13 '24 16:04 DRGFL

Can you please send the TIOutput.txt in the Atlas folder inside of %ProgramData%\AME\Logs?

Here is the file you need TIOutput.txt

DRGFL avatar Apr 14 '24 09:04 DRGFL

TIOutput.txt

Pasted: https://paste.asterisk.lol/raw/ikecawunol

Ast3risk-ops avatar Apr 14 '24 12:04 Ast3risk-ops

@Ast3risk-ops @he3als

  • I think I found out what causes this error. Maybe while AtlasOS is modifying system variables, instead of adding some new paths, it replaces them (or deletes them, even Chocolatey got affected). So that's why in 'Environment Variables'/System variables/path, I only see nothing but AtlasOS's paths.
  • I simply fixed it by looking up missing paths in this link and adding them back, those commands now work normally again. IMG_20240506_220359~2.jpg

IMG20240506220546.jpg

DRGFL avatar May 06 '24 15:05 DRGFL

Atlas doesn't replace the PATH variable, it just appends to it. https://github.com/Atlas-OS/Atlas/blob/main/src/playbook/Configuration/atlas/start.yml#L9

I'm not too sure what could be wrong or how to reproduce your issue.

he3als avatar May 07 '24 13:05 he3als

Closing as resolved.

Thanks.

Xyueta avatar May 31 '24 19:05 Xyueta

I'm going to re-open this as I think there could be more investigation regarding alternatives to getting the PATH variable.

he3als avatar Jun 01 '24 16:06 he3als

My atlasOS install is fine with all PATHs and cmds all work as expected. (I installed about a week ago with a fresh install because my last windows was broken coincidentally the paths)

Danalytics-dan avatar Jun 02 '24 15:06 Danalytics-dan

I've rewritten the function that adds to the PATH variable for the next release. Although I'm unsure how the previous implementation caused issues, it should be more reliable now. If this doesn't fix it, I'm unsure what else can be done as it can't be reproduced. https://github.com/Atlas-OS/Atlas/commit/3aac4b82d7bf9d4fd0e9347cb6d3eeeb61e6b53d

You can test an experimental build, which includes it here: https://github.com/Atlas-OS/Atlas/actions/runs/9429700703

Remember that these builds are not meant for daily driving and should only be used for testing. There are unfinished things as well as bugs.

he3als avatar Jun 08 '24 19:06 he3als

I'm going to close this issue, but if there are any testing results, just comment.

he3als avatar Jun 11 '24 20:06 he3als

Just reporting in, I ran into this bug today using the latest AME Wizard (0.7.5 Beta?) and Atlas playbook on a fresh install of Windows 11 Home using freshly-created install media with a newly-downloaded copy of Windows (from Microsoft.)

After Atlas setup, the system Path variable was set to only include: PATH=;C:\Windows\AtlasModules;C:\Windows\AtlasModules\Apps;C:\Windows\AtlasModules\Other;C:\Windows\AtlasModules\Tools;C:\Windows\AtlasModules\Scripts

awksie avatar Aug 17 '24 15:08 awksie

Windows 11 Home

https://docs.atlasos.net/install-faq/windows-home/

Atlas doesn't support Home, try with Pro.

Ast3risk-ops avatar Aug 17 '24 15:08 Ast3risk-ops

I don't have the option on that machine, as it has the key embedded and will not accept Pro. In any case, while I do understand the desire to head off bug reports in unsupported configurations, I don't really think that has anything to do with this issue. :)

I don't need support, as I've already resolved the problem by manually replacing the path variable, but I wanted to provide the report so that you know that this can still happen to people despite the issue being closed.

On Sat, Aug 17, 2024, 10:07 Asterisk @.***> wrote:

Windows 11 Home

https://docs.atlasos.net/install-faq/windows-home/

We don't support Home, try with Pro.

— Reply to this email directly, view it on GitHub https://github.com/Atlas-OS/Atlas/issues/1076#issuecomment-2294885722, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACATXTJKPI2KM4LRG3WRVZLZR5RKTAVCNFSM6AAAAABGEKQW4CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJUHA4DKNZSGI . You are receiving this because you commented.Message ID: @.***>

awksie avatar Aug 17 '24 15:08 awksie

However the issue might be specific to Home, you can override the key lock using a USB (might work without one too if the iso is extracted) and the ei.cfg file (place it inside the sources folder, it will force the edition picker to appear)

Ast3risk-ops avatar Aug 17 '24 15:08 Ast3risk-ops

I doubt this issue is related to Windows Home, but the logic for adding to the PATH variable has been updated for v0.5 anyway, so it should be fixed for the next release.

Did you install any software before installing Atlas? Or did you install Atlas without following the installation guide?

he3als avatar Aug 17 '24 23:08 he3als

I followed the guide, although I have installed Atlas many times before on many other machines.

  1. Prepare image using Rufus
  2. Install on clean (no volumes present) drive, in this case a raid-0 of two PCIe 4.0 SSDs (don't get on my case, that's how Dell provisioned the machine to begin with) 2.1) Use a local administrator account (not the built-in one)
  3. Install video and Ethernet drivers
  4. Connect internet and perform all Windows updates including drivers
  5. Pause updates and disable required security features
  6. Install Atlas playbook
  7. After reboot, apply tweaks from Atlas folder on desktop ← this is where things went awry

Also, this is really for a separate issue, but I selected Firefox as my browser and Atlas failed to install it, leaving me with no browser, which was a mild pain, lol.

On Sat, Aug 17, 2024, 18:35 he3als @.***> wrote:

I doubt this issue is related to Windows Home, but the logic for adding to the PATH variable has been updated for v0.5 anyway, so it should be fixed for the next release.

Did you install any software before installing Atlas? Or did you install Atlas without following the installation guide https://docs.atlasos.net/getting-started/installation/?

— Reply to this email directly, view it on GitHub https://github.com/Atlas-OS/Atlas/issues/1076#issuecomment-2295026864, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACATXTPSWWWZ2ZMHLTNXPRTZR7M2RAVCNFSM6AAAAABGEKQW4CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJVGAZDMOBWGQ . You are receiving this because you commented.Message ID: @.***>

awksie avatar Aug 17 '24 23:08 awksie

Can you send your logs from C:\ProgramData\AME\Logs?

he3als avatar Aug 17 '24 23:08 he3als

I most certainly can: Output.txt

Looks like the path issue may have caused the Firefox issue? Wonder what else it broke.

awksie avatar Aug 18 '24 00:08 awksie