Jump to content

Kerbal Updater v0.2


kevmo314

Recommended Posts

[table]

[tr]

[td]F34yaV8.png[/td]

[td]

Kerbal Updater v0.2β

An updater for your plugins!

Tired of manually updating your plugins? Tire no more! Straight from the labs of Wernher Von Kerman, a simple utility to check for updates to your plugins without finnicky third-party applications! (Well, almost) Kerbal Updater takes the stress off your back and puts it onto the backs of hard working plebals!

Current Features:

  • Check for updates on startup
  • Download in the background
  • Automatically install new version over previous version
  • Specify SpacePort URL's for plugins that haven't specified it

Current Limitations:

  • No dependency resolution
  • Max one update per day
  • Only supports zip files
  • Only supports GameData directory

[/td]

[/tr]

[tr]

[td]

Download |

[/td]

[td]NOTE: This version is a beta (pre v1.0) version. Please make sure you understand that this plugin modifies files on your computer. Kerbals recommend you make a backup of your plugins before installing.

-
-

(Windows only for now and forever, sorry
:(
)

[/td]

[/tr]

[tr]

[td]

Executive Summary |

[/td]

[td]The plugin detects an update when the date on SpacePort is newer than the date stored. It does not check/compare version numbers, mostly because there's no easy way to detect them. The plugin follows the following procedure when updating a plugin:

  1. Fetch download URL and download file to directory.
  2. Extract file to staging directory.
  3. Attempt to locate plugin root folder (ie /GameData/<root folder>/).
  4. Migrate root folder to staging directory.
  5. Request restart from user.

When the user quits KSP:

  1. KerbalUpdaterMigration.exe runs, KSP quits.
  2. Files from staging directory are moved into /GameData/.
  3. Staging directory and download directory are cleaned.
  4. KSP is restarted if requested by user.

Kerbal Updater does not modify any files outside /GameData/.

[/td]

[/tr]

[tr]

[td]

User Guide/FAQ |

[/td]

[td]

How come when I start Kerbal Updater/manually configure a plugin, all of them are showing "Update Available"? I know I have the latest version.

Kerbal Updater can't detect what version you have until you update it via the updater dialog. If you're sure you have the latest version, you can click "Ignore" to prevent Kerbal Updater from prompting that version.

What if the plugin I want isn't configured for Kerbal Updater?

No worries, just enable monitoring of the plugin, then hit "Configure" and enter the SpacePort URL of the plugin. Make sure it's the right URL, otherwise you'll install a different plugin. Note that if a plugin has an ID set already by the author, you can't override it.

An external executable? Is that safe?

Feel free to look over the (very short)
yourself.
:)

What's the command prompt that pops up when I close KSP?

If you have an update installed, that prompt migrates the plugins from staging to their /GameData/ homes. Because *.dll files can't be modified while KSP is running, this little app does it right after KSP is closed.

What happens if the SpacePort URL changes?

If the plugin is manually configured, then you'll receive an error. If the plugin is autoconfigured by the author, hopefully they'll update the ID as well.

I got a "staging directory not empty" error! Help!

The first thing to check is that all your plugins are functioning fine. If they are, then open up the staging directory shown on the error message, and check which plugins are in there. Remember these plugins, but empty the staging directory. When you launch KSP again, Kerbal Updater will no longer complain. Force update the plugins that you found in the staging directory.

Kerbal Updater broke my plugin install!

