Skip to content

[MSI] Figure out what to do about CARGO_HOME #662

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

Open
Boddlnagg opened this issue Aug 18, 2016 · 3 comments
Open

[MSI] Figure out what to do about CARGO_HOME #662

Boddlnagg opened this issue Aug 18, 2016 · 3 comments

Comments

@Boddlnagg
Copy link
Contributor

(This only concerns the new MSI installer for Windows.)

When setting CARGO_HOME as a process-local environment variable for msiexec, it will not be visible. I couldn't find any documentation about this behavior, but I tried and couldn't get it to work. Setting it at the user-level works, though. The question is: Is CARGO_HOME only used for setting a mock path for testing, or is there any other use case? There is a better way in MSI to modify the desired install location, namely setting the TARGETDIR property from the command-line for msiexec.

When we continue to use CARGO_HOME to set the installation directory, we would have to somehow ensure that its value is the same when uninstalling, or save the path in the registry that was used for installing.

Some of this also applies to RUSTUP_HOME, but in general the situation is less critical here. Whenever the directory specified in RUSTUP_HOME does not exist, rustup will just create a new directory and use that one.

@Boddlnagg
Copy link
Contributor Author

#618 is related.

@Boddlnagg
Copy link
Contributor Author

Boddlnagg commented Aug 19, 2016

I found a way to read CARGO_HOME even if it is set as process-local environment variable. It needs to happen early in the installer, because later steps are run from the MSI service server in a new process, which impersonates the user but is not actually a child process so it can't see these environment variables. See also https://blogs.msdn.microsoft.com/heaths/2007/07/12/immediate-custom-actions-always-impersonate/.

We still need to make sure that nothing goes wrong if CARGO_HOME has different values at install time and uninstall time.

@Boddlnagg
Copy link
Contributor Author

I'm going to store the installation directory in the registry. This is probably required anyway. So we will ignore the value of CARGO_HOME on uninstall. We should probably also ignore it on upgrade and use the path from the registry there as well.

This was referenced Aug 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant