Jump to content

AVC-CLI - Updated (May 9th, 2016)


fathed

Recommended Posts

Hello!

I've made a powershell script that will check .version files and optionally download the new version.

The script unfortunately is not currently signed, run 

get-help about_Execution_Policies

in powershell and read the output to determine your solution. Most likely you'll need to do a 

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

or create a bat file to run the script and pass -ExecutionPolicy to powershell.exe.

Features:

  • Checks the version files and provides the URL to download the latest.
  • Optionally can download the update.
    • By default to you your downloads directory, but is configurable on the command.
    • Currently only spacedock.info and curseforge.com are supported.
  • Can start KSP if you want, if specified, it'll start the 64-bit version on 64-bit windows.

Todo:

  • Add downloading from github.com.
  • Add AVC support.
  • Add better help.
  • Get a signing cert.
  • Detect non-steam clients.

License: GPLv3

Download: GitHub

Usage:

Supports tab completion, so typing in "avc-cli.ps1 -" and hitting tab will list the available parameters.
Eventually, running get-help avc-cli.ps1 will display the information below.

  • AVC-CLI.ps1
    • Checks for new versions, notifies you if there's a newer version, and provides the download URL.
    • You'll have to copy/paste the URL(s).
  • AVC-CLI.ps1 -Download
    • Downloads the updates to your downloads directory.
  • AVC-CLI.ps1 -Download -DownloadPath D:\Temp
    • Downloads to where you want.
    • Needs to be a folder, or you'll get an error.
  • AVC-CLI.ps1 -StartKSP
    • Starts Kerbal Space Program when done.
    • Starts 32-bit on 32-bit windows, 64-bit on 64-bit windows.
  • AVC-CLI.ps1 -DisplayJSONErrors
    • Badly named, but displays errors related to why the checking failed.
    • In the image below, the reason the USITools.version failed is due to a 404, using this option you'd see that.
    • The reason the EL.version failed, is due to non-standard JSON formating, you can't do "name":}, you must have a value. 
      • Displaying the errors wouldn't tell you that, you'll just get Error: Invalid JSON primitive: ., and a dump of the raw JSON data that failed to parse.

Image:

MoGRqvX.png

Changes:

  • 0.1 - Initial Relase
  • 0.1.1 - Fixed StartKSP x64-bit detection.
  • 0.1.2 - Fixed downloading only from Spacedock.info for now, displays the URL if not spacedock.
  • 0.2 - If downloading, and it finds a kerbalstuff.com link, it'll search spacedock.info for the mod.
  • 0.2.1 - Moved the search code to it's own function.
  • 0.3 - Adding downloading from Curseforge.com, made downloading from spacedock.info better, fixed illegal file names when trying to write the zip.

 

Let me know if you run into any issues, or have suggestions!

Thanks

Edited by fathed
Link to comment
Share on other sites

Nice!... This might be a nice alternative to CKAN for those of us who like to keep control of mod installation... (I also like that it started out first supporting SpaceDock: MY 1st place to get mods from... :) )

Link to comment
Share on other sites

  • 1 month later...
38 minutes ago, undercoveryankee said:

I had just started working on a similar tool in Python when one of my searches found this thread. Your tool looks nicely polished, and I'm glad to see it. Still working on the Python implementation for people who don't have access to PowerShell.

And I'm working on one in Perl.  (Though mine has a few other uses as well - trying to find common mod install errors.)  Though I'll admit I hadn't quite got to the 'read the .version files and do something' step yet.

Mine's here if it helps, or if we can consolidate a bit...  (I haven't worked in Python, but I'm not to against it.  Though I get shivers at the idea of semantic whitespace.)

Link to comment
Share on other sites

Unfortunately, I've forgotten most of what I used to know about Perl since I discovered Python. Might be a few things I can figure out how to use, though.

I've gotten as far as reading the .version files and reporting what the available version is. (And discovering how many mods are shipping .version files with JSON errors.) Repository at https://github.com/bfrobin446/lwau. You might be able to find something you can use, and I take pull requests if anyone feels like writing some Python.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...