• Hello Guest!

    We have recently updated our Site Policies regarding the use of Non Commercial content within Paid Content posts. Please read the new policy here.

    An offical announcement about this new policy can be read on our Discord.

    ~The VaMHub Moderation Team
  • Hello Guest!

    We posted an announcment regarding upcoming changes to Paid Content submissions.

    Please see this thread for more information.

Resource icon

Other [Utility] VAMUpdater - Always Use the Latest Addons!

venkman

Well-known member
Messages
84
Reactions
363
Points
53
venkman submitted a new resource:

[Utility] VAMUpdater - Always Use the Latest Addons! - Breathe New Life Into Your Scenes!

View attachment 132408

VamUpdater is a command-line utility I created to solve an annoyance...which is that the "default" for the VAM Package Builder is to use the specific version of a script as it was when the scene was packaged, versus requiring the latest version.


While I somewhat understand the logic of doing this (We don't want an updated script to break changes), the reality of the situation is that *most* plugins are more or less backwards compatible with old...

Read more about this resource...
 
Got an error. :cry:

Code:
Unhandled exception. System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at VamUpdater.Program.ListAddons(String path) in E:\dev\VamUpdater\VamUpdater\Program.cs:line 129
   at VamUpdater.Program.Main(String[] args) in E:\dev\VamUpdater\VamUpdater\Program.cs:line 69

But my path is:
Code:
C:\spiele_sonst\VAM\Venkman.VamUpdater.1
 
Got an error. :cry:

Code:
Unhandled exception. System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at VamUpdater.Program.ListAddons(String path) in E:\dev\VamUpdater\VamUpdater\Program.cs:line 129
   at VamUpdater.Program.Main(String[] args) in E:\dev\VamUpdater\VamUpdater\Program.cs:line 69

But my path is:
Code:
C:\spiele_sonst\VAM\Venkman.VamUpdater.1

That is...odd.

Try moving the Venkman.Vamupdater.1 directory outside of the VAM folder.
 
I can´t open this program when I clicked on it, nothing happend? :( Please help out.
 
Yes, I did. Nothing happend, the program dosen´t open when I licked the VamUpdater.exe file

Hold down shift and right-click in the folder next to VamUpdater (in the white space), then pick "Open command prompt here" or "open powershell here" (depending on your OS). Once the window opens up, type .\VamUpdater.exe, see if it's grumbling about something else.
 
Thaks for the tips but it dosen´t work for me...I tried evertyhing. Downloaded the softwarer from microsoft..still not help, I guess this prog needs a fix.



I swear, the program works. M$ is just picky about which runtime you use with it. I could bundle the whole program in "stand alone" mode, but then it's much much bigger.

If you run it from command-line (as it's meant to be run),any missing dependencies or errors should be shown on the screen.
 
Hey. I've had the same thing nagging in the back of my head. It went over my scenes fine but after running over most of the var packages, it throws an error at me:
Code:
Unhandled exception. System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at VamUpdater.Program.ListAddons(String path) in E:\dev\VamUpdater\VamUpdater\Program.cs:line 129
   at VamUpdater.Program.Main(String[] args) in E:\dev\VamUpdater\VamUpdater\Program.cs:line 69

Also, this changes the creation date of all files it touches. Would be super nice if it were possible to keep the original creation dates of the files since I mostly let VAM sort my scenes by "New to old".
And backing up entire .var files seems like wasting space. Although reverting is more user friendly this way. Still, so many gigabytes of disk writes just to keep track of text files.

Great potential, keep it up (y)

---
Edit 3h later:

I believe that I found your bug. In the section where you're comparing the found filename with target plugins, you've made the assumption that filenames have two or more parts like "author.name.version.var" but in case the filename is just "name.var" the out of range error occurs since there is no index [1] :

Rich (BB code):
string[] strArray2 = Path.GetFileName(str.ToLower()).Replace(".var", "").Split(".");
            if (string.Join(".", new string[2]
            {
              strArray2[0],
              strArray2[1]
            }) == key)

So.. Go through your vars and make sure they are properly named as a workaround for now..
 
Last edited:
Hey. I've had the same thing nagging in the back of my head. It went over my scenes fine but after running over most of the var packages, it throws an error at me:
Code:
Unhandled exception. System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at VamUpdater.Program.ListAddons(String path) in E:\dev\VamUpdater\VamUpdater\Program.cs:line 129
   at VamUpdater.Program.Main(String[] args) in E:\dev\VamUpdater\VamUpdater\Program.cs:line 69

Also, this changes the creation date of all files it touches. Would be super nice if it were possible to keep the original creation dates of the files since I mostly let VAM sort my scenes by "New to old".
And backing up entire .var files seems like wasting space. Although reverting is more user friendly this way. Still, so many gigabytes of disk writes just to keep track of text files.

Great potential, keep it up (y)

---
Edit 3h later:

I believe that I found your bug. In the section where you're comparing the found filename with target plugins, you've made the assumption that filenames have two or more parts like "author.name.version.var" but in case the filename is just "name.var" the out of range error occurs since there is no index [1] :

Rich (BB code):
string[] strArray2 = Path.GetFileName(str.ToLower()).Replace(".var", "").Split(".");
            if (string.Join(".", new string[2]
            {
              strArray2[0],
              strArray2[1]
            }) == key)

So.. Go through your vars and make sure they are properly named as a workaround for now..

Thanks for the pointer! I'll fix this code side.

As far as changing the modified date, I'll toss a flag in to ensure this only happens if specified. Seemed like a good idea at the time, now, maybe not so much.

And for the backup stuff...I agree, it *could* be done in a more optimal manner, but as you pointed out, it then becomes more difficult to restore things in the case of breakage. I'll think on it and see if I can come up with a better way that doesn't require another program...
 
venkman updated [Utility] VAMUpdater - Always Use the Latest Addons! with a new update entry:

Fixes, Improvements, Implement Feedback

Fixed:

Index out of bounds error if a VAR file is improperly named.
Add a "-D" flag to specify updating file modified date, otherwise, it will be re-set after updating archives/scenes.
Create several .bat files so if people happen to have .net runtime errors, it will show them, versus just open and close the window.

Changed:
Backups of var files are now done on a per-json basis. Meaning, if you need to restore a VAR file, you'll need to open the file as a zip, then copy the contents from...

Read the rest of this update entry...
 
Awesome utility pal! Can you make it scan recursive for vars? It scanned all scene json local files fine but only vars in root of Addons folder. I have all my vars in folders by creator and it scanned zero unless in root. Also it seems it will only work if the meta.json has dependency refs that need updating. Is it possible to add a flag to scan all vars even with no dependencies in meta.json file? I removed all dependencies from my meta.json since I have a utility that reads all json missing refs inside vars so it is a more accurate for missing dependencies. Thanks!
 
Awesome utility pal! Can you make it scan recursive for vars? It scanned all scene json local files fine but only vars in root of Addons folder. I have all my vars in folders by creator and it scanned zero unless in root. Also it seems it will only work if the meta.json has dependency refs that need updating. Is it possible to add a flag to scan all vars even with no dependencies in meta.json file? I removed all dependencies from my meta.json since I have a utility that reads all json missing refs inside vars so it is a more accurate for missing dependencies. Thanks!

Can do!

Will drop an update tonight or tomorrow to incorporate these.
 
So i was using this updater yesterday and it all seemed to be working fine up until my drive ran out of space (didn't think of the backups made), I ran in past stage one and stage 2 up into around half an hour (big folder).
After that i've been getting this error every time i load.
VamUpdaterError.jpg

I've tried restarting, renaming my vam folder, moving the updater, running in powershell, installed both runtime too. Nuffin.
Also the directory in the last 3 lines makes no sense, i don't even have a E:\ drive.
 
Last edited:
So i was using this updater yesterday and it all seemed to be working fine up until my drive ran out of space (didn't think of the backups made), I ran in past stage one and stage 2 up into around half an hour (big folder).
After that i've been getting this error every time i load.
View attachment 133039
I've tried restarting, renaming my vam folder, moving the updater, installed both runtime too. Nuffin.
Also the directory in the last 3 lines makes no sense, i don't even have a E:\ drive.

Looks like one of the archives got toasted, and it's choking on it. I'll add a try/catch to fix this error breaking everything.

I'd look in the backups directory, see if you can find the last folder created (should be alphabetical), that might clue you into which addonpackage is broken.

You could also try looking in your addonpackage directory for a very small addon.

Sorry about the trouble. Rome wasn't built in a day. :p
 
Sorry about the trouble. Rome wasn't built in a day. :p
No worries mate, your effort is much appreciated.
I've tried moving last backuped archives but nothing.
After i've renamed the backup folder and it seems to work !
At Least it started making new backups, so i assume it's working. Seems also way slower this time around, maybe cuz i ran it in powershell.
 
Is there any way to implement an output/input log? I am getting an error when I run VamUpdater, but there are so many .vars to slog thru to check they are all named properly. A log that shows the .var and the reason for the exception would be super handy (such as what needs to be fixed, if it a naming issue or a corruption issue, etc). I may just be thick, but I can't figure out where the issue is. I see no difference between the naming structure of the .var or included meta.json to that of the .var just before the error with any of the .vars before or after it. Any help would be appreciated.

Edit: I'm not a coder by any means, but is there a possibility to add in a fail safe? If a .var is either corrupt or improperly named, is there a way to effectively "skip" to the next instead of what happens now, and maybe add a section to the (I'm assuming as I've never made it this far) post-run txt log that enumerates the skipped .vars and the reason?

Screenshot 2022-06-24 155237.png
 
Last edited:
Is there any way to implement an output/input log? I am getting an error when I run VamUpdater, but there are so many .vars to slog thru to check they are all named properly. A log that shows the .var and the reason for the exception would be super handy (such as what needs to be fixed, if it a naming issue or a corruption issue, etc). I may just be thick, but I can't figure out where the issue is. I see no difference between the naming structure of the .var or included meta.json to that of the .var just before the error with any of the .vars before or after it. Any help would be appreciated.

Edit: I'm not a coder by any means, but is there a possibility to add in a fail safe? If a .var is either corrupt or improperly named, is there a way to effectively "skip" to the next instead of what happens now, and maybe add a section to the (I'm assuming as I've never made it this far) post-run txt log that enumerates the skipped .vars and the reason?

View attachment 133152

Are you using the latest version of the application? This looks like it's in a place where I already fixed a problem, but maybe not.

I've pushed another update (V5), just in case. Give that a whirl, let me know if you still have problems.
 
Are you using the latest version of the application? This looks like it's in a place where I already fixed a problem, but maybe not.

I've pushed another update (V5), just in case. Give that a whirl, let me know if you still have problems.
Yes. I was using v4 when I recieved that error. I am currently running v5, so I will let you know if the error persists. Thank you so much for the response, btw!

Edit: You are a genius, venkman! It now works for me! Thank you so very much!
 
Last edited:
Back
Top Bottom