Skip to content

rig add --without-translations on Windows #93

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

Merged
merged 1 commit into from
Jun 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
* `rig add` now correctly installs pak into the user library, instead of
the system library, even if the user library did not exist before.

* On Windows, `rig add ... --without-translations` installs R without
message translations. This is useful if you prefer using R in
English on a non-English system (#88).

# rig 0.4.1

* `rig rstudio <version>` and `rig rstudio <version> <project>` work properly
Expand Down
10 changes: 10 additions & 0 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,16 @@ pub fn rig_app() -> Command<'static> {
);
}

#[cfg(target_os = "windows")]
{
cmd_add = cmd_add.arg(
Arg::new("without-translations")
.help("Do not install translations.")
.long("without-translations")
.required(false),
);
}

#[cfg(target_os = "macos")]
{
cmd_add = cmd_add.arg(
Expand Down
8 changes: 7 additions & 1 deletion src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,15 @@ pub fn sc_add(args: &ArgMatches) -> Result<(), Box<dyn Error>> {
let target_path = Path::new(&target);

info!("Installing {}", target_path.display());

let mut cmd_args = vec!["/VERYSILENT", "/SUPPRESSMSGBOXES"];
if args.is_present("without-translations") {
cmd_args.push("/components=main,x64,i386");
}

println!("--nnn-- Start of installer output -----------------");
let status = Command::new(&target)
.args(["/VERYSILENT", "/SUPPRESSMSGBOXES"])
.args(cmd_args)
.spawn()?
.wait()?;
println!("--uuu-- End of installer output -------------------");
Expand Down