Jump to content

Adding small dll to Parts-Only mods to verify install loc


linuxgurugamer

Recommended Posts

4 minutes ago, paul23 said:

Like I said: I might have a filesystem where the files aren't there on "loading" and only later are there. Or I might use some linkage that the game understands but the way you check for existance does not. Or I might work over a network drive... I've seen lots of times when it should be unobtrusive, and it is at first sigh, but in the end it turns out to be a pain in the ass.

How could the files not be there on loading?  You are presenting some vague unknowns without having bothered to read and understand the post I made here 5 hours ago, I'll provide the link so you don't have to search for it:

https://forum.kerbalspaceprogram.com/index.php?/topic/189164-adding-small-dll-to-parts-only-mods-to-verify-install-loc/&do=findComment&comment=3693171

Please point out which of the following statements is wrong, I'd really like to know:

  1. The DLL has to be there when it loads
  2. The directory the DLL is in has to be there when it loads
  3. The path to the DLL is available when the DLL loads

If these three statements are true, then the method I'm using to check will work.  So I ask again, how will this discomfort the user? 

Regarding the user, using the word "foolish" is insulting to them.  It's an honest mistake which anyone can make.  This is a simple protection for them.

But, if you don't like it, you are free to remove the dll

Link to comment
Share on other sites

1 minute ago, linuxgurugamer said:

@DStaal @Nertea

I'm thinking about the change to the .version file.  I'm thinking of something along these lines:


	"INSTALL_LOC":
	{
		"FILE":         "fileName",
		"DIRECTORY":    "dirName",
		"MESSAGE":      "message to display"
	}

If multiple files would need to be checked:


	"INSTALL_LOC_1":
	{
		"FILE":         "fileName",
		"DIRECTORY":    "dirName",
		"MESSAGE":      "message to display"
	},
	"INSTALL_LOC_2":
	{
		"FILE":         "fileName",
		"DIRECTORY":    "dirName",
		"MESSAGE":      "message to display"
	},

 

The message line would  be optional, if not there, then a generic message with the mod name and other appropriate info would be displayed

Yeah that looks nice. I assume that I could do directories in the filespec, like so?

	"INSTALL_LOC_1":
	{
		"FILE":         "NearFutureElectrical",
		"DIRECTORY":    "GameData/NearFutureElectrical",
		"MESSAGE":      "message to display"
	},
Link to comment
Share on other sites

5 minutes ago, Nertea said:

Yeah that looks nice. I assume that I could do directories in the filespec, like so?


	"INSTALL_LOC_1":
	{
		"FILE":         "NearFutureElectrical",
		"DIRECTORY":    "GameData/NearFutureElectrical",
		"MESSAGE":      "message to display"
	},

Yes.  I'll be more specific when I publish specs, such as the starting point for DIRECTORY, etc.  Can you think of anything else you'd like to check on? 

While it may be redundant, the thought occurred to me that adding dependency checking here might be useful.  OTOH, I don't want this to be a burden on authors.

Edit:  I realized I don't need a seperate section for dependencies; this would work quite well as is

Edited by linuxgurugamer
Link to comment
Share on other sites

I'm viewing this as effectively able to do dependency checking - if I specify multiple INSTALL_LOC blocks I could check existence of MM, B9PS, etc with a similar syntax.

I guess it (like version files) is clearly optional too, no need for the user to have the mod installed - it just silently does nothing. Same if a mod author hasn't configured these directories. So minimal burden.

Link to comment
Share on other sites

8 minutes ago, Nertea said:

I'm viewing this as effectively able to do dependency checking - if I specify multiple INSTALL_LOC blocks I could check existence of MM, B9PS, etc with a similar syntax.

I guess it (like version files) is clearly optional too, no need for the user to have the mod installed - it just silently does nothing. Same if a mod author hasn't configured these directories. So minimal burden.

I was planning on adding these lines to the .version file, and then to update AVC with what's needed to implement this.  Trying to not add unnecessary mods

Link to comment
Share on other sites

On 10/22/2019 at 12:57 AM, severedsolo said:

I think this is a good idea.

