Embed Win32 resources (and rewrite resources entirely)

This commit is contained in:
rjindael 2023-07-12 00:49:52 -07:00
parent f943c55856
commit b6fb19bc9d
No known key found for this signature in database
GPG Key ID: D069369C906CCF31
18 changed files with 261 additions and 51 deletions

View File

@ -1,6 +1,6 @@
function(create_resources directory output)
file(WRITE ${output} "#include <stdint.h>\n\n")
file(GLOB bins ${directory}/*)
file(GLOB bins "${directory}/*.png") # Add other file types if necessary
foreach(bin ${bins})
string(REGEX MATCH "([^/]+)$" filename ${bin})

View File

@ -1,20 +1,16 @@
qt_standard_project_setup()
qt_add_library(Common STATIC
Header/GL/Adorn.hpp
Header/GL/RenderContext.hpp
Header/OgreWidget.hpp
list(APPEND SOURCE
Source/GL/Adorn.cpp
Source/OgreWidget.cpp
)
if(WIN32)
add_custom_command(TARGET Common POST_BUILD
COMMAND ${TOOL_WINDEPLOYQT}
$<TARGET_FILE:Common>
COMMENT "Running windeployqt..."
)
endif()
list(APPEND HEADER
Header/GL/Adorn.hpp
Header/GL/RenderContext.hpp
Header/OgreWidget.hpp
)
qt_standard_project_setup()
qt_add_library(Common STATIC ${SOURCE} ${HEADER})
target_include_directories(Common PUBLIC Header)
target_link_libraries(Common PUBLIC ${QT6_LIBRARIES_INCL} Engine)

View File

@ -1,21 +1,23 @@
create_resources(Resource ${CMAKE_BINARY_DIR}/Resources/PlayerResources.hpp)
create_resources(Resource ${CMAKE_BINARY_DIR}/Resource/Player.hpp)
set(CMAKE_AUTOMOC ON)
qt_add_executable(Player
${CMAKE_BINARY_DIR}/Resources/PlayerResources.hpp
Header/MainWindow.hpp
list(APPEND SOURCE
Source/main.cpp
Source/MainWindow.cpp
)
add_custom_command(TARGET Player POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:Player> $<TARGET_RUNTIME_DLLS:Player>
COMMAND_EXPAND_LISTS
list(APPEND HEADER
${CMAKE_BINARY_DIR}/Resource/Player.hpp
Header/MainWindow.hpp
)
if(WIN32)
list(APPEND HEADER Resource/Windows/Script.rc)
endif()
qt_add_executable(Player ${SOURCE} ${HEADER})
target_include_directories(Player PRIVATE Header)
target_link_libraries(Player PRIVATE Common Engine)

View File

@ -2,6 +2,8 @@
#include <QMainWindow>
#include "Resource/Player.hpp"
class MainWindow : public QMainWindow
{
Q_OBJECT

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -0,0 +1,22 @@
#pragma once
#define VERSION_MAJOR_MINOR_STR "1.0"
#define VERSION_MAJOR_MINOR_PATCH_STR "1.0.0"
#define VERSION_FULL_STR "1.0.0.0"
#define VERSION_RESOURCE 1, 0, 0, 0
#define VERSION_RESOURCE_STR VERSION_FULL_STR "\0"
/*
* These properties are part of VarFileInfo.
* PRODUCT_LANGUAGE is also the resource file's recognizer (but still shares the same value.)
* For more information, please see: https://learn.microsoft.com/en-us/windows/win32/menurc/varfileinfo-block
*/
#define PRODUCT_LANGUAGE 0x0409 // en-US
#define PRODUCT_CHARSET 1200 // Unicode
#define APP_ICON "Icon.ico"
#define APP_NAME "RNR Player\0"
#define APP_DESCRIPTION "RNR's Not Roblox\0"
#define APP_ORGANIZATION "Legacy Roblox Reverse Engineers\0"
#define APP_COPYRIGHT "This program is licensed under the GNU General Public License v3.0.\0"

View File

@ -0,0 +1,49 @@
#include "Information.h"
#if defined(__MINGW64__) || defined(__MINGW32__)
// MinGW-w64, MinGW
#if defined(__has_include) && __has_include(<winres.h>)
#include <winres.h>
#else
#include <afxres.h>
#include <winresrc.h>
#endif
#else
// MSVC, Windows SDK
#include <winres.h>
#endif
IDI_ICON1 ICON APP_ICON
LANGUAGE PRODUCT_LANGUAGE, SUBLANG_DEFAULT
VS_VERSION_INFO VERSIONINFO
FILEVERSION VERSION_RESOURCE
PRODUCTVERSION VERSION_RESOURCE
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", APP_ORGANIZATION
VALUE "FileDescription", APP_DESCRIPTION
VALUE "FileVersion", VERSION_RESOURCE_STR
VALUE "LegalCopyright", APP_COPYRIGHT
VALUE "ProductName", APP_NAME
VALUE "ProductVersion", VERSION_RESOURCE_STR
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", PRODUCT_LANGUAGE, PRODUCT_CHARSET
END
END

View File

@ -1,7 +1,5 @@
#include <MainWindow.hpp>
#include "Resources/PlayerResources.hpp"
MainWindow::MainWindow()
{
QPixmap pixmap = QPixmap();

View File

@ -1,15 +1,13 @@
create_resources(Resource ${CMAKE_BINARY_DIR}/Resources/ServerResources.hpp)
create_resources(Resource ${CMAKE_BINARY_DIR}/Resource/Server.hpp)
add_executable(Server
${CMAKE_BINARY_DIR}/Resources/ServerResources.hpp
Source/main.cpp
)
list(APPEND SOURCE Source/main.cpp)
list(APPEND HEADER ${CMAKE_BINARY_DIR}/Resource/Server.hpp)
add_custom_command(TARGET Server POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:Server> $<TARGET_RUNTIME_DLLS:Server>
COMMAND_EXPAND_LISTS
)
if(WIN32)
list(APPEND HEADER Resource/Windows/Script.rc)
endif()
add_executable(Server ${SOURCE} ${HEADER})
target_include_directories(Server PRIVATE Header)
target_link_libraries(Server PRIVATE Engine)

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -0,0 +1,22 @@
#pragma once
#define VERSION_MAJOR_MINOR_STR "1.0"
#define VERSION_MAJOR_MINOR_PATCH_STR "1.0.0"
#define VERSION_FULL_STR "1.0.0.0"
#define VERSION_RESOURCE 1, 0, 0, 0
#define VERSION_RESOURCE_STR VERSION_FULL_STR "\0"
/*
* These properties are part of VarFileInfo.
* PRODUCT_LANGUAGE is also the resource file's recognizer (but still shares the same value.)
* For more information, please see: https://learn.microsoft.com/en-us/windows/win32/menurc/varfileinfo-block
*/
#define PRODUCT_LANGUAGE 0x0409 // en-US
#define PRODUCT_CHARSET 1200 // Unicode
#define APP_ICON "Icon.ico"
#define APP_NAME "RNR Server\0"
#define APP_DESCRIPTION "RNR's Not Roblox\0"
#define APP_ORGANIZATION "Legacy Roblox Reverse Engineers\0"
#define APP_COPYRIGHT "This program is licensed under the GNU General Public License v3.0.\0"

View File

@ -0,0 +1,49 @@
#include "Information.h"
#if defined(__MINGW64__) || defined(__MINGW32__)
// MinGW-w64, MinGW
#if defined(__has_include) && __has_include(<winres.h>)
#include <winres.h>
#else
#include <afxres.h>
#include <winresrc.h>
#endif
#else
// MSVC, Windows SDK
#include <winres.h>
#endif
IDI_ICON1 ICON APP_ICON
LANGUAGE PRODUCT_LANGUAGE, SUBLANG_DEFAULT
VS_VERSION_INFO VERSIONINFO
FILEVERSION VERSION_RESOURCE
PRODUCTVERSION VERSION_RESOURCE
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", APP_ORGANIZATION
VALUE "FileDescription", APP_DESCRIPTION
VALUE "FileVersion", VERSION_RESOURCE_STR
VALUE "LegalCopyright", APP_COPYRIGHT
VALUE "ProductName", APP_NAME
VALUE "ProductVersion", VERSION_RESOURCE_STR
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", PRODUCT_LANGUAGE, PRODUCT_CHARSET
END
END

View File

@ -1,21 +1,23 @@
create_resources(Resource ${CMAKE_BINARY_DIR}/Resources/StudioResources.hpp)
create_resources(Resource ${CMAKE_BINARY_DIR}/Resource/Studio.hpp)
set(CMAKE_AUTOMOC ON)
qt_add_executable(Studio
${CMAKE_BINARY_DIR}/Resources/StudioResources.hpp
Header/MainWindow.hpp
list(APPEND SOURCE
Source/main.cpp
Source/MainWindow.cpp
)
add_custom_command(TARGET Studio POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:Studio> $<TARGET_RUNTIME_DLLS:Studio>
COMMAND_EXPAND_LISTS
list(APPEND HEADER
${CMAKE_BINARY_DIR}/Resource/Studio.hpp
Header/MainWindow.hpp
)
if(WIN32)
list(APPEND HEADER Resource/Windows/Script.rc)
endif()
qt_add_executable(Studio ${SOURCE} ${HEADER})
target_include_directories(Studio PRIVATE Header)
target_link_libraries(Studio PRIVATE Common Engine)

View File

@ -7,9 +7,15 @@
#include <QTimer>
#include <QToolBar>
#include <QMenuBar>
#include <QGridLayout>
#include <QTreeView>
#include <QVariant>
#include <OGRE/Bites/OgreBitesConfigDialog.h>
#include <OgreWidget.hpp>
#include "Resource/Studio.hpp"
class MainWindow : public QMainWindow
{
Q_OBJECT

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -0,0 +1,22 @@
#pragma once
#define VERSION_MAJOR_MINOR_STR "1.0"
#define VERSION_MAJOR_MINOR_PATCH_STR "1.0.0"
#define VERSION_FULL_STR "1.0.0.0"
#define VERSION_RESOURCE 1, 0, 0, 0
#define VERSION_RESOURCE_STR VERSION_FULL_STR "\0"
/*
* These properties are part of VarFileInfo.
* PRODUCT_LANGUAGE is also the resource file's recognizer (but still shares the same value.)
* For more information, please see: https://learn.microsoft.com/en-us/windows/win32/menurc/varfileinfo-block
*/
#define PRODUCT_LANGUAGE 0x0409 // en-US
#define PRODUCT_CHARSET 1200 // Unicode
#define APP_ICON "Icon.ico"
#define APP_NAME "RNR Studio\0"
#define APP_DESCRIPTION "RNR's Not Roblox\0"
#define APP_ORGANIZATION "Legacy Roblox Reverse Engineers\0"
#define APP_COPYRIGHT "This program is licensed under the GNU General Public License v3.0.\0"

View File

@ -0,0 +1,49 @@
#include "Information.h"
#if defined(__MINGW64__) || defined(__MINGW32__)
// MinGW-w64, MinGW
#if defined(__has_include) && __has_include(<winres.h>)
#include <winres.h>
#else
#include <afxres.h>
#include <winresrc.h>
#endif
#else
// MSVC, Windows SDK
#include <winres.h>
#endif
IDI_ICON1 ICON APP_ICON
LANGUAGE PRODUCT_LANGUAGE, SUBLANG_DEFAULT
VS_VERSION_INFO VERSIONINFO
FILEVERSION VERSION_RESOURCE
PRODUCTVERSION VERSION_RESOURCE
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", APP_ORGANIZATION
VALUE "FileDescription", APP_DESCRIPTION
VALUE "FileVersion", VERSION_RESOURCE_STR
VALUE "LegalCopyright", APP_COPYRIGHT
VALUE "ProductName", APP_NAME
VALUE "ProductVersion", VERSION_RESOURCE_STR
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", PRODUCT_LANGUAGE, PRODUCT_CHARSET
END
END

View File

@ -1,11 +1,4 @@
#include <MainWindow.hpp>
#include <QGridLayout>
#include <QTreeView>
#include <QVariant>
#include <OGRE/Bites/OgreBitesConfigDialog.h>
#include "Resources/StudioResources.hpp"
MainWindow::MainWindow()
{