Any idea how to create an auto-updater for a standalone application?

Music_SDP's icon

I've been developing a standalone app for a little over a year now, and I put out updates about once a month. The users who work with my software need to download an entirely new build every time I release an update and have to go through my website to get the build. I feel like this is way behind the times, as many professional programs provide built-in updaters these days, or at least (as in Max's case), they can let the user know when a new version is available.

Does anyone know how to do either of these things in Max? I'd prefer to have my users press a button to download an update, but if I could replicate the Max update message that pops onto your window when a new version is available, I'd be happy with that too.

I mean, everything done in Max is built in Max, so I imagine there must be a way to check with a server, right? If Max does it, shouldn't Max creators be able to do it to?

Nikolas K's icon

Hi Skrabin,

Max Patch
Copy patch and select New From Clipboard in Max.

My solution is to have a json on the server that has the info on the latest update, and the download link (or links, for both mac and win).
Then, you can use the [maxurl] to get the json in your standalone and compare the info of the standalone and the json values.
If the version is different i.e. the json has a newer version number, prompt for a download.
This should is the basic idea:

Hope it helps!
-N

Music_SDP's icon

That is brilliant! Thank you so much for this kickstart! I've got one follow-up question, if you don't mind. How do you set the name and version info of the standalone in Windows and OSX?

Nikolas K's icon

Personally, I do it the manual way for now i.e. I have two [value] objects like [v appName myAppName] and [v appVersion 1 0 0] that I globally use in the standalone to access the name and version in the patches. Its not very elegant, but it does the job for now.
The drawback is that especially the version number, you have to remember to manually change on each updated build.

If you mean how do you set the actual standalone's version number (like win: left-click -> properties, mac : left-click -> "get info") to show the version number correctly, then:
for windows I use the "XN Resource Editor" to edit the standalone's .exe file directly, and for the Mac, you can edit the info.plist.
The name you set when building the standalone.

If I didn't cover your question, please let me know!

-N

Music_SDP's icon

Thank you for your continuing help. So, I now have the patch that you sent me updated with the values that I'm interested in trying out. I uploaded the json to my website (I can, in fact open the location, so I know it's there.) But when I send the "get" message to maxurl, I receive a series of errors from the dict object, saying that there is no dictionary with the name I've given it and that the index for the link and version are out of range!

here's the link to the json: www.musicsdp.com/version-info.json

here's the code for my version of the patch.

Any additional help would be hugely appreciated.

{
    "boxes" : [         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "v appVersion 1 1 2",
                "style" : "",
                "id" : "obj-4",
                "numinlets" : 1,
                "patching_rect" : [ 581.0, 434.0, 110.0, 22.0 ],
                "numoutlets" : 1,
                "outlettype" : [ "" ]
            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "v appName Music_SDP",
                "style" : "",
                "id" : "obj-3",
                "numinlets" : 1,
                "patching_rect" : [ 577.0, 403.0, 138.0, 22.0 ],
                "numoutlets" : 1,
                "outlettype" : [ "" ]
            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "standalone",
                "style" : "",
                "id" : "obj-7",
                "numinlets" : 1,
                "patching_rect" : [ 547.0, 301.0, 87.0, 22.0 ],
                "numoutlets" : 0,
                "saved_object_attributes" :                 {
                    "allwindowsactive" : 0,
                    "audiosupport" : 1,
                    "bundleidentifier" : "com.mycompany.myprogram",
                    "cantclosetoplevelpatchers" : 1,
                    "cefsupport" : 1,
                    "copysupport" : 1,
                    "database" : 0,
                    "extensions" : 1,
                    "gensupport" : 1,
                    "midisupport" : 1,
                    "noloadbangdefeating" : 0,
                    "overdrive" : 0,
                    "preffilename" : "Max 7 Preferences",
                    "searchformissingfiles" : 1,
                    "statusvisible" : 1,
                    "usesearchpath" : 0
                }

            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "route windows mac",
                "style" : "",
                "id" : "obj-15",
                "numinlets" : 3,
                "patching_rect" : [ 416.0, 570.0, 113.0, 22.0 ],
                "numoutlets" : 3,
                "outlettype" : [ "", "", "" ]
            }

        }
