Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@tillig
Copy link
Contributor

@tillig tillig commented Jan 19, 2015

Fix for issue #874. Switched the installation script to use automatic Chocolatey facilities for installing command-line tools. Chocolatey handles putting in a shim to scriptcs.exe and adding the path info. No need for uninstall when using this mechanism - Chocolatey does it all for you.

Fix for issue #874. Switched the installation script to use automatic
Chocolatey facilities for installing command-line tools. Chocolatey
handles putting in a shim to scriptcs.exe and adding the path info. No
need for uninstall when using this mechanism - Chocolatey does it all
for you.
@tillig
Copy link
Contributor Author

tillig commented Jan 19, 2015

Testing this is sort of painful and manual, but here's how:

  1. Build the solution so the Chocolatey package gets created.
  2. Create a temporary folder C:\temp\temp-scriptcs.
  3. Copy the Chocolatey package scriptcs.0.12.0.nupkg into the temp folder.
  4. Rename the Chocolatey package from scriptcs.0.12.0.nupkg to scriptcs.1.0.0.zip. Rename to zip so you can use 7-zip (or other tool) to unpack it; update the number so Chocolatey will eventually think it's more recent than previously released packages.
  5. Unpack the zip file into a folder scriptcs.1.0.0.
  6. Delete the old scriptcs.1.0.0.zip.
  7. Update the .nuspec in there to say version 1.0.0.
  8. Zip up the contents of the folder into a new version of scriptcs.1.0.0.zip. Make sure if you browse in the zip file that the .nuspec shows up right in the root of the zip - if you see a folder in there scriptcs.1.0.0 then you zipped at the wrong level.
  9. Rename the .zip file back to scriptcs.1.0.0.nupkg.
  10. Open up a Powershell script as administrator.
  11. Run choco sources add -name temp-scriptcs -source C:\temp\temp-scriptcs
  12. Run choco install scriptcs -version "1.0.0"
  13. Watch as the Chocolatey installer runs.
  14. Without closing down the Powershell prompt, try using scriptcs.exe - it should work.
  15. Open a separate Powershell prompt as a non-admin user (or an otherwise different user than was used to install the package) and run scriptcs.exe - it should work for the other user, too. (This is the bit that got fixed by the PR here.)
  16. Browse to C:\ProgramData\chocolatey\bin and you'll see a scriptcs.exe shim in there.
  17. Back at the admin prompt, run choco uninstall scriptcs.
  18. In C:\ProgramData\chocolatey\bin the scriptcs.exe shim should be gone.

@adamralph
Copy link
Contributor

@tillig thanks very much for this! I really like it, especially the hugely simplified install script! The use of built in chocolatey idioms is a way nicer way to go.

I guess the only downside to this is that it will now require admin rights to install scriptcs. @scriptcs/core how much does this bother us?

@aarondandy
Copy link
Contributor

Thank you very much! 👍

@tillig
Copy link
Contributor Author

tillig commented Jan 19, 2015

Generally packages installed by Chocolatey do seem to require admin rights. It's totally up to y'all, but there's at least precedent for that. (Technically, for me, at least, even installing scriptcs in its current incarnation required admin rights because once you install a package using admin rights, the admin user takes ownership of the chocolatey.log and further non-admin installs become impossible.)

Anyway, if this looks like it'll work and folks are amenable, it'd be pretty helpful for those of us switching between admin and non-admin accounts.

@aarondandy
Copy link
Contributor

I get dirty messages from Chocolatey if I don't install things as my other user account with admin privileges. Sometimes, those messages seem accurate.

@glennblock
Copy link
Contributor

Nice! I am not too concerned on the admin requirement for chocolatey as it
seems like running as admin is not unreasonable.
On Mon, Jan 19, 2015 at 10:30 AM Aaron Dandy notifications@github.com
wrote:

I get dirty messages from Chocolatey if I don't install things as my other
user account with admin privileges. Sometimes, those messages seem accurate.


