PC-Help-Hub / pchh-main

PC Help Hub Main Repo
GNU General Public License v3.0
2 stars 1 forks source link

Cannot run image.ps1 from the file directly #9

Closed o0Eidolon0o closed 1 month ago

o0Eidolon0o commented 1 month ago

The image.ps1 cannot be ran directly from a downloaded file. I find this problematic given how often users mess up or straight up ignore instructions

shinthebean1 commented 1 month ago

There's no self-elevation because it broke out of no where, no other method i found online to self-elevate works. That's why it doesn't work while downloaded.

To run it while downloaded, you have to open powershell as an admin, CD to the directory it's installed at, and do .\image.ps1

shinthebean1 commented 1 month ago

And also it's more complicated to manually run the file than running the iex powershell line

shinthebean1 commented 1 month ago

you COULD try self-elevation with


    Write-Host "Prompting UAC.."
    Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
    exit
}```

Try it in a VM because it kinda works, dunno how to explain it.
o0Eidolon0o commented 1 month ago

To run it while downloaded, you have to open powershell as an admin, CD to the directory it's installed at, and do. \image.ps1

This is not a viable method, does not take care of execution policy, which is outside of Linux KVMs set to restricted by default. While I agree the command is simpler and faster, I imagine there is a sleugh of users who would rather do it the dumb GUI way than pasting commands, or at least just blindly download the file without reading the description. I therefore think it would be better if the script was capable to circumvent these one way or another.

shinthebean1 commented 1 month ago

To run it while downloaded, you have to open powershell as an admin, CD to the directory it's installed at, and do. \image.ps1

This is not a viable method, does not take care of execution policy, which is outside of Linux KVMs set to restricted by default. While I agree the command is simpler and faster, I imagine there is a sleugh of users who would rather do it the dumb GUI way than pasting commands, or at least just blindly download the file without reading the description. I therefore think it would be better if the script was capable to circumvent these one way or another.

Well I don't know how to do that. Though the script already bypasses the execution policy at the first line. You can't manually run the file thru file explorer without having an unrestricted execution policy.

o0Eidolon0o commented 1 month ago

First of all, I am questioning why this has been moved to powershell when there are basically no advantages to it as far as I can tell. There isn't really anything new in the script but yet it's bloated to all hell

o0Eidolon0o commented 1 month ago

Well I don't know how to do that. Though the script already bypasses the execution policy at the first line. You can't manually run the file thru file explorer without having an unrestricted execution policy.

No you cannot, the first line there does nothing since you can't run the script to begin with unless your execpol is already in a positive state, so the line never gets executed or doesn't need to be executed.

shinthebean1 commented 1 month ago

Well I don't know how to do that. Though the script already bypasses the execution policy at the first line. You can't manually run the file thru file explorer without having an unrestricted execution policy.

No you cannot, the first line there does nothing since you can't run the script to begin with unless your execpol is already in a positive state, so the line never gets executed or doesn't need to be executed.

I've tested it. If the script is being ran as intended, thru iex in powershell terminal, it will correctly run the first line. you just need the unrestricted execution policy if running the file with file explorer.

shinthebean1 commented 1 month ago

Well I don't know how to do that. Though the script already bypasses the execution policy at the first line. You can't manually run the file thru file explorer without having an unrestricted execution policy.

No you cannot, the first line there does nothing since you can't run the script to begin with unless your execpol is already in a positive state, so the line never gets executed or doesn't need to be executed.

I changed it to powershell because of AV's, sly's request, and being able to expand my knowledge & also having more "power" if that makes sense. Like I can do a lot more.

o0Eidolon0o commented 1 month ago

I changed it to powershell because of AV's

Elaborate. How exactly is batch different from that point of view?

having more "power" if that makes sense. Like I can do a lot more.

The script doesn't, and doesn't even need to, take advantage of any of the 'power' though, it does the exact same thing as the batch one except it's multiple times the size.

shinthebean1 commented 1 month ago

I changed it to powershell because of AV's

Elaborate. How exactly is batch different from that point of view?

having more "power" if that makes sense. Like I can do a lot more.

The script doesn't, and doesn't even need to, take advantage of any of the 'power' though, it does the exact same thing as the batch one except it's multiple times the size.

As I said, AV's go crazy because it's a batch file. Sly asked me to make it into powershell, mostly because batch has issues with trying to use powershell correctly with the entire script; The script is 99% functional except a few issues which are the other 2 threads. The size doesn't really matter it flows properly and exactly how i want it.

o0Eidolon0o commented 1 month ago

As I said, AV's go crazy because it's a batch file.

I have yet to see any proof of that

The script is 99% functional except a few issues which are the other 2 threads.

It is functional in the same manner, but that is exactly my point - why do we need powershell again? Like I mentioned before, it's not like it's actually doing anything batch can't.

The size doesn't really matter it flows properly and exactly how i want it.

It is convoluted, orientation in it is difficult for users and some of the decisions make 0 sense.

shinthebean1 commented 1 month ago

wdym some decisions make 0 sense? it redirects how I want it and It works exactly as i wanted it to work. I've made it as user friendly as possible.

shinthebean1 commented 1 month ago

As I said, AV's go crazy because it's a batch file.

I have yet to see any proof of that

The script is 99% functional except a few issues which are the other 2 threads.

It is functional in the same manner, but that is exactly my point - why do we need powershell again? Like I mentioned before, it's not like it's actually doing anything batch can't.

The size doesn't really matter it flows properly and exactly how i want it.

It is convoluted, orientation in it is difficult for users and some of the decisions make 0 sense.

Avast, Malwarebytes, and other AV's have ended up blocking the batch file simply because it's batch and it's doing DISM and SFC. But it doesn't do it with powershell.

shinthebean1 commented 1 month ago

First of all, I am questioning why this has been moved to powershell when there are basically no advantages to it as far as I can tell. There isn't really anything new in the script but yet it's bloated to all hell

and if you want to try to debloat it, be my guest. But do a pull request so we can decide what to do b4 posting the final thing

o0Eidolon0o commented 1 month ago

Avast, Malwarebytes, and other AV's have ended up blocking the batch file simply because it's batch and it's doing DISM and SFC. But it doesn't do it with powershell.

Have you actually tested it? I have (avast, eset premium, malwarebytes premium, and BD free) and none of the old scripts get caught, there is no reason to begin with.

shinthebean1 commented 1 month ago

Avast, Malwarebytes, and other AV's have ended up blocking the batch file simply because it's batch and it's doing DISM and SFC. But it doesn't do it with powershell.

Have you actually tested it? I have (avast, eset premium, malwarebytes premium, and BD free) and none of the old scripts get caught, there is no reason to begin with.

I saw it on people trying to use the script.. But anyway sly still recommended me using powershell.

o0Eidolon0o commented 1 month ago

Yes because you trying to use powershell from CMD was a bit of a mess as far as I could see. However there is no reason to use powershell at all as I have explained.

shinthebean1 commented 1 month ago

Yes because you trying to use powershell from CMD was a bit of a mess as far as I could see. However there is no reason to use powershell at all as I have explained.

Well it's already done and it has the same functionality if not better.

o0Eidolon0o commented 1 month ago

What additional functionality does it have besides coloured text which you can also do in cmd?

shinthebean1 commented 1 month ago

What additional functionality does it have besides coloured text which you can also do in cmd?

there aint no point in arguing abt it bc it's already done. Exact same functionality. I learned a new language, i aint see nothing wrong other than bypassing some AV's blocking it

o0Eidolon0o commented 1 month ago

there aint no point in arguing abt it bc it's already done.

Reverting to any of the older versions isn't hard, which is what I suggest be done for the sake of simplicity and cleanliness. We can even keep the command launch guide for people who prefer that. Again the AV thing is a non-issue as the script is doing nothing even remotely suspicious.

shinthebean1 commented 1 month ago

There's no point in keeping both scripts, it'll just over complicate things. There is zero reason to keep both, only one is needed. I put a shit ton of time into learning powershell and i wanna put it to use. Why don't we just keep powershell as it has the exact same functionality. I'm not working on the .bat anymore tho

o0Eidolon0o commented 1 month ago

I am not suggesting that. I am suggesting moving to the older one. We can create an in-progress folder in the repository when projects such as this one can be cultivated until they are ready/reasonable to be added to the main part of the repo

shinthebean1 commented 1 month ago

there's no reason to switch back to the older one, the batch one gets detected by an AV, the powershell one doesn't. It's easier to just put in one command into powershell and having the entire script work rather than downloading a random file, running it, having windows block it bc it isn't signed, etc. It's functionally easier to keep the powershell script.

shinthebean1 commented 1 month ago

Let's wait for sly on this one.

o0Eidolon0o commented 1 month ago

the batch one gets detected by an AV

Untrue. Tested + common sense.

It's easier to just put in one command into powershell and having the entire script work rather than downloading a random

It's even better to have both options. You also get the bonus of autoelevation being easy for you.

shinthebean1 commented 1 month ago

the batch one gets detected by an AV

Untrue. Tested + common sense.

It's easier to just put in one command into powershell and having the entire script work rather than downloading a random

It's even better to have both options. You also get the bonus of autoelevation being easy for you.

It is a lot slower to do the batch file, bc you have to download it, run it, accept UAC, and click 3 more things to even start the script. It's just copy and paste with the powershell one. If we keep both then we have to maintain both to make sure there's absolutely no errors with either of them

shinthebean1 commented 1 month ago

the batch one gets detected by an AV

Untrue. Tested + common sense.

It's easier to just put in one command into powershell and having the entire script work rather than downloading a random

It's even better to have both options. You also get the bonus of autoelevation being easy for you.

It is a lot slower to do the batch file, bc you have to download it, run it, accept UAC, and click 3 more things to even start the script. It's just copy and paste with the powershell one. If we keep both then we have to maintain both to make sure there's absolutely no errors with either of them

I have quite literally seen AV's delete the batch file and mark it as malware.

o0Eidolon0o commented 1 month ago

I have never had issues with any legitimate batch files I've made, nor the original version of this, nor the version I personally made ages ago. And again, I even retested it about 1-2 hours ago just to check, even enabled some additional protection settings in MWB and Eset. And let me reiterate: It's even better to have both options. I personally agree with the command being simpler, but some users just prefer the GUI method of doing this. I also proposed that we should keep both.

shinthebean1 commented 1 month ago

I have never had issues with any legitimate batch files I've made, nor the original version of this, nor the version I personally made ages ago.

I don't know what to tell you. I've watched people via screenshare run the batch file, some AV's flag it as malware and it gets deleted. Let's either just keep the powershell script for time saving and functionality, or just wait for Sly to decide. It's overcomplicating things to keep both scripts.

shinthebean1 commented 1 month ago

I just really do not see a reason to keep the batch script when we have a faster powershell script.

o0Eidolon0o commented 1 month ago

How exactly would it be faster than using batch + command? It's not like you can't just download it through curl and launch it in cmd

shinthebean1 commented 1 month ago

How exactly would it be faster than using batch + command? It's not like you can't just download it through curl and launch it in cmd

i really don't know why you only want to do batch. Batch is slower to run, powershell is more reliable end of story.. there's absolutely ZERO issue with the script other than the language thing which i will fix.

shinthebean1 commented 1 month ago

https://github.com/PC-Help-Hub/pchh-main/issues/7#issuecomment-2226902628 read this

o0Eidolon0o commented 1 month ago

Batch is slower to run

False.

powershell is more reliable

Irrelevant point in this case

there's absolutely ZERO issue with the script other than the language thing which i will fix.

Except for it being bloated and using PoSH for no reason since you take advantage of 0 of its features while also trying to fix a non-issue of the writeouts and failing due to the languages.

o0Eidolon0o commented 1 month ago

#7 (comment) read this

Funny that you act as if I didn't read it while also ignoring what I said. The same command execution is available in batch while also

shinthebean1 commented 1 month ago

    Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
    exit
}```

here's the self elevation, works the same way.

No need to retain the file, all the info you need is in the script.

If the user wants to run it, they can just download the script and google "how to run powershell scripts"
o0Eidolon0o commented 1 month ago

If the user wants to run it, they can just download the script and google "how to run powershell scripts"

Yeah very simple unlike double clicking the file

No need to retain the file, all the info you need is in the script.

the script that.. gets iwr iex and it's gone?

shinthebean1 commented 1 month ago

Yeah very simple unlike double clicking the file

you did not read what i said.

It's not just "double click the file". Windows actively blocks the download as well as trying to block you running it.

Powershell is 100% faster and easier, if they ever want to download it; a quick google search and a brain will get you in the right path.

shinthebean1 commented 1 month ago

iwr iex is simple, easy to run, doesnt download it. It can be downloaded and ran easier than batch anyway

o0Eidolon0o commented 1 month ago

iwr iex is simple, easy to run, doesnt download it. It can be downloaded and ran easier than batch anyway

Could you stop ignoring the fact that batch can do the same exact thing while also giving you the file that you can use later. It fetches the contents off an HTTPS link supplied, for the purpouses of this thing the same exact way as curl does.

shinthebean1 commented 1 month ago

iwr iex is simple, easy to run, doesnt download it. It can be downloaded and ran easier than batch anyway