,         {
            "box" :             {
                "maxclass" : "comment",
                "text" : "The \"version-info.json\" should be something like this:\n\n{\n \t\"myAppName\" : \t{\n \t\"version\" : [ 2, 1, 0],\n \"link\" : {\n windows : \"www.my-site.com/win-installer.msi\",\n mac : \"www.my-site.com/mac-installer.pkg\"\n \t}\n}",
                "linecount" : 10,
                "style" : "",
                "id" : "obj-14",
                "numinlets" : 1,
                "patching_rect" : [ 387.0, 42.0, 332.0, 144.0 ],
                "numoutlets" : 0
            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "zl slice 1",
                "style" : "",
                "id" : "obj-46",
                "numinlets" : 2,
                "patching_rect" : [ 337.0, 501.0, 57.0, 22.0 ],
                "numoutlets" : 2,
                "outlettype" : [ "", "" ]
            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "regexp :: @substitute \" \"",
                "style" : "",
                "id" : "obj-42",
                "numinlets" : 1,
                "patching_rect" : [ 337.0, 467.0, 139.0, 22.0 ],
                "numoutlets" : 5,
                "outlettype" : [ "", "", "", "", "" ]
            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "route version link",
                "style" : "",
                "id" : "obj-22",
                "numinlets" : 3,
                "patching_rect" : [ 375.0, 532.0, 101.0, 22.0 ],
                "numoutlets" : 3,
                "outlettype" : [ "", "", "" ]
            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "sprintf get %s::link",
                "style" : "",
                "id" : "obj-18",
                "numinlets" : 1,
                "patching_rect" : [ 177.5, 383.0, 108.0, 22.0 ],
                "numoutlets" : 1,
                "outlettype" : [ "" ]
            }

        }
,         {
            "box" :             {
                "maxclass" : "comment",
                "style" : "",
                "id" : "obj-40",
                "numinlets" : 1,
                "patching_rect" : [ 769.0, 1192.0, 150.0, 20.0 ],
                "numoutlets" : 0
            }

        }
