-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
263 additions
and
88 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
cargo-features = ["strip"] | ||
#cargo-features = ["strip"] | ||
[package] | ||
name = "RenegadeX-folder-permissions" | ||
name = "renegadex-folder-permissions" | ||
version = "1.0.0" | ||
authors = ["SonnyX <[email protected]>"] | ||
edition = "2018" | ||
edition = "2021" | ||
build = "windows.rs" | ||
|
||
[dependencies] | ||
powershell_script = "0.1.5" | ||
powershell_script = "0.2" | ||
clap = { version="3.0", features = ["derive"] } | ||
|
||
[build-dependencies] | ||
embed-resource = "1.3.0" | ||
embed-resource = "1.3" | ||
|
||
[profile.release] | ||
opt-level = 'z' | ||
strip = "symbols" | ||
#strip = "symbols" | ||
lto=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
use powershell_script; | ||
use clap::Parser; | ||
|
||
fn main() { | ||
let args: Vec<String> = std::env::args().collect(); | ||
/// Used for setting folder permissions | ||
#[derive(Parser, Debug)] | ||
#[clap(about)] | ||
struct Args { | ||
/// Directory of which to set the permissions | ||
#[clap(short, long)] | ||
directory: String, | ||
} | ||
|
||
let script = &args[1]; | ||
fn main() { | ||
let args = Args::parse(); | ||
|
||
match powershell_script::run(script, true) { | ||
match powershell_script::run(&format!("($acl = Get-ACL {directory}).AddAccessRule((New-Object System.Security.AccessControl.FileSystemAccessRule([System.Security.Principal.WindowsIdentity]::GetCurrent().Name,\"FullControl\",\"Allow\"))); $acl | Set-ACL {directory}", directory=args.directory), true) { | ||
Ok(output) => { | ||
println!("{}", output); | ||
} | ||
Err(e) => { | ||
println!("Error: {}", e); | ||
println!("Could not set Access Rule for RenegadeX directory: {}", e); | ||
} | ||
}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.