DrewNaylor / UXL-Launcher

An app launcher meant to launch Microsoft Office 2010, 2013, 2016, 2019 desktop software/apps, including ones from Office 365. Not associated with Microsoft.
Apache License 2.0
7 stars 1 forks source link

Autodiscover: find the highest-numbered "Office(version)" folder in Program Files or Program Files (x86) within the lower and upper bounds. #213

Open DrewNaylor opened 2 years ago

DrewNaylor commented 2 years ago

This'll allow people to use UXL Launcher long after I stop updating it without having to manually type in the version of Office they're using into the config file, just as long as the location and filenames of the Office EXE files don't change beyond what I account for.

To ensure things don't get out of hand, I'll use two settings: autodiscoverLowerBounds and autodiscoverUpperBounds. That will ensure things don't go in an endless loop while also allowing people to not have every version of Office. I think good defaults would be 11 for the lower bound and 50 for the upper bound, though users will be able to change it both in the config file and in a special window just for configuring Autodiscover named "Configure Autodiscover" (it's in its own window because it may be confusing and I don't want to have it in its own tab). That window will be accessed from a button that appears when you go to the "Autodiscover" entry in the Office version dropdown, and that button will be underneath any checkboxes in the Office version groupbox. By default, it'll just say "Autodiscover: Office16" as it's taking the number from the Office version in the config file.

Finding each version will be done in a similar way to what dotbakker does, where it starts at the lower bound and adds 1 until it gets to the upper bound. Each folder it discovers will have the number be added to a list, then the list will be sorted from greatest to least once it reaches the upper bound. The first item in the list will be used as the contents of the Office version in the config file after the user confirms that it's correct. If it's wrong, it'll tell the user that they can change the upper and lower bounds from that special window, then they can try again. If we can't find anything, we'll also tell them to change the upper and lower bounds and try again, but that it's possible that Office isn't installed.

There will have to be a button that says something like "Begin Autodiscover", so that it doesn't just run on its own.