,         {
            "box" :             {
                "maxclass" : "message",
                "text" : "get http://www.musicsdp.com/version-info.json",
                "style" : "",
                "fontname" : "Arial",
                "id" : "obj-2",
                "numinlets" : 2,
                "patching_rect" : [ 55.0, 42.0, 277.0, 23.0 ],
                "numoutlets" : 1,
                "fontsize" : 13.0,
                "outlettype" : [ "" ]
            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "v versionsCheckError",
                "style" : "",
                "id" : "obj-17",
                "numinlets" : 1,
                "patching_rect" : [ 322.5, 248.0, 125.0, 22.0 ],
                "numoutlets" : 1,
                "outlettype" : [ "" ]
            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "t Music_SDP",
                "style" : "",
                "id" : "obj-6",
                "numinlets" : 1,
                "patching_rect" : [ 158.0, 308.0, 80.0, 22.0 ],
                "numoutlets" : 1,
                "outlettype" : [ "Music_SDP" ]
            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "sprintf get %s::version",
                "style" : "",
                "id" : "obj-5",
                "numinlets" : 1,
                "patching_rect" : [ 158.0, 359.0, 129.0, 22.0 ],
                "numoutlets" : 1,
                "outlettype" : [ "" ]
            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "t b l clear",
                "style" : "",
                "id" : "obj-27",
                "numinlets" : 1,
                "patching_rect" : [ 158.0, 279.0, 316.0, 22.0 ],
                "numoutlets" : 3,
                "outlettype" : [ "bang", "", "clear" ]
            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "dict",
                "style" : "",
                "id" : "obj-21",
                "numinlets" : 2,
                "patching_rect" : [ 306.5, 438.0, 110.5, 22.0 ],
                "numoutlets" : 4,
                "outlettype" : [ "dictionary", "", "", "" ],
                "saved_object_attributes" :                 {
                    "embed" : 0,
                    "parameter_enable" : 0
                }

            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "dict.deserialize",
                "style" : "",
                "fontname" : "Arial",
                "id" : "obj-43",
                "numinlets" : 1,
                "patching_rect" : [ 306.5, 335.0, 94.0, 23.0 ],
                "numoutlets" : 1,
                "fontsize" : 13.0,
                "outlettype" : [ "dictionary" ]
            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "route body error",
                "style" : "",
                "fontname" : "Arial",
                "id" : "obj-29",
                "numinlets" : 3,
                "patching_rect" : [ 158.0, 219.0, 348.0, 23.0 ],
                "numoutlets" : 3,
                "fontface" : 0,
                "fontsize" : 13.0,
                "outlettype" : [ "", "", "" ]
            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "dict.strip body error",
                "style" : "",
                "fontname" : "Arial",
                "id" : "obj-44",
                "numinlets" : 1,
                "patching_rect" : [ 55.0, 186.0, 122.0, 23.0 ],
                "numoutlets" : 2,
                "fontface" : 0,
                "fontsize" : 13.0,
                "outlettype" : [ "dictionary", "" ]
            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "maxurl",
                "style" : "",
                "fontname" : "Arial",
                "id" : "obj-1",
                "numinlets" : 1,
                "patching_rect" : [ 55.0, 155.0, 82.0, 23.0 ],
                "numoutlets" : 2,
                "fontsize" : 13.0,
                "outlettype" : [ "dictionary", "" ]
            }

        }
],
    "lines" : [         {
            "patchline" :             {
                "source" : [ "obj-27", 0 ],
                "destination" : [ "obj-6", 0 ],
                "hidden" : 0,
                "disabled" : 0
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-6", 0 ],
                "destination" : [ "obj-18", 0 ],
                "hidden" : 0,
                "disabled" : 0
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-6", 0 ],
                "destination" : [ "obj-5", 0 ],
                "hidden" : 0,
                "disabled" : 0
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-5", 0 ],
                "destination" : [ "obj-21", 0 ],
                "hidden" : 0,
                "midpoints" : [ 167.5, 427.5, 316.0, 427.5 ],
                "disabled" : 0
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-46", 1 ],
                "destination" : [ "obj-22", 0 ],
                "hidden" : 0,
                "disabled" : 0
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-44", 1 ],
                "destination" : [ "obj-29", 0 ],
                "hidden" : 0,
                "disabled" : 0
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-43", 0 ],
                "destination" : [ "obj-21", 0 ],
                "hidden" : 0,
                "disabled" : 0
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-42", 0 ],
                "destination" : [ "obj-46", 0 ],
                "hidden" : 0,
                "disabled" : 0
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-29", 0 ],
                "destination" : [ "obj-27", 0 ],
                "hidden" : 0,
                "disabled" : 0
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-29", 1 ],
                "destination" : [ "obj-17", 0 ],
                "hidden" : 0,
                "disabled" : 0
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-27", 1 ],
                "destination" : [ "obj-43", 0 ],
                "hidden" : 0,
                "disabled" : 0
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-27", 2 ],
                "destination" : [ "obj-21", 0 ],
                "hidden" : 0,
                "midpoints" : [ 464.5, 429.5, 316.0, 429.5 ],
                "disabled" : 0
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-22", 1 ],
                "destination" : [ "obj-15", 0 ],
                "hidden" : 0,
                "disabled" : 0
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-21", 1 ],
                "destination" : [ "obj-42", 0 ],
                "hidden" : 0,
                "disabled" : 0
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-2", 0 ],
                "destination" : [ "obj-1", 0 ],
                "hidden" : 0,
                "disabled" : 0
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-18", 0 ],
                "destination" : [ "obj-21", 0 ],
                "hidden" : 0,
                "disabled" : 0
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-1", 0 ],
                "destination" : [ "obj-44", 0 ],
                "hidden" : 0,
                "midpoints" : [ 64.5, 176.75, 64.5, 176.75 ],
                "disabled" : 0
            }

        }
],
    "appversion" :     {
        "major" : 7,
        "minor" : 3,
        "revision" : 1,
        "architecture" : "x86",
        "modernui" : 1
    }