Could you stop ignoring the fact that batch can do the same exact thing while also giving you the file that you can use later. It fetches the contents off an HTTPS link supplied, for the purpouses of this thing the same exact way as curl does.

if they need to do it again, copy paste a command in powershell. simple.

curl downloading a script then auto launching it can set off AV's (sly has said this)

shinthebean1 commented 1 month ago

I'm completely against the idea of just deleting the perfectly fine and functional script for batch. I'm waiting for @slydelv to respond, till then I'm done arguing. I vote to keep powershell, nothing's wrong with the script.

o0Eidolon0o commented 1 month ago

if they need to do it again, copy paste a command in powershell. simple.

Which is totally simpler than just running a locally stored file

curl downloading a script then auto launching it can set off AV's (sly has said this)

Doing that from a batch file can. Doing so from CMD directly does not.

shinthebean1 commented 1 month ago

if they need to do it again, copy paste a command in powershell. simple.

Which is totally simpler than just running a locally stored file

curl downloading a script then auto launching it can set off AV's (sly has said this)

Doing that from a batch file can. Doing so from CMD directly does not.

it's totally more simple to having to click 5 times the amount of shit than pressing two keys to start a script

o0Eidolon0o commented 1 month ago

it's totally more simple to having to click 5 times the amount of shit than pressing two keys to start a script

Having to open browser, find the repo, navigate to the correct directory, copy the command, open windows search, locate powershell, run it as admin and copy paste it is easier than opening file explorer?

shinthebean1 commented 1 month ago

it's totally more simple to having to click 5 times the amount of shit than pressing two keys to start a script

Having to find the repo, navigate to the correct directory, copy the command, open windows search, locate powershell, run it as powershell and copy paste it is easier than opening file explorer?

jst go to the discord and do !sfrep, it quite literally has the link in there. keep in mind this repo is for the discord

shinthebean1 commented 1 month ago

image

o0Eidolon0o commented 1 month ago

Open browser/discord. Wait for either to load since discord likes to load up for a bit. Find the server among the joined server list. Go to the server and select a channel. Send the command. Copy the command output. Open powershell as administrator. Paste the command. vs Open file explorer. Double click.