Reply to this email directly or view it on GitHub
#903 (comment).

@adamralph
Copy link
Contributor

@glennblock great - in that case I think we should go ahead and accept this.

@tillig one question first:- how does it behave if an older per-user installation is already present?

@tillig
Copy link
Contributor Author

tillig commented Jan 19, 2015

Just tested it out and apparently upgrading a package does not actually run the uninstall for the previous version so the way I have it now you'd have to manually uninstall and then reinstall.

Let me see if I can make it just a touch smarter so the upgrade scenario works.

Added a routine to deal with removing the per-user install of scriptcs
and per-user PATH setting on upgrade.
@tillig
Copy link
Contributor Author

tillig commented Jan 19, 2015

I added a block of code that will remove the old %AppData% based install locations and per-user path settings during an upgrade scenario. This allows existing users to upgrade to the new mechanism and new users to install.

It's unfortunate, but there's no Uninstall-ChocolateyPath in Chocolatey so we can't just use a one-liner to remove the path like was used to install it. Thus you'll see a little bit of manual parsing, but there's really no other way. It's the reverse logic of what's in Install-ChocolateyPath.

khellang added a commit that referenced this pull request Jan 20, 2015
Chocolatey installation for multiple users
@khellang khellang merged commit 8387a30 into scriptcs:dev Jan 20, 2015
@khellang
Copy link
Member

Thanks @tillig! 👍

@khellang
Copy link
Member

Added you to the contributors list: https://github.com/scriptcs/scriptcs/wiki/Contributors 😄

@khellang
Copy link
Member

BTW, @scriptcs/owners @scriptcs/core: we should really automate that list. Maybe I should add a list as part of the new community blog? Like http://nancyfx.org/contribs.html?

@glennblock
Copy link
Contributor

@khellang We could host it on the blog and link to it.

On Mon Jan 19 2015 at 10:10:33 PM Kristian Hellang notifications@github.com
wrote:

BTW, @scriptcs/owners https://github.com/orgs/scriptcs/teams/owners
@scriptcs/core https://github.com/orgs/scriptcs/teams/core: we should
really automate that list. Maybe I should add a list as part of the new
community blog? Like http://nancyfx.org/contribs.html


Reply to this email directly or view it on GitHub
#903 (comment).

@adamralph
Copy link
Contributor

It's actually already automated at https://github.com/scriptcs/scriptcs/graphs/contributors

It does require that people commit with their correct email addresses though.

@tillig
Copy link
Contributor Author

tillig commented Jan 20, 2015

Happy to help!

@ztone
Copy link
Contributor

ztone commented Jan 20, 2015

Damn, I've been struggling to get on that wiki list for years ... what does a man have to do?

@adamralph
Copy link
Contributor

😱 you weren't on it!?

Fixed 😃

@filipw
Copy link
Member

filipw commented Jan 20, 2015

It's a wiki, it's publicly editable :-)
On Jan 20, 2015 7:44 PM, "Stone Gislason" notifications@github.com wrote:

Damn, I've been struggling to get on that wiki list for years ... what
does a man have to do?


Reply to this email directly or view it on GitHub
#903 (comment).

@ztone
Copy link
Contributor

ztone commented Jan 20, 2015

Are you saying that I could have just added myself a long time ago and didn't have to learn to write any code at all. Man, that's several years down the drain.

@ztone
Copy link
Contributor

ztone commented Jan 20, 2015

Look ma .. on top of the list
https://github.com/scriptcs/scriptcs/wiki/Contributors

(sorry for hijacking this thread for such silliness)

@adamralph
Copy link
Contributor

@khellang I like your idea of automating the list in a similar way to Nancy and I think you should go for it.

It will be a repitition of https://github.com/scriptcs/scriptcs/graphs/contributors but in a nicer looking and more prominent way.

@adamralph
Copy link
Contributor

#904

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.