Not to steal your thunder, but as I already have a mod that checks whether other mods have problems I could add this as a feature if you like?

My initial thoughts are: "MM patch that lets the mod author define a path where the mod is supposed to be, and if it's not there pop up a warning" (but I've literally thought about it for 5 seconds so there may well be another/better way)

I've been thinking about this.  I think it would make sense for your mod which is checking for problems regarding installed DLLs, also have the ability to check for missing files as listed in the .version file.

I'm going to see if I can whip up a class(s) to check this evening, will contact you if/when I have a working file

Link to comment
Share on other sites

3 hours ago, paul23 said:

Like I said: I might have a filesystem where the files aren't there on "loading" and only later are there. Or I might use some linkage that the game understands but the way you check for existance does not. Or I might work over a network drive... I've seen lots of times when it should be unobtrusive, and it is at first sigh, but in the end it turns out to be a pain in the ass.

You're using a demand for a fully general file system solution for a context that doesn't need it.  For a game that is in the large part all installed in one file system already mounted at the time the main program is launched.  If all of the subdirectories *aren't* mounted when KSP is launched, that's a problem of the operating system install and configuration, because it breaks a requirement of KSP.  And it should be obvious from the number of "file not found" errors it will produce.

Link to comment
Share on other sites

8 hours ago, linuxgurugamer said:

That would be fine if people weren't busily deleting all the MiniAVC.dll files and not installing the full AVC mod.

If people are already deleting MiniAVC.dll (I'm one of them, though I also know what I'm doing and thus wouldn't bother you. :V) then it stands to reason they would also just delete this hypothetical new DLL also and you would be back at square one.

I second Nertea's proposal of adding this as a new feature to .version files and plugins that read those files (MiniAVC/AVC), it accomodates your desire for directory structure checks without adding more bloat to the /GameData directory.

Link to comment
Share on other sites

27 minutes ago, King Arthur said:

If people are already deleting MiniAVC.dll (I'm one of them, though I also know what I'm doing and thus wouldn't bother you. :V) then it stands to reason they would also just delete this hypothetical new DLL also and you would be back at square one.

I second Nertea's proposal of adding this as a new feature to .version files and plugins that read those files (MiniAVC/AVC), it accomodates your desire for directory structure checks without adding more bloat to the /GameData directory.

It could be argued that anyone that is knowledgeable enough to know how to delete an individual DLL from their modded install, also probably has figured out the proper way to "install" a mod.  So in those cases it doesn't really create a problem.

The DLL would be useful for those who have no clue how to copy a mod into their gamedata folder, and usually have to be spoonfed how to even find and post their log file.

Link to comment
Share on other sites

excellent point:

another idea: each mod patches in their location via MM to the one dll.

missed some posts.

 

.version file idea I like.

14 hours ago, zer0Kerbal said:

why not one .dll, and have each mod include a .txt file to work with it? I like that better - only one copy of the .dll.

heck, the .version file should have enough information to start with

 

so the new .dll reads the .version files, and check to see if installed correctly. or something like that.

*chuckle* especially since it was my idea. :P  or at least the seed.

On 10/23/2019 at 1:03 AM, paul23 said:

Are you now crawling my whole pc looking for files?

actually - it cannot or it violates Squad addon rules.

14 hours ago, linuxgurugamer said:

What I'll do is get out a specification in the next day or so as to what it will be, so that people can start adding it now for when it is released.  Probably just a one liner, but I want to make sure I cover all bases

This I like, and if/once a specification is solidified, I will start using it and adding it to my motley salmagundi smorgasbord of mods.

Edited by zer0Kerbal
Link to comment
Share on other sites

5 hours ago, goldenpsp said:

It could be argued that anyone that is knowledgeable enough to know how to delete an individual DLL from their modded install, also probably has figured out the proper way to "install" a mod.  So in those cases it doesn't really create a problem.

and there is already a mod the autoremoves them. :o

5 hours ago, goldenpsp said:

The DLL would be useful for those who have no clue how to copy a mod into their gamedata folder, and usually have to be spoonfed how to even find and post their log file.

yes.

Edited by zer0Kerbal
Link to comment
Share on other sites

Ok, I've gotten it working as a stand-alone mod for now.  I've enhanced what I wrote earlier a bit.

Specs are below, please provide feedback:

InstallValidator

JSON stanza(s) located in the .version file.

	"INSTALL_LOC":
	{
		"NAME":         "modname",		// optional
		"PATH":         "path",
		"DIRECTORY":    "dirName",
		"FILE":         "fileName",		
		"MESSAGE":      "message to display"
	}

Multiple stanzas can be listed, as long as each has a unique suffix and starts with INSTALL_LOC_.  The 
suffix can be anything you want. It would look like this:

	"INSTALL_LOC_1":
	{
		"NAME":         "modname",		// optional
		"PATH":         "path",
		"DIRECTORY":    "dirName",
		"FILE":         "fileName",
		"MESSAGE":      "message to display"
	}

	NAME		If not specified, uses the Modname from the .version file. 
	PATH		Path to the directory, begins below the GameData
	DIRECTORY	Directory where file is.
	FILE		filename to be checked
	MESSAGE		Optional, if there will be used instead of default message
				Message can have the following substitutions
					<MODNAME>	name of mod
					<FIELD>		replace with either "File", "Directory", "Path"
					<FILE>		replace with fileName
					<DIRECTORY>	replace with dirName
					<PATH>	    replace with path
					<STANZA>	replace with the stanza name

				Default message is:
					
					<MODNAME> + " has been installed incorrectly and will not function properly. All files should be located in KSP/GameData/" + <DIRECTORY>
					
                  
Note that when checking for the existance of a file, the FILE, PATH & DIRECTORY are concatted together as follows:

	PATH/DIRECTORY/FILE

This does imply that you could use only one of either PATH or DIRECTORY, if you put the complete path in that entry

 

Link to comment
Share on other sites

@linuxgurugamer I guess mebbe just a matter of semantics, but since the idea is too make this as simple and easy as possible for people who have the least amount of knowledge of how and where mods go for KSP, and seemingly little computer literacy (not meant to sound in a bad or judgemental way), may I suggest a small tweak to your message to the user?

Since stock installs of KSP use different folder naming for the 3 available OSes, and for those who may name them differently, mebbe make this tiny tweak? vOv

 

this: .... All files should be located in KSP/GameData/" + <DIRECTORY>

to this:  .... All files should be located in <KSP install folder>/GameData/" + <DIRECTORY>

or something to that effect... I'm just thinking instead of someone who doesnt know better, looking for the *exact* folder name of "KSP/GameData", which doesnt exist unless someone *actually* chnaged it to that on their own... vOv

Edited by Stone Blue
Link to comment
Share on other sites

7 minutes ago, Barzon said:

Mind telling me what that is?

ZeroMiniAVC
 

i only recommend this for people who really know how to manually install mods and/or manipulate the /GameData folder responsibly,
*OR* those people who install the full version of KSP AVC.
 

Link to comment
Share on other sites

16 hours ago, Jacke said:

You're using a demand for a fully general file system solution for a context that doesn't need it.  For a game that is in the large part all installed in one file system already mounted at the time the main program is launched.  If all of the subdirectories *aren't* mounted when KSP is launched, that's a problem of the operating system install and configuration, because it breaks a requirement of KSP.  And it should be obvious from the number of "file not found" errors it will produce.

Actually (before I had q 1 GB ssd) I used to hardlink from the main install folder to an external drive.

Link to comment
Share on other sites

@linuxgurugamer if you go with adding this to .version files and KSP AVC/MiniAVC, any chance of maybe adding a switch in KSP AVC, to ignore warnings for specific mods, when the install directory doesnt match?

Just thinking like adding it to, and in addition to the compatability overide GUI, for peeps who mod their mod installs... :P

I kno that can open up a whole can of worms for peeps who *dont* know what they are doing, and just turn off the warnings, because seeing a warning popup while the game is loading anyway, seems to bug them... :roll_eyes: ... but, idk... vOv ... I havent fully thought thru the pros/cons of doing that, and just thought I would mention it as something to consider :P

Overall, I *like* the whole premise... ;)

EDIT: hmm.. just thought, mebbe havit add a line in the log, right after the line it adds for each mod, stating that the check is indeed turned off...
and if it shows that, and hence no support should be expected for issues with that mod when posts up their log... vOv

Edited by Stone Blue
Link to comment
Share on other sites

58 minutes ago, Barzon said:
 

Mind telling me what that is?

Actually, @Malahturned it over to me, latest version is here https://spacedock.info/mod/1614/ZeroMiniAVC

I dont know why @DoctorDavinci released a version when I've  been supporting this since 1.3.  My version is available via CKAN

36 minutes ago, Stone Blue said:

if you go with adding this to .version files and KSP AVC/MiniAVC, any chance of maybe adding a switch in KSP AVC, to ignore warnings for specific mods, when the install directory doesnt match?

Not going to be in AVC or MiniAVC.  Either it will be a standalone, or added to MADLAD.

This is not meant to be intrusive.  Most players won't even know about it, and for the 0.01% who are smart enough to rename folders intelligently will be smart enough to not install MADLAD

6 minutes ago, DStaal said:

Something in the back of my mind is trying to say something about dependencies you don't control, but I'm not exactly sure what it is.  Otherwise looks good

Questioning minds want to know.  This will be another way to make sure all dependencies are installed

Link to comment
Share on other sites

29 minutes ago, Stone Blue said:

@linuxgurugamer if you go with adding this to .version files and KSP AVC/MiniAVC, any chance of maybe adding a switch in KSP AVC, to ignore warnings for specific mods, when the install directory doesnt match?

Just thinking like adding it to, and in addition to the compatability overide GUI, for peeps who mod their mod installs... :P

It's looking more like it's going to be in MADLAD - but either way I'm against this.  Additional complexity, and if you know what you're doing to be able to move mods around you should know enough to either ignore this warning or to be able to edit/remove the .version files.

On the specs: Something in the back of my mind is trying to say something about dependencies you don't control, but I'm not exactly sure what it is.  Otherwise looks good.  ;)

Link to comment
Share on other sites

2 hours ago, Stone Blue said:

Since stock installs of KSP use different folder naming for the 3 available OSes, and for those who may name them differently, mebbe make this tiny tweak? vOv

 


this: .... All files should be located in KSP/GameData/" + <DIRECTORY>

to this:  .... All files should be located in <KSP install folder>/GameData/" + <DIRECTORY>

or something to that effect... I'm just thinking instead of someone who doesnt know better, looking for the *exact* folder name of "KSP/GameData", which doesnt exist unless someone *actually* chnaged it to that on their own... vOv

That's actually the message I pulled from the InstallChecker.cs, which I've been adding to all my mods (code-based mods).  It's a good idea, thanks

Link to comment
Share on other sites

5 minutes ago, zer0Kerbal said:

is there a place for boilerplate code (like IntallChecker.cs) - a community supported / github repo? cause right now I am not sure which version I am using of boilerplate, and where/which is most up-to-date?

If there isn't, might I suggest one?

There isn't any "boilerplate" code, other than what individual people keep for themselves.  All of my personal boilerplate is here:  https://github.com/linuxgurugamer/KSP-Build-Scripts  and it's up-to-date, but is obviously specific to me

Link to comment
Share on other sites

12 hours ago, DStaal said:

It's looking more like it's going to be in MADLAD - but either way I'm against this.  Additional complexity, and if you know what you're doing to be able to move mods around you should know enough to either ignore this warning or to be able to edit/remove the .version files.

Hmmm... I've been using MADLAD since it first came out. I like to use it in testing/troubleshooting my modded mod installs :P

Also, I thought modifying .version files *usually* breaks KSP AVC checking, if the file doesnt match the hosted one exactly? And I definately wouldnt want to *ever* uninstall .version files... I use KSP AVC to keep me up to date on my manually installed mods, as well as quite often opening and checking them myself for version reference.

So for me, it would have to be ignoring the warning :P

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