I'm sorry that happened.
:(
Let me know which plugins were affected and what happened. A KSP.log will also help. Unfortunately, you'll have to manually download the plugin and keep it updated yourself until the issue is fixed.

[/td]

[/tr]

[tr]

[td]

Planned Features |

[/td]

[td]

  • Add support for more filetypes like rar and stuff.
  • Detect initial plugin version.
  • Add in-game mod management/installation support (maybe in a different plugin).

[/td]

[/tr]

[tr]

[td]

For Plugin Authors |

[/td]

[td]To have your plugin be automatically recognized by Kerbal Updater, create a config.xml file (or append the config nodes) somewhere in your plugin that looks something like this:

<?xml version="1.0" encoding="utf-8"?>
<config>
<int name="SpacePortID">40298</int>
<string name="Name">Kerbal Updater</string>
</config>

SpacePortID is the Product ID that can be found on your plugin's SpacePort page.

Name is the requested name of your plugin. By default, Kerbal Updater uses the plugin directory's name, which isn't always descriptive enough.

Also, make sure when packaging your zip file, the root directory is either GameData or your plugin's root directory. For example, the following structures are permissible:

  • /MyPlugin.zip/GameData/MyPlugin/...
  • /MyPlugin.zip/MyPlugin/...

Any other structure will cause problems. If you'd like me to handle another structure though, I'd be happy to add detection of it.

[/td]

[/tr]

[tr]

[td]

ChangeLog |

[/td]

[td]v0.2: Small performance improvement, added handling of edge cases and more error handling.

v0.1: Initial release[/td]

[/tr]

[tr]

[td]

Acknowledgments |

[/td]

[td]Wernher Von Kerman would like to acknowledge the following people:

  • The authors of Kerbal Alarm Clock for their code, of which I learned a lot from.
  • SharpZipLib for their zip library, as there isn't one built into Unity's version of Mono yet.

Please let me know if you have any suggestions. I know I have a low post count. I don't post much (anywhere, really), but I've been lurking a lot.

[/td]

[/tr]

[/table]

Edited by kevmo314
Link to comment
Share on other sites

Neat! Would it be possible to configure a lite version that notifies you of the update but doesn't actually download or install it? I'd still kinda rather handle that part myself, but keeping track of the the latest versions of all my favorite mods can certainly be tough.

Link to comment
Share on other sites

Neat! Would it be possible to configure a lite version that notifies you of the update but doesn't actually download or install it? I'd still kinda rather handle that part myself, but keeping track of the the latest versions of all my favorite mods can certainly be tough.

Yep! The actual download part is separate from the notification. You have to hit an "update" button. If you go ahead and do it yourself, you can click "Ignore" and indicate that you updated it.

I started a project quite like this, albeit with json configurations instead of XML, but grew tired of the lack of good IDEs for non-windows machines :). Is this project OS-agnostic?

The notification part should work fine, but unfortunately, the downloading part isn't. I'd be happy to figure it out for other OS's though if I had some documentation about how unity handles plugins on them. :)

Edited by kevmo314
Link to comment
Share on other sites

I dunno if I'm doing something wrong, but I'm not getting any updates.

I know it's installed correctly; because I get the updater window on KSP start.

I've even purposely rolled back a few mods and performed multiple launches with no updating. It switches to "Downloading (0%)", but no activity. (I even checked the network activity just in case.)

Link to comment
Share on other sites

I dunno if I'm doing something wrong, but I'm not getting any updates.

I know it's installed correctly; because I get the updater window on KSP start.

I've even purposely rolled back a few mods and performed multiple launches with no updating. It switches to "Downloading (0%)", but no activity. (I even checked the network activity just in case.)

Do you have a KSP.log? Also, do you have write permissions on your KSP directory?

Does this work on Linux?

The install part probably doesn't but the update checking might.

Link to comment
Share on other sites

Do you have a KSP.log? Also, do you have write permissions on your KSP directory?

The install part probably doesn't but the update checking might.

Working on it. Currently getting a "horribly wrong" message; so I know it's something I did. Didn't have full permissions but have made that change. Let you know more soon.

Link to comment
Share on other sites

Working on it. Currently getting a "horribly wrong" message; so I know it's something I did. Didn't have full permissions but have made that change. Let you know more soon.

Okay, thanks. I'll add a condition to check if the download or migrations fail.

Link to comment
Share on other sites

I'm working on linux so I appreciate that this won't work fully for me... but how does your mod handle files where gamedata already exists in the zip?

Just to give you an example - you said in the first post that the "Staging" directory gets copied over to GameData - when I check this directory I see this:

1lUGp6N

I can see that the mod has identified a GameData folder... my question is.. when I switch over to windows later to test this, is it intelligent enough to NOT paste this path into gamedata (so I end up with GameData\KMP or will I end up with <KSP Directory>\GameData\GameData\KMP?

Link to comment
Share on other sites

I'm working on linux so I appreciate that this won't work fully for me... but how does your mod handle files where gamedata already exists in the zip?

Just to give you an example - you said in the first post that the "Staging" directory gets copied over to GameData - when I check this directory I see this:

1lUGp6N

I can see that the mod has identified a GameData folder... my question is.. when I switch over to windows later to test this, is it intelligent enough to NOT paste this path into gamedata (so I end up with GameData\KMP or will I end up with <KSP Directory>\GameData\GameData\KMP?

Hmm, thanks for reporting this. It should behave like the former, but given your screenshot, it will behave like the latter. I did add a condition for the GameData folder like that, so I'll check that one more time, specifically against the KMP plugin to see if it's working properly.

EDIT: I can't seem to reproduce the issue. I get Staging\KMP, ie it extracted from the GameData directory properly? You're using http://kerbalspaceprogram.com/kmp-client/, correct?

Edited by kevmo314
Link to comment
Share on other sites

No Dice. Clean install. Kerbal Updater & Squad as the only folders in GameData.

Get the KerbalUpdater window.

Update available for Kerbal Updater.

Download completes.

Restart required.

'Restart Now'

CmdWindow:

KERBAL UPDATER

-----------------------

Waiting for KSP to quit ...

Loading configuration...

Copying files....

Unhandled Exception: System.IO.IOException: The process cannot access the file 'C:\games\kerbal space program v0.22\GamData\KerbalUpdater\Plugins\KerbalUpdaterMigration.exe' because it is being used by another process.

at System.IO._Error.WinIOError(Int32 errorCode, String maybeFullPath)

at System.IO.File.InternalCopy(String sourceFileName, String DestFileName, Boolean overwrite, Boolean checkHost)

at System.IO.FileInfo.CopyTo(String destFileName, Boolean overwrite)

at KerbalUpdater.KerbalUpdaterMigration.CopyFilesRecursively(DirectoryInfo source, DirectoryInfo target)

at KerbalUpdater.KerbalUpdaterMigration.CopyFilesRecursively(DirectoryInfo source, DirectoryInfo target)

at KerbalUpdater.KerbalUpdaterMigration.CopyFilesRecursively(DirectoryInfo source, DirectoryInfo target)

at KerbalUpdater.KerbalUpdaterMigration.Main(String[] args)

Link to comment
Share on other sites

No Dice. Clean install. Kerbal Updater & Squad as the only folders in GameData.

Get the KerbalUpdater window.

Update available for Kerbal Updater.

Download completes.

Restart required.

'Restart Now'

Ah, I see what's going wrong there. That's a really cute edge case, as the migration executable is attempting to replace itself, which it can't do because it's running. Updated the version on SpacePort to solve that.

Link to comment
Share on other sites

Whatever you did: it identifies the mod, the download works, it installs but when it restarts KSP hangs right out the gate.

Here's the KSP Log:

======================================= Begin Log =======================================

Kerbal Space Program - 0.22.0.351 (WindowsPlayer)

OS: Windows 7 Service Pack 1 (6.1.7601) 64bit

CPU: Intel® Core i7-2600K CPU @ 3.40GHz (8)

RAM: 16282

GPU: NVIDIA GeForce GTX 260 (869MB)

SM: 30 (Direct3D 9.0c [nvd3dum.dll 9.18.13.3165])

Log started: Fri, Nov 15, 2013 05:51:39

[LOG 05:51:41.338] AssemblyLoader: Loading assembly 'KSP'

[ERR 05:51:41.700] Error: Empty part config file

[EXC 05:51:41.706] NullReferenceException: Object reference not set to an instance of an object

======================================= End Log =======================================

The splash screen comes up. The loading bar starts turning yellow; then bam, it doesn't go any further.

It looked like this before the update:

======================================= Begin Log =======================================

Kerbal Space Program - 0.22.0.351 (WindowsPlayer)

OS: Windows Vista (6.0.6000) 64bit

CPU: Intel® Core i7-2600K CPU @ 3.40GHz (8)

RAM: 16282

GPU: NVIDIA GeForce GTX 260 (869MB)

SM: 30 (Direct3D 9.0c [nvd3dum.dll 9.18.13.3165])

Log started: Thu, Nov 14, 2013 23:42:22

[LOG 23:42:23.514] AssemblyLoader: Loading assembly 'KSP'

[LOG 23:42:24.651] Load(Assembly): KerbalUpdater/Plugins/ICSharpCode.SharpZipLib

[LOG 23:42:24.653] AssemblyLoader: Loading assembly at C:\Games\Kerbal Space Program v0.22\GameData\KerbalUpdater\Plugins\ICSharpCode.SharpZipLib.dll

[LOG 23:42:24.700] AssemblyLoader: Loading assembly 'C:\Games\Kerbal Space Program v0.22\GameData\KerbalUpdater\Plugins\ICSharpCode.SharpZipLib.dll'

[LOG 23:42:24.704] Load(Assembly): KerbalUpdater/Plugins/KerbalUpdater

[LOG 23:42:24.705] AssemblyLoader: Loading assembly at C:\Games\Kerbal Space Program v0.22\GameData\KerbalUpdater\Plugins\KerbalUpdater.dll

[LOG 23:42:24.706] AssemblyLoader: Loading assembly 'C:\Games\Kerbal Space Program v0.22\GameData\KerbalUpdater\Plugins\KerbalUpdater.dll'

[LOG 23:42:24.714] Load(Audio): Squad/Parts/Utility/LandingLeg/sounds/sound_servomotor

[LOG 23:42:24.783] Load(Audio): Squad/Sounds/editorLoop01

[LOG 23:42:26.039] Load(Audio): Squad/Sounds/sound_ambience_nature

[LOG 23:42:26.135] Load(Audio): Squad/Sounds/sound_click_flick

[LOG 23:42:26.168] Load(Audio): Squad/Sounds/sound_click_latch

[LOG 23:42:26.201] Load(Audio): Squad/Sounds/sound_click_sharp

[LOG 23:42:26.234] Load(Audio): Squad/Sounds/sound_click_tick

[LOG 23:42:26.268] Load(Audio): Squad/Sounds/sound_click_tock

[LOG 23:42:26.301] Load(Audio): Squad/Sounds/sound_decoupler_fire

[LOG 23:42:26.351] Load(Audio): Squad/Sounds/sound_delete_bin

[LOG 23:42:26.401] Load(Audio): Squad/Sounds/sound_explosion_debris1

[LOG 23:42:26.468] Load(Audio): Squad/Sounds/sound_explosion_debris2

[LOG 23:42:26.535] Load(Audio): Squad/Sounds/sound_explosion_large

<snip>

======================================= End Log =======================================

Link to comment
Share on other sites

Whatever you did: it identifies the mod, the download works, it installs but when it restarts KSP hangs right out the gate.

Here's the KSP Log:

<snip>

I've been trying for a while now, but I can't seem to replicate this issue. Just to make sure, you have a new install of KSP, a fresh download of Kerbal Updater, and this is occurring?

Link to comment
Share on other sites

Very cool!

I don't suppose you could support places other than spaceport?

(Says the guy who doesn't use spaceport for his mods...)

I can, but I figured spaceport was the most common. Suggestions for other locations? It needs to have a central repo-type location, so just a link to a zip file on a forum post won't work too well.

Link to comment
Share on other sites

  • 2 weeks later...
Hmm, thanks for reporting this. It should behave like the former, but given your screenshot, it will behave like the latter. I did add a condition for the GameData folder like that, so I'll check that one more time, specifically against the KMP plugin to see if it's working properly.

EDIT: I can't seem to reproduce the issue. I get Staging\KMP, ie it extracted from the GameData directory properly? You're using http://kerbalspaceprogram.com/kmp-client/, correct?

Sorry for the slow reply! Yes that is correct. I'm now testing on Windows so I'll let you know how that goes.

Link to comment
Share on other sites

Lucchese, if you gave some level of information in your previous post, people would be able to help you. As is, it looked more like a half-hearted troll attempt.

1) You don't specify HOW it doesn't work. Does the menu not show up ingame? Does it show, but only filled with a text error?

2) What mods do you have installed?

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...