If I understand you correctly, when the main.exe is started as a service, the big problem is that the HMI started by a user is not finding VIs.
Is this happening with any users? What happens if the user that runs the HMI is the Administrator for that machine?
This could be a hint to set us on the right track to investigate the problem and find a solution.
Also, by looking at this
KnowledgeBase I noticed there are a lot of configuration settings that can be specified when creating the service from the executable.
My best guess is there is some problem with access to the directories where the exe and HMI point when calling SubVIs or DLLs and this causes the error 21 to show up.
Let us know what happens with an administrator user and we will investigate more into this,
regards
AlessioD
National Instruments