Tested: it seems that it works only if you have installed the IDE, if you use the portable version it fails because it can't get the right folder since I don't have any Arduino folder under my user folder.
So I made a quick and dirty modification and changed this line
string boards = Directory.GetDirectories(Path.Combine(local, @"Arduino15\packages"));
in this line
string boards = Directory.GetDirectories(Path.GetDirectoryName(@"D:\IDE\arduino-1.8.10\portable\packages\"));
Don't forget the last \ in the path, otherwise the search will start from portable folder and will fail.
This modification will work only in my installation but the right way is that if you get an exception in getting folder using the original line you will open a ChooseFolder window and the user will pick the right portable folder.