-
Notifications
You must be signed in to change notification settings - Fork 39
Not able to find SquirrelAwareApp in subfolders #96
Comments
After reviewing this in Visual Studio as I was preparing the PR, I found it was probably more readable to use |
Hi there, and thanks very much for the PR! Unfortunately as it sits this change in #97 is not sufficient, as there are several other places in the codebase that expect the SquirrelAwareApp will be in the top level directory (not in a sub folder). Off the top of my head, I never intended to allow sub folders to contain SquirrelAwareApp's, can you describe your use-case in more detail? Your quoted comment refers to the structure of the generated nupkg, which stores the application files (for legacy reasons) inside the nupkg within a The above detail is only needed if you are creating the nupkg yourself, and passing it into the |
Thank you for the feedback. I did suspect that I may not have a full understanding of how this works. I have been using Squirrel.Windows to distribute MaxTo, but as I am migrating to .NET 6 it has some well-understood limitations that your fork seems to address well. The special case with MaxTo, is that it needs to have architecture-specific versions of itself installed (due to how global hooks work in Windows). I solve this by building and publishing MaxTo with different architectures, which gives me a folder structure I want to distribute that contains the .exe files inside architecture-specific folders:
When the installer runs, I need to run at least one of these (likely the |
Is Simply allowing Squirrel to search in sub directories would not actually help: because it would just find the first one alphabetically (arm64) and would always try to run this, which would fail on x64/x86. One idea I've had is to allow a package folder structure something like the following:
So anything shared across the architectures will not be duplicated. At install/update time the installer would only extract the file that is appropriate for the current system, rename it to MaxTo.exe and discard the others. This would probably be the simplest approach, but would require some development in any case. |
Thank you for the ideas. I think your suggested solution won't work for me, because in my case I need to install and run multiple executables (two per architecture), not just the native one. So, if I am on an x64 system, it should run both x86 and x64 versions. For now, I am trying to change my logic a bit, and putting the x86 binaries (which runs basically everywhere) in the root folder. Then after my program is running, I can start the other processes I need. I think that avoid the whole problem I ran into above. Now, if I can just figure out how much I will need to restructure my code... :) |
You could create a small binary, |
After scratching my head for a bit, reviewing #81, #2 and #21, I believe the intention is for this library to be able to detect SquirrelAwareApps in any subfolder:
However, the code only looks for files in one directory.
Specifically,
DirectoryInfo.EnumerateFiles
does not recurse into subdirectories unless you specify it:Or, perhaps simpler:
I will be attaching a PR to this shortly, with the fix attached.
The text was updated successfully, but these errors were encountered: