Creating Win32 resource files on Mac OSX - macos

I'm having a super frustrating issue.
Basically, I want to write C code that encrypts a binary file, and then creates a Win32 resource file that can be packaged into a resulting executable file.
I found the best way to do this was to use a C program to generate an encrypted.dat file with the encrypted executable code, then create a resource script that packages this code into an executable.
My main issue here is that I'm working on a Mac, and the resource compiler RC that is included in the Windows SDK is not available on OSX.
Can anyone explain how I can accomplish this project without completely switching to Windows? The main issue is that I can't generate and link the resource file that I mentioned.

Check whether you have a program named "windres" (maybe x86_64-w32-ming32-windres or some other platform, that is the GCC equivalent of rc.exe

Related

Link in resources

Looks like there are tons of webpages online and questions on SO, but I still can't get this to work after several hours of searching.
I'm cross-compiling from Linux to Windows by setting CC/CXX to x86-64 MinGW-w64. Compilation actually works and the exe runs fine on Windows.
With file I get this output:
PE32+ executable (GUI) x86-64 (stripped to external PDB), for MS Windows
I have two resource files (a Windows *.ico file and a *.res ASCII file that contains properties such as VERSIONINFO and the like).
The two resource files are transformed into *.o files with MinGW's windres tool. They look like COFF files now. That's as far as I could get.
What I want to do is link those two resources into the exe.
I don't find any way to instruct the Go linker to include those files during linking (I run go build, not go tool). I've also tried to add the resource post-linking with objcopy following various pages online and other SO questions... but to no avail.
All I want is Windows to recognize those two resources (icon and info) so that the executable behaves like any other on Windows.
If I should instruct the Go linker (go tool instead of go build), then how can I tell it which files to link? I have "simple" *.go files and then C dependencies (GLFW and OpenGL) I link with CGO.
How can this be done on the Linux command-line? I want to add these steps to a broader CI/CD (build workflow/asset pipeline). A Windows GUI tool or similar would not help much.
Thanks!
I don’t know if you are using Fyne, but it sounds like what “fyne package” does (embed icon and metadata).
If you are in Fyne land then you can use their tools, if not maybe check out the source and see for yourself how it’s done? https://github.com/fyne-io/fyne/blob/master/cmd/fyne/internal/commands/package-windows.go

Qt Macdeploy tool alternative for windows

Hi I am trying to make my qt app run just copying the exe. With hours of static build I succeded it however; I discovered that there is a tool for mac named 'macdeployqt' doing all the process for you.
So I wondered if any equivalent tool or script exists for windows. It will get the exe extract dependencies, creates qt.conf file and put the dll's and exe into right paths.
What I mean here is not about creating setup package, just a folder containing all necesseray libraries etc.

How to link a compiled resource (.res) file into an executable

What I want to do is to programmatically update resources of an executable file.
I have a binary resource (.res) file containg bitmaps, icons, version info and a manifest, created with a resource editor, and a PE file compiled with AutoHotkey to which I want to copy the resources from the .res file.
Until now I used to do this with ResourceHacker in command prompt, but ResourceHacker can't be redistributed and besides I want to do this more elegantly.
So I was looking in the WinAPI functions and there seems to be a way to do this: http://msdn.microsoft.com/en-us/library/windows/desktop/ms648008%28v=vs.85%29.aspx
But the problem is that the article describes how to copy resources from an executable file to another, and you can't import non-executable files (the .res file) with LoadLibrary/LoadLibraryEx.
There also seems to be a way to do this with tools from Visual Studio, particularly LINK.exe. But I'm not sure if it can be used outside of the VS enviroment. I have no idea how it works.
You can programmatically update resources with the UpdateResource function
RES files are not involved. RES files are used by the project makefile system to enable minimal rebuild of resources... they don't have to be recompiled every time the application is relinked, just embedded. But you aren't relinking the application and losing the existing resources, so updating just the resources you want to change is the way to go.
If your source assets are already encoded in RES files, then this page describing "Resource File Formats" can help you extract them. It also describes use of LINK.exe for resource embedding. LINK.exe is installed as part of Visual Studio, but it is also available in many versions of the Platform SDK and Windows DDK.

How to add winapi to Lua for Windows

I've installed Lua for Windows "batteries included" 5.1.4-46.
It doesn't have everything I want.
I'm trying to re-write AutoIt scripts that I use on my personal PC.
I can't find an easy way to access the windows registry.
The WinAPI module by Steve Donovan looks like it will give me what I want.
I also want to be able to retrieve file attributes in order to determine if a directory is a junction.
I realize my real issues are not WinAPI, but if I learn how to add it to Lua for Windows, I can hopefully add other Lua addons.
How do I add WinAPI to the Lua installation from Lua for Windows?
Edit: I've found a binary winapi.dll for Lua 5.1 lua for windows.
enter link description here
I copied it to the "Lua\5.1\clibs" folder. I added require("winapi") to the top of a short program. I had to exit and restart SciTE editor and now it appears to be working.
The third party lib will ultimately (after build) be a DLL. As long as the DLL is on your LUA_CPATH, you can require dll_name and it will load dll_name.dll. There are binary (pre-built) versions of winapi for LuaForWindows, like v1.0.1. But you are probably better off getting the most recent release and building using one of the build scripts in root folder of .zip release. Once you have built, look for the .dll produced and move it to one of the locations on LUA_CPATH, or edit LUA_CPATH to include the folder where you want to put all your Lua extension modules.

create Qt project on windows operating system

i to create a QT project under windows operating system but when i try to run this application i found this error:
Starting C:\Source\test1\debug\test.exe...
The process could not be started!
can any one help me to know what is the problem
It sounds like you're trying to invoke this from an I.D.E. (like QT Creator) that can't find the executable.
Assuming it has been compiled, the I.D.E. may be trying to call it from the wrong directory.
Look in C:\Source\test1\debug and see if that executable exists.
If it's not there, it probably should be looking in C:\Source\test1\release.
Look there for the executable.
For QT Creator: I've found in the past that deleting the *.pro.user file and reopening the project works. The I.D.E. will ask/(force?) you to regenerate this file. Do so. This seems to fix many problems like this.
If you are using an I.D.E. as mentioned, it seems that your project configuration is broken. Save all source files and start a new project with the source files, and let the I.D.E. regenerate its scripts. Check the makefile for errors.

Resources