danomatika / joyosc

(maintained) hid device to osc event daemon used in the robotcowboy project
http://robotcowboy.com
GNU General Public License v3.0
44 stars 3 forks source link

packaging for windows #7

Closed fdch closed 4 years ago

fdch commented 4 years ago

Ok, so I realized I could add the DESTDIR flag to make install and did that.

However, it created a lib subdirectory without the three dependencies that I manually added (liblo-7.dll, SDL2.dll, and libtinyxml2.dll). You can have a look here

Trying to run from the bin, or from the root dir gave me an error for not finding the shared libs. So, I moved all libs and .exes to the same dir and got this:

$ ./joyosc.exe
.../Downloads/joyosc-installed/mingw64/joyosc.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

I am afraid I have no more info on this and wont be able to work on this until later this week. Hope any of this is helpful. Please, let me know if it isn't!

danomatika commented 4 years ago

The error print suggests you are still missing some DLLs, most probably libc which is included with MinGW. See what Dependency Walker says. Like Pd, we can have an option to statically link libc, but for now you should be able to make a copy of the DLL.

If you are also dependent on DLLS for tinyobject and loopback (two of my libraries included with joyosc), you can statically link them when building by configuring with:

./configure --disable-shared

Regarding the permissions settings in the manifest, I think the following is better in the XML:

 <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
      </requestedPrivileges>
    </security>
  </trustInfo>

I read "asInvoker" denotes regular user permissions and I don't think joyosc needs administrator access. It asked without the manifest since it had to guess what ptriveldges were needed as there wasn't a manifest.

fdch commented 4 years ago

Success!! I got it working on a different computer!

Your changes to mainfest worked perfectly well and I received absolutely no warning from the antivirus.

I remade the app with ./configure --disable-shared

Running depends.exe joyosc showed the following libraries, which were all located in msys2/mingw64/bin:

So, I copied all of them into the bin of the newly installed after make install DESTDIR="joyosc-installed2", together with the mainfests, and voila!

joyosc.exe is running and joyosc-example.pd is getting all the game controller events coming in from the PS4 controller.

CONGRATS AND THANKS!!!!!!

here's the package if you want to check it out.

fdch commented 4 years ago

I'll close this for now, but I am still trying to figure out how to make a simple .bat file that can run joyosc from a msys terminal. If anything, I could make another issue for that.

danomatika commented 4 years ago

Cool. We can probably wrap up those steps into a make rule as with Pd's make app.

If you want to try the same for macOS:

danomatika commented 4 years ago

Also, you want to use a .bat (aka DOS batch file) as it will work natively with the Windows CMD.exe prompt. You can also run any command line program in CMD. Either way, whoever will use your package will not need Msys.

fdch commented 4 years ago

I have tried running joyosc from the command line with no luck. It only runs from msys

EDIT: joyosc DOES run from cmd. The difference is that it begins to run in the background and the console just goes to a new line as if nothing had happened.