,
    "styles" : [         {
            "name" : "AudioStatus_Menu",
            "default" :             {
                "bgfillcolor" :                 {
                    "type" : "color",
                    "color" : [ 0.294118, 0.313726, 0.337255, 1 ],
                    "color1" : [ 0.454902, 0.462745, 0.482353, 0.0 ],
                    "color2" : [ 0.290196, 0.309804, 0.301961, 1.0 ],
                    "angle" : 270.0,
                    "proportion" : 0.39,
                    "autogradient" : 0
                }

            }
,
            "parentstyle" : "",
            "multi" : 0
        }
,         {
            "name" : "default_style",
            "newobj" :             {
                "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ],
                "accentcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "textcolor_inverse" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "button" :             {
                "bgcolor" : [ 0.682032, 0.698052, 0.748716, 1.0 ],
                "color" : [ 0.960784, 0.827451, 0.156863, 1.0 ]
            }
,
            "toggle" :             {
                "bgcolor" : [ 0.636487, 0.648652, 0.683149, 1.0 ],
                "elementcolor" : [ 0.786675, 0.801885, 0.845022, 1.0 ],
                "color" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "parentstyle" : "",
            "multi" : 1
        }
,         {
            "name" : "default_style-1",
            "newobj" :             {
                "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ],
                "accentcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "textcolor_inverse" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "button" :             {
                "bgcolor" : [ 0.682032, 0.698052, 0.748716, 1.0 ],
                "color" : [ 0.960784, 0.827451, 0.156863, 1.0 ]
            }
,
            "toggle" :             {
                "bgcolor" : [ 0.636487, 0.648652, 0.683149, 1.0 ],
                "elementcolor" : [ 0.786675, 0.801885, 0.845022, 1.0 ],
                "color" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "parentstyle" : "",
            "multi" : 0
        }
,         {
            "name" : "helpfile_label-1",
            "default" :             {
                "fontname" : [ "Arial" ],
                "fontsize" : [ 13.0 ],
                "textcolor" : [ 0.501961, 0.501961, 0.501961, 1.0 ]
            }
,
            "parentstyle" : "",
            "multi" : 0
        }
,         {
            "name" : "jpatcher001",
            "parentstyle" : "default",
            "multi" : 0
        }
,         {
            "name" : "master_style",
            "umenu" :             {
                "bgfillcolor" :                 {
                    "type" : "gradient",
                    "color1" : [ 0.786675, 0.801885, 0.845022, 1.0 ],
                    "color2" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                    "color" : [ 0.290196, 0.309804, 0.301961, 1.0 ],
                    "angle" : 270.0,
                    "proportion" : 0.39,
                    "autogradient" : 0
                }

            }
,
            "message" :             {
                "bgfillcolor" :                 {
                    "type" : "gradient",
                    "color1" : [ 0.786675, 0.801885, 0.845022, 1.0 ],
                    "color2" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                    "color" : [ 0.290196, 0.309804, 0.301961, 1.0 ],
                    "angle" : 270.0,
                    "proportion" : 0.39,
                    "autogradient" : 0
                }
,
                "textcolor_inverse" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "attrui" :             {
                "bgcolor" : [ 0.786675, 0.801885, 0.845022, 1.0 ],
                "textcolor_inverse" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "ezdac~" :             {
                "bgcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "elementcolor" : [ 0.862745, 0.870588, 0.878431, 1.0 ],
                "color" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "newobj" :             {
                "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ],
                "accentcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "textcolor_inverse" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "multislider" :             {
                "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ],
                "color" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "button" :             {
                "bgcolor" : [ 0.682032, 0.698052, 0.748716, 1.0 ],
                "elementcolor" : [ 0.786675, 0.801885, 0.845022, 1.0 ],
                "color" : [ 1.0, 0.95051, 0.0, 1.0 ]
            }
,
            "function" :             {
                "bgcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "color" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "toggle" :             {
                "bgcolor" : [ 0.682032, 0.698052, 0.748716, 1.0 ],
                "elementcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "color" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "ezadc~" :             {
                "bgcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "elementcolor" : [ 0.862745, 0.870588, 0.878431, 1.0 ],
                "color" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "slider" :             {
                "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ],
                "elementcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "color" : [ 0.461105, 0.492646, 0.591878, 1.0 ]
            }
,
            "kslider" :             {
                "elementcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "color" : [ 1.0, 1.0, 1.0, 1.0 ]
            }
,
            "gain~" :             {
                "elementcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "color" : [ 1.0, 0.861448, 0.16921, 1.0 ]
            }
,
            "parentstyle" : "",
            "multi" : 1
        }
,         {
            "name" : "master_style-1",
            "umenu" :             {
                "bgfillcolor" :                 {
                    "type" : "gradient",
                    "color1" : [ 0.786675, 0.801885, 0.845022, 1.0 ],
                    "color2" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                    "color" : [ 0.290196, 0.309804, 0.301961, 1.0 ],
                    "angle" : 270.0,
                    "proportion" : 0.39,
                    "autogradient" : 0
                }

            }
,
            "message" :             {
                "bgfillcolor" :                 {
                    "type" : "gradient",
                    "color1" : [ 0.786675, 0.801885, 0.845022, 1.0 ],
                    "color2" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                    "color" : [ 0.290196, 0.309804, 0.301961, 1.0 ],
                    "angle" : 270.0,
                    "proportion" : 0.39,
                    "autogradient" : 0.0
                }
,
                "textcolor_inverse" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "attrui" :             {
                "bgcolor" : [ 0.786675, 0.801885, 0.845022, 1.0 ],
                "textcolor_inverse" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "ezdac~" :             {
                "bgcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "elementcolor" : [ 0.862745, 0.870588, 0.878431, 1.0 ],
                "color" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "newobj" :             {
                "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ],
                "accentcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "textcolor_inverse" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "multislider" :             {
                "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ],
                "color" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "button" :             {
                "bgcolor" : [ 0.682032, 0.698052, 0.748716, 1.0 ],
                "elementcolor" : [ 0.786675, 0.801885, 0.845022, 1.0 ],
                "color" : [ 1.0, 0.95051, 0.0, 1.0 ]
            }
,
            "function" :             {
                "bgcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "color" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "toggle" :             {
                "bgcolor" : [ 0.682032, 0.698052, 0.748716, 1.0 ],
                "elementcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "color" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "ezadc~" :             {
                "bgcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "elementcolor" : [ 0.862745, 0.870588, 0.878431, 1.0 ],
                "color" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "slider" :             {
                "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ],
                "elementcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "color" : [ 0.461105, 0.492646, 0.591878, 1.0 ]
            }
,
            "kslider" :             {
                "elementcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "color" : [ 1.0, 1.0, 1.0, 1.0 ]
            }
,
            "gain~" :             {
                "elementcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "color" : [ 1.0, 0.861448, 0.16921, 1.0 ]
            }
,
            "parentstyle" : "",
            "multi" : 0
        }
,         {
            "name" : "master_style-2",
            "umenu" :             {
                "bgfillcolor" :                 {
                    "type" : "gradient",
                    "color1" : [ 0.786675, 0.801885, 0.845022, 1.0 ],
                    "color2" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                    "color" : [ 0.290196, 0.309804, 0.301961, 1.0 ],
                    "angle" : 270.0,
                    "proportion" : 0.39,
                    "autogradient" : 0
                }

            }
,
            "message" :             {
                "bgfillcolor" :                 {
                    "type" : "gradient",
                    "color1" : [ 0.786675, 0.801885, 0.845022, 1.0 ],
                    "color2" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                    "color" : [ 0.290196, 0.309804, 0.301961, 1.0 ],
                    "angle" : 270.0,
                    "proportion" : 0.39,
                    "autogradient" : 0.0
                }
,
                "textcolor_inverse" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "attrui" :             {
                "bgcolor" : [ 0.786675, 0.801885, 0.845022, 1.0 ],
                "textcolor_inverse" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "ezdac~" :             {
                "bgcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "elementcolor" : [ 0.862745, 0.870588, 0.878431, 1.0 ],
                "color" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "newobj" :             {
                "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ],
                "accentcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "textcolor_inverse" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "multislider" :             {
                "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ],
                "color" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "button" :             {
                "bgcolor" : [ 0.682032, 0.698052, 0.748716, 1.0 ],
                "elementcolor" : [ 0.786675, 0.801885, 0.845022, 1.0 ],
                "color" : [ 1.0, 0.95051, 0.0, 1.0 ]
            }
,
            "function" :             {
                "bgcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "color" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "toggle" :             {
                "bgcolor" : [ 0.682032, 0.698052, 0.748716, 1.0 ],
                "elementcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "color" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "ezadc~" :             {
                "bgcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "elementcolor" : [ 0.862745, 0.870588, 0.878431, 1.0 ],
                "color" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "slider" :             {
                "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ],
                "elementcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "color" : [ 0.461105, 0.492646, 0.591878, 1.0 ]
            }
,
            "kslider" :             {
                "elementcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "color" : [ 1.0, 1.0, 1.0, 1.0 ]
            }
,
            "gain~" :             {
                "elementcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "color" : [ 1.0, 0.861448, 0.16921, 1.0 ]
            }
,
            "parentstyle" : "",
            "multi" : 0
        }
,         {
            "name" : "master_style-3",
            "umenu" :             {
                "bgfillcolor" :                 {
                    "type" : "gradient",
                    "color1" : [ 0.786675, 0.801885, 0.845022, 1.0 ],
                    "color2" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                    "color" : [ 0.290196, 0.309804, 0.301961, 1.0 ],
                    "angle" : 270.0,
                    "proportion" : 0.39,
                    "autogradient" : 0
                }

            }
,
            "message" :             {
                "bgfillcolor" :                 {
                    "type" : "gradient",
                    "color1" : [ 0.786675, 0.801885, 0.845022, 1.0 ],
                    "color2" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                    "color" : [ 0.290196, 0.309804, 0.301961, 1.0 ],
                    "angle" : 270.0,
                    "proportion" : 0.39,
                    "autogradient" : 0.0
                }
,
                "textcolor_inverse" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "attrui" :             {
                "bgcolor" : [ 0.786675, 0.801885, 0.845022, 1.0 ],
                "textcolor_inverse" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "ezdac~" :             {
                "bgcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "elementcolor" : [ 0.862745, 0.870588, 0.878431, 1.0 ],
                "color" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "newobj" :             {
                "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ],
                "accentcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "textcolor_inverse" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "multislider" :             {
                "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ],
                "color" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "button" :             {
                "bgcolor" : [ 0.682032, 0.698052, 0.748716, 1.0 ],
                "elementcolor" : [ 0.786675, 0.801885, 0.845022, 1.0 ],
                "color" : [ 1.0, 0.95051, 0.0, 1.0 ]
            }
,
            "function" :             {
                "bgcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "color" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "toggle" :             {
                "bgcolor" : [ 0.682032, 0.698052, 0.748716, 1.0 ],
                "elementcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "color" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "ezadc~" :             {
                "bgcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "elementcolor" : [ 0.862745, 0.870588, 0.878431, 1.0 ],
                "color" : [ 0.0, 0.0, 0.0, 1.0 ]
            }
,
            "slider" :             {
                "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ],
                "elementcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "color" : [ 0.461105, 0.492646, 0.591878, 1.0 ]
            }
,
            "kslider" :             {
                "elementcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "color" : [ 1.0, 1.0, 1.0, 1.0 ]
            }
,
            "gain~" :             {
                "elementcolor" : [ 0.65098, 0.666667, 0.662745, 1.0 ],
                "color" : [ 1.0, 0.861448, 0.16921, 1.0 ]
            }
,
            "parentstyle" : "",
            "multi" : 0
        }
,         {
            "name" : "newobjBlue-1",
            "default" :             {
                "accentcolor" : [ 0.317647, 0.654902, 0.976471, 1.0 ]
            }
,
            "parentstyle" : "",
            "multi" : 0
        }
,         {
            "name" : "newobjCyan-1",
            "default" :             {
                "accentcolor" : [ 0.029546, 0.773327, 0.821113, 1.0 ]
            }
,
            "parentstyle" : "",
            "multi" : 0
        }
,         {
            "name" : "newobjGreen-1",
            "default" :             {
                "accentcolor" : [ 0.0, 0.533333, 0.168627, 1.0 ]
            }
,
            "parentstyle" : "",
            "multi" : 0
        }
,         {
            "name" : "newobjYellow-1",
            "default" :             {
                "accentcolor" : [ 0.82517, 0.78181, 0.059545, 1.0 ],
                "fontsize" : [ 12.059008 ]
            }
,
            "parentstyle" : "",
            "multi" : 0
        }
]
}

Music_SDP's icon

Sorry, that's a lot of code. Here's the same as a maxpatch:

Thank you for your continuing help. So, I now have the patch that you sent me updated with the values that I’m interested in trying out. I uploaded the json to my website (I can, in fact open the location, so I know it’s there.) But when I send the "get" message to maxurl, I receive a series of errors from the dict object, saying that there is no dictionary with the name I’ve given it and that the index for the link and version are out of range!

here’s the link to the json: http://www.musicsdp.com/version-info.json

here’s the code for my version of the patch.

Any additional help would be hugely appreciated.

json_test.maxpat
Max Patch
Nikolas K's icon

I think reason is that in your json, the "windows" and "mac" keys are not between quotes, are not set as symbols...
If you used the "sample" json I included as comment in the patch, I wrote t by hand, so its probably a bit wrong...!
I did the attached one using the "replace" message on a [dict] so it should be correct - and working!
I see no other error other than that.

Let me know it works!

Nikolas K's icon

Sorry, json not permitted, so here it is as plain text!

{
    "Music_SDP" :     {
        "link" :         {
            "mac" : "www.musicsdp.com/download-music-sdp",
            "windows" : "www.musicsdp.com/download-music-sdp",
            "version" : [ 1, 1, 3 ]
        }

    }

}

Music_SDP's icon

Thank you for the continuing help! I feel like I'm getting close! The appName index error is gone, but I'm still getting an error that says
"dict: index out of range for key Music_SDP::version"

I tried some different things, for example I put (in the Max patch) the value for appVersion in quotes "1 1 2" I also tried putting it in brackets [1 1 2], and I tried using commas and periods between the values. None of this took the error message away. I wonder if there's some syntax I missing here...

Nikolas K's icon

Well, that is my fault, in my haste I put the "version" as a sub-key of the "link" key, instead of on its own (quite the tiresome day)...
So, hopefully this is correct - sorry for all the trouble!

{
    "Music_SDP" :     {
        "version" : [ 1, 1, 3 ],
        "link" :         {
            "mac" : "www.musicsdp.com/download-music-sdp",
            "windows" : "www.musicsdp.com/download-music-sdp"
        }

    }

}

Music_SDP's icon

This is wonderful, and it works! Thank you so much for your patience and for working on this with me! I'm really excited to get this up and running in my program now, and I'm so happy that I can let my users know when a new version of the code is available! Wow! And no worries about the issues in your syntax. It gave me a chance to wrap my head around json and dict a bit!

Nikolas K's icon

If you look into [maxurl] more, you can use it to download the setup files directly from within your standalone, without opening a browser, and have a "percent" bar for the download - but to be honest its a bit of a fuss, so I only have a half working patch somewhere. I'll post it if a find some time within the next days.
Anyway, I'm glad I could help! Good luck with the rest of the project!

-N

Music_SDP's icon

That sounds fascinating, and would be really easy for my users. However, by sending them to the website I can keep track of downloads. I wonder if that's why Max does this too?

Music_SDP's icon

For what it's worth, I found another solution. Not better than yours, but more effective for my situation. I'm using the jweb object to load a webpage, and when the page loads a chunk of javascript sends the necessary information out of the jweb browser screen. Max and the internet, who knew? (I'm sure that many many people knew! )