Skip to content
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

Move bat script over to ps1 script #2192

Open
3 tasks
hypirion opened this issue Aug 23, 2016 · 6 comments
Open
3 tasks

Move bat script over to ps1 script #2192

hypirion opened this issue Aug 23, 2016 · 6 comments

Comments

@hypirion
Copy link
Collaborator

hypirion commented Aug 23, 2016

With the pull request #2174 we're not far away from replacing the batch script with powershell. This will require some investigation to keep the usability good (or at least alright):

  • Is it possible to keep the powershell script in a single file?
  • Would changing the bat script to download powershell script on upgrades (while still keep it download old versions when downgrading) be sensible? If not, we can just deprecate it and let lein.bat be a dummy file containing new installation procedures.
  • Update installation instructions for Windows.
@aadrian
Copy link

aadrian commented Aug 24, 2016

-1

Bat was working in all environments without problems.
PowerShell not so (restricted in many corporate environments) :(.

With the last 2.6.1 migration to 2.7.0 now Lein is broken because of PS use.

c:\downloads>lein version
Processing -File '' failed: The path is not of a legal form. Specify a valid path for the -File parameter.

@jevad
Copy link

jevad commented Aug 24, 2016

As aadrian noted, PowerShell requires special "ExecutionPolicy" permissions to run scripts. Setting that special permission is easy , but it potentially requires "Administrator" privileges, which ordinary users do not have in many corporate and (most especially) government environments.

I ran into the same error message as aadrian when I ran the 2.7.0 bat file. However, my corporate environment does allow PowerShell, so I just downloaded the PS1 file from GitHub, then ran Set-ExcutionPolicy from an "Administrator" shell, and all was good (well, except for the issue I reported just now, but I fixed that too).

@hypirion
Copy link
Collaborator Author

hypirion commented Aug 24, 2016

ah, darn, I'll push out a bugfix which resolves the lein.bat breakage asap.

Is the issue that powershell itself is too restricted, or is the issue the execution policy of powershell? And if so, are there any ways to get around that? One of the reasons we wanted to go over to ps was because it handled downloading much better for us, but if powershell or the execution policy isn't widely available then powershell doesn't sound like a viable replacement at this point.

@hypirion
Copy link
Collaborator Author

A normal lein upgrade will not mess up lein.bat scripts anymore, sorry for that inconvenience.

@aadrian
Copy link

aadrian commented Aug 25, 2016

@hypirion Thank you. It works again now. The lein.bat needs to be manually re-downloaded first, and than everything seems to work again :) .

@aadrian
Copy link

aadrian commented Sep 23, 2016

@hypirion I have to rectify. After testing it on more machines, unfortunately the Windows version does not work without PowerShell - even if Curl is in the path :(.

Also tried with the new 2.7.1 lein.bat file and it's the same problem :(.

c:\work>lein upgrade
The script at c:\tools\lein-2.x\bin\lein.bat will be upgraded to the latest stable version.
Do you want to continue (Y/N)?y
Downloading latest Leiningen batch script...
Exception calling "DownloadFile" with "2" argument(s): "Unable to connect to the remote server"
At line:1 char:145
+ ... rkCredentials; $client.DownloadFile($a, $f)} "https://github.com/technomancy/lei ...
+                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WebException


Upgrading...
'"c:\tools\lein-2.x\bin\temp-lein-297059864.bat"' is not recognized as an internal or external command,
operable program or batch file.

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

No branches or pull requests

3 participants