RELEASED Stardew Valley Package Manager - v1.11 with Save Backup and XNB Image Merge 1.16

SVPM is a tool which allows Users to easily modify Stardew Valley with User created mods.

  1. NewSpecies

    NewSpecies Industrial Terraformer

    NewSpecies submitted a new mod:

    Stardew Valley Package Manager - SVPM is a tool which allows Users to easily modify Stardew Valley with User created mods.

    Read more about this mod...

    If you have any suggestions for what you'd like to see in the application, or what could be improved then just leave a comment.

    Version 1.10 (Through Update)
    - SVPM now recognises the sub-directories of directories that contains DLL files as part of the DLL mod data, and now loads those mods properly. It also ignores those directories when checking their names against existing Stardew Valley data, preventing any unnecessary pop-up checks.
    - Save and Load features added for the Active Mod List. Allowing you to save and load active mod listings.


    [​IMG]

    [​IMG]




    Version 1.09
    - Add the ability for SVPM to launch SMAPI \ Storm from Steam Desktop Shortcut Links. Allowing Steam to load those applications directly and inject the Steam Overlay. (Links can be added in SVPM Settings)
    - General Big Fixes

    Version 1.08
    - Fixed bug where program crashes on launch because Steam and Game are installed on different drives.
    - XMB Image Merge now supports differently sized images for mods that extend the tilesheets.
    - Added a game files restore feature.
    - General bug fixes.

    Version 1.07
    - Added XNB Image Merge feature – Enable in Settings Menu. XNB Image Merge is a process that scans your active mods for image resources that overwrite the same XNB file in the Stardew Valley folder, and creates a composite image XNB files. These composite XNB's are then loaded like a normal mod. This allows multiple mods to edit the same tile sheets, and make their own contributions to the output image the game uses.

    Version 1.05 - 1.06
    - Right clicking on an active\inactive mod containing a DLL will reveal the one or more DLL mods present in the archive, and list config files associated with them. Clicking on the DLL's config files will launch that file with your systems default editor, allowing you to edit the mod config directly.
    - The Save Settings button is now a button for general settings, including both save settings and program settings.
    - Modification Information window appears when a mod is downloading, allowing the user to edit the information. This option can also be disabled.
    - Bug Fixes, slightly extended browser functionality, auto-save of saves is now turned on by default and set at 5 save files per profile.
    - When DLL mod is deactivated, only the .dll, .xna and manifest.json file(s) are taken. Hopefully leaving all the other config files.

    Version 1.04 – ChangeLog
    - Hovering over the “Install Build” buttons will now reveal the last version of that API installed.
    - Added auto-save features for backing up save files automatically, as well as the ability to restore a save point.

    Version 1.03 - ChangeLog
    - When generating manifest for DLL's without them, it now checks the dll's data for library references. Identifying what kind of API it uses, preventing non-API dll's from being loaded.
    - Improved internal browser with web bar, and tabbed browsing.

    Version 1.02 - ChangeLog
    - DLL's can now support dll libraries. Checks the manifest to show which dll in a single directory takes precedence.
    - XNBs that are in the same directory as a .DLL will be copied into the DLL mod's directory automatically.
    - .json files (sans manifest.json) won't be deleted when DLL mods are disabled, preserving settings files when mods are turned on and off.

    Version 1.01 – ChangeLog
    - Added the ability to load xnb files that don't have corresponding matches to the Stardew Valley folder, as well as remove them when the mods become inactive.


    Alternative Download Location: http://www.nexusmods.com/stardewvalley/mods/337/
     
      Last edited: Oct 13, 2016
    • yuukiw

      yuukiw Scruffy Nerf-Herder

      just out of interest, how do you handle the xnb files?
       
      • NewSpecies

        NewSpecies Industrial Terraformer

        Individually, as mods, it doesn't. It just deals with archives that contain xnbs, or folders that contain xnbs. You can always zip them up before adding. If the xnb's are downloaded through the browser however, it will prompt you for a new mod name, and create a new zip mod with the file inside. Or, allow you to select a current mod to add the file to it.

        The reason I didn't add xnb as a filter option when selecting files in "Add Mod Package" (I did at first). Was that many mods have files in different directories, and having to resolve many dependencies is more time consuming then just zipping up a folder manually and adding it. :p
         
        • yuukiw

          yuukiw Scruffy Nerf-Herder

          but how do you know where the xnb belongs?

          Anyways nice and clean ui^^
           
          • NewSpecies

            NewSpecies Industrial Terraformer

            The program keeps a dictionary of the filenames with a delimitered string of directories those files exist in.

            cat.xnb -> "filepath\cat.xnb;filepath2\cat.xnb"
            filename.xnb -> "path\filename.xnb;path2\filename.xnb"
            etc...

            And it searches for a match backwards. So a file in the archive like \blah\my stuff\Portraits\Alex.xnb will match Content\Portraits\Alex.xnb


            Thank you. :)
             
            • yuukiw

              yuukiw Scruffy Nerf-Herder

              the problem with this is that some xnb names are given to files in more then on folder.
              Or if the mod creator just zips the xnb not the strcutur?
              Do you take that in account?

              Also a few suggestion:

              - Skip the dll copy instance when neither Storm or Smapi are selected.
              - automate the smapi /storm update process (meaning that you the user doesnt need to interact with another browser)
               
              • NewSpecies

                NewSpecies Industrial Terraformer

                It takes that in to account. If a zip just contains a file like "alex.xnb" in the root directory, it's going to match many folders in the Stardew Content folder. Of course. So it's going to prompt you asking which one it belongs in, and when you select the folder it belongs in it then moves the xnb to Content\...\Alex.xnb inside the zip. For the browser, downloading a random xnb, unless it's downloading a file with just 1 match in the Stardew folder. It'll likely prompt asking where it goes.

                >Skip dll copy instance when no api used
                - Done
                >automate update for api's
                - I thought about that, but I like the ability to install older builds because sometimes the newer ones can break. Like, look at the current storm build (http://storm.handsomematt.co.uk/builds/). It doesn't even have a folder for injectors, and breaks when you run it. :p The next one down works fine and has all the files though.
                 
                  Last edited: Apr 13, 2016
                • yuukiw

                  yuukiw Scruffy Nerf-Herder

                  You could Parse all version linka and let the User choose the wanted version.

                  Or just load the latest stable which is fairly easy to implement.
                   
                  • NewSpecies

                    NewSpecies Industrial Terraformer

                    I've frequently done web scraping using regex with other applications, so it would be easy to implement for sure. :p The downside to doing that is if the url's html changes, or the build urls change (which can be done by editing SVPM.ini, if you want to point it to another build website); the whole update process breaks.

                    - Finished adding features which allow mod archives to add new xnb files to the Stardew folder which didn't have matches (providing they have some kind of directory structure).
                     
                    • yuukiw

                      yuukiw Scruffy Nerf-Herder

                      Not per say. You could use githubs api
                      Visual basic, much Potential for optimizaiton.
                      Code:
                      vate Sub checkSmapiUpdate()
                              Dim c = 1
                              Dim x As String = ""
                              Try
                                  If System.IO.File.Exists(appPath & "\Update\StardewModdingAPI.exe") Then
                                      If MsgBox("SMAPI Update Available! Do you want to download the update SMAPI now?", MsgBoxStyle.YesNo) = DialogResult.Yes Then
                                          Call Update()
                                      End If
                                  End If
                                  If IO.Directory.Exists(appPath & "\Update\") Then
                                      Dim Check = Directory.GetFiles(appPath & "\Update\", "*.zip")
                                      If Check.Length = 1 Then
                                          If MsgBox("SMAPI Update Available! Do you want to download the update SMAPI now?", MsgBoxStyle.YesNo) = DialogResult.Yes Then
                                              Dim fileEntries As String() = Directory.GetFiles(appPath & "\Update\", "*.zip")
                                              Dim sOnlyFileName As String
                                              For Each sFileName In fileEntries
                                                  sOnlyFileName = System.IO.Path.GetFileName(sFileName)
                                              Next
                                              zip(appPath & "\Update\" & sOnlyFileName, appPath & "\Update\", 1, True)
                                          End If
                                      End If
                                  End If
                      
                                  If My.Computer.Network.IsAvailable Then
                                      If IO.File.Exists(appPath & "\Update\vcheck.txt") Then
                                          IO.File.Delete(appPath & "\Update\vcheck.txt")
                                      End If
                                      Dim url = ""
                                      Dim nurl = ""
                                      Dim version = ""
                                      If release_channel = "Stable" Then
                                          url = "https://github.com/ClxS/SMAPI/releases/latest"
                                          My.Computer.Network.DownloadFile(url, appPath & "\Update\vcheck.txt")
                                          Dim arr() As String = IO.File.ReadAllLines(appPath & "\Update\vcheck.txt")
                                          For Each item As String In arr
                                              If item.Contains("""") Then
                                                  Dim param() As String = item.Split("""")
                                                  nurl = param(1)
                      
                                              End If
                                          Next
                                          IO.File.Delete(appPath & "\Update\vcheck.txt")
                                          My.Computer.Network.DownloadFile(nurl, appPath & "\Update\vcheck.txt")
                                          Dim arr2() As String = IO.File.ReadAllLines(appPath & "\Update\vcheck.txt")
                                          For Each item As String In arr2
                                              If item.Contains("/ClxS/SMAPI/releases/download/") Then
                                                  Dim param() As String = item.Split("""")
                                                  nurl = "https://github.com/" & param(1)
                                                  Dim param2() As String = nurl.Split("/")
                                                  version = param2(8)
                                              End If
                                          Next
                                      Else
                                          url = "https://github.com/ClxS/SMAPI/releases"
                                          My.Computer.Network.DownloadFile(url, appPath & "\Update\vcheck.txt")
                                          Dim file As String = Nothing
                                          Dim arr() As String = IO.File.ReadAllLines(appPath & "\Update\vcheck.txt")
                                          For Each item As String In arr
                                              If item.Contains("/SMAPI-") Or item.Contains("/SMAPI_") Then
                                                  Dim param() As String = item.Split("/")
                                                  If file = Nothing Then
                                                      file = param(1) & "/" & param(2) & "/" & param(3) & "/" & param(4) & "/" & param(5) & "/" & param(6)
                                                      version = param(5)
                                                  End If
                                              End If
                                          Next
                                          Dim p() = file.Split("zip")
                                          x = p(0)
                                          c = 8
                                          nurl = "https://github.com/" & p(0) & "zip"
                                      End If
                                      Dim fname = Path.GetFileName(nurl)
                                      c = 10
                                      Dim fnameoe As String = Path.GetFileNameWithoutExtension(nurl)
                                      ' If (Not String.Compare(fnameoe, cSVersion)) = 0 Or notFound = 1 Then
                                      If Not (fnameoe.ToString <= cSVersion) Or notFound = 1 Then
                                          If MsgBox("SMAPI Update Available! Do you want to install the update SMAPI now?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Or notFound = 1 Then
                                              Dim myWebClient As New WebClient()
                                              myWebClient.DownloadFile(nurl, fname)
                                              c = 11
                                              IO.File.Move(appPath & "\" & fname, appPath & "\Update\" & fname)
                                              INI_WriteValueToFile("SMAPI Details", "Version", fnameoe, Application.UserAppDataPath & "\SDVMM.ini")
                                              zip(appPath & "\Update\" & fname, appPath & "\Update\", 1, True)
                                              If notFound = 1 Then
                                                  Skip = 1
                                                  notFound = 0
                                              End If
                                          End If
                                      End If
                                  Else
                                  End If
                              Catch ex As Exception
                                  If MsgBox(ex.ToString, MsgBoxStyle.RetryCancel) = MsgBoxResult.Retry Then
                                      checkSDVMMUpdate()
                                  Else
                                      Skip = 1
                                  End If
                              End Try
                          End Sub
                      
                       
                        Last edited: Apr 13, 2016
                      • NewSpecies

                        NewSpecies Industrial Terraformer

                        I'll consider adding some kind of automatic system, or at least a notice for future updates and some indication of what version is being run. :)
                         
                          Last edited: Apr 13, 2016
                          yuukiw likes this.
                        • yuukiw

                          yuukiw Scruffy Nerf-Herder

                          in what language did you write it?
                           
                          • SpringsSong

                            SpringsSong Scruffy Nerf-Herder

                            A little note, since I gave this a spin this morning...

                            If a SMAPI mod has additional files it requires to run (a config file, or even a custom .XNB file), this doesn't apply them. Mods I had conflict with were the following:

                            -Oranisagu's Farm Automation mods (both have config files that give the mods certain parameters, and are not loaded into the mod folder using your program)
                            -Advize's Farm Expansion, using SMAPI (has a custom .xnb which adds a new map to the game with more planting space for your farm) and Pet/Loved Labels (has a custom .xnb which is part of a tooltip displayed over animals to show whether or not they've been petted. Neither of the custom .xnb files are loaded into the mod folder using your program)
                             
                            • NewSpecies

                              NewSpecies Industrial Terraformer

                              @SpringsSong
                              #1 Are these .config files, or does the file extension it depend on the mod? I can have the dll copy over any files within their own directory, including the configs. I'd also have to revise how deactivating the dll operates to prevent config files from being removed when the mods are disabled.
                              #2 When you load up the program it should give you an option to update to 1.01. 1.01 now allows for loading of resources that don't have matches in the directory, so long as the xnb file in the archive has some directory in common with the Stardew content folder. So your second point should be solved. (If there is any issues with it, please let me know)
                               
                              • SpringsSong

                                SpringsSong Scruffy Nerf-Herder

                                @NewSpecies

                                They are actually .json files, my bad, but they are separate from the manifest.json in each one.

                                I'll give 1.01 a spin in a little bit here and let you know~
                                 
                                • NewSpecies

                                  NewSpecies Industrial Terraformer

                                  @SpringsSong The application should copy over all .json files that are within the same folder the dll was found in the archive. However, when the mods are removed it's setup to just delete the mod folder, including the setting files. Perhaps it would be better to only delete the dll and the manifest.json when a mod is deactivated, and when reactivated prevent overwrites of the other json files so the setting stay. If that's how it works, I'll just make those changes. Thanks for your input! :)

                                  Edit: I'm also noticing that FarmAutomation uses two dll's. FarmAutomation.Common.dll, and Farm.ItemCollector.dll. Hmm, do they both need to be in the same directory? Because the way the program handles it, it'll move both dll's to their own separate directories (and copy the json files in to both as well).
                                  Edit: Apparently it does, that's problematic. No worries, I should be able to find out a way to handle this.
                                   
                                    Last edited: Apr 14, 2016
                                  • SpringsSong

                                    SpringsSong Scruffy Nerf-Herder

                                    @NewSpecies Just tested it again, and when I loaded in the three mods I have that use custom XNB's that go in the respective mod folders (I added another one because I am apparently a glutton for punishment, RIP me), it pulled up a prompt to ask me where in the Steam\steamapps\common\Stardew Valley\Content\ directory they were supposed to go, but they don't go there--and they didn't copy into the mod folder either.
                                     
                                    • NewSpecies

                                      NewSpecies Industrial Terraformer

                                      @SpringsSong Could you send me a link to the three mods you're using? I'll try and isolate the problem from there.
                                       
                                      • SpringsSong

                                        SpringsSong Scruffy Nerf-Herder

                                        Sure, I'll PM those links to you shortly.
                                         
                                        • NewSpecies

                                          NewSpecies Industrial Terraformer

                                          @SpringsSong Okay, looked through all the mods you mentioned.

                                          > http://community.playstarbound.com/threads/smapi-farm-area-expansion-no-game-files-modified.110869/ <-- First one's here, Advize's farm expansion.
                                          Okay. For the first mod (Advize's farm expansion). According to the text file you have to move the lone xnb to Content/Mods/ which isn't a directory in Stardew Valley.
                                          Which means you're going to have to create a "Content\Mods\" folder in your game folder. Next time the mod loads up, and asks you where to put FarmExtention.xnb. It should have Content\Mods\ listed.
                                          That one is going to be a tough fix for others unless the author puts the FarmExtention.xnb in a folder that's doesn't need to be created. :\

                                          >http://community.playstarbound.com/threads/pet-animal-loved-labels-1-0.112977/ <-- the Loved Labels
                                          Now, for the second one. (Loved Labels) It's the same issue. Except now the xnb file has to be packaged with the dll in the dll \Mods\ folder.
                                          For this one ... it might be better just to manually install it and keep it out of the package manager. because the program is going to assume that any xnb that's part of the archive goes in the one of the the directories in \content\ folder.

                                          >http://community.playstarbound.com/threads/bus-stop-storage-smapi-version.113148/ <-- And the Bus Stop Storage, SMAPI version. It apparently needs to be installed in the steamapps\common\Stardew Valley\Mods folder, not the %appdata%\Roaming\StardewValley\Mods folder or else it will CTD.
                                          Now, the third one. Is the same thing as the second (Bus Stop Storage). It has xnb's which are to be placed in the same directory as the dll, and not the content folder. But the program doesn't know that.

                                          Now. I can have it copy xnb's in the same directory as the dll to the dll path when it's active. But... it's still going to prompt you asking where the xnb belongs because it assumes that xnb is supposed to go in the content folder.


                                          Yeah, I understand what the problem with it is now. Hmmm... I'd have to think of a solution for this one. Truthfully, I don't think there is a solution. Because solving the problem for mod #2, and mod #3 will incorrectly solve it for mod #1. Ideally, all three mods should be adding their content to the /Content/ folder, without having to make new directories or package them with the dll's. That would fix all of them.

                                          Edit: Now I realize they're all installed the same. Might be able to do something.
                                           
                                            Last edited: Apr 14, 2016

                                          Share This Page