UE4 Can I load .umap into packaged standalone? - c++

I need to load on start .umap files created after packaging standalone version of my app. The problem is that .umap need to be cooked (even when I uncheck Pak flag). How can I solve that?
What I want to accomplish is that to build standalone app. Let designers to create some .umap level files in Unreal Editor. And finally to be able to start my app with new .umap level.
I see 2 possible ways:
Find some plugin or tool which can separately cook .umap file and add it to packaged project. Does such a plugin exists?
Build standalone project without cooking (I don't need to redistribute the project, it's tool for internal use). Is it possible?
Any thoughts?

You should take a look at UAssetManager class, which could be used for loading UE4 assets at runtime. However, I can't promise you it will load entire map for you, i've never used this mechanism at my own.

Related

Qt Application : How to create standalone executable file for Windows (& Mac) from Mac?

I developed a Qt application in MacBook (El-Capitan 10.11.2) and it is ready now to be released.
What i want now, is to create the standalone executable file for both Mac and Windows OS.
But I don't know how !
I found this link but I am unable to follow it is guidance, it looks different from what my system is showing me.
If you have any idea, please help me.
Thank you
Well, to compile an application for windows, you will need a windows machine (or at least a virtual machine). You can't compile for windows on mac.
Regarding the "standalone": The easy way is to deploy your application together with all the required dlls/frameworks and ship them as one "package". To to this, there are the tools windeployqt and macdeployqt. However, those will not be "single file" applications, but rather a collection of files.
If you want to have one single file, you will have to build Qt statically! You can to this, but you will have to do it on your own. And if you do, please notice that the LGPL-license (the one for the free version of Qt) requires you to make the source-code of your program public! That's not the case if you just link to the dynamic libraries.
EDIT:
Deployment
Deployment can be really hard, because you have to do it differently for each platform. Most times you will have 3 steps
Dependency resolving: In this step, you collect all the exectuables/lirabries/translations/... your application requires and collect them somewhere they can find each other. For windows and mac, this can be done using the tools I mentioned above.
Installation: Here you will have to create some kind of "installer". The easiest way is to create a zip-file that contains everyhing you need. But if you want to have a "nice" installation, you will have to create proper "installers" for each platform. (One of many possibilities is the Qt Installer Framework. Best thing about it: It's cross platform.)
Distribution: Distribution is how to get your program to the user. On Mac, you will have the App-Store, for windows you don't. Best way is to provide the download on a website created for this (like sourceforge, github, ...)
I can help you with the first step, but for the second step you will have to research the possibilities and decide for a way to do it.
Dependencies
Resolving the dependencies can be done by either building Qt statically (this way you will have only one single file, but gain additional work because you will have to compile Qt) or using the dynamic build. For the dynamic build, Qt will help you to resolve the dependencies:
macdeployqt is rather easy to use. Compile your app in release mode and call <qt_install_dir>/bin/macdeployqt <path_to_your_bundle>/<bundle>.app. After thats done, all Qt libraries are stored inside the <bundle>.app folder.
For windeployqt is basically the same: <qt_install_dir>\bin\windeployqt --release <path_to_your_build>\<application>.exe. All dependencies will be inside the build folder. (Hint: copy the <application>.exe in an empty directoy and run windeployqt on that path instead. This way you get rid of all the build-files).
Regarding the static build: Just google it, you will find hundreds of explanations for any platform. But unless you have no other choice but to use one single file (for whatever reason) it would recommend you to use dynamic builds. And regarding the user experience: On mac, they won't notice a difference, since in both cases everything will be hidden inside the app bundle. On windows, it's normal to have multiple files, so no one will bother. (And if you create an installer for windows, just make sure to add a desktop shortcut. This way the user will to have "a single file" to click.)

Is it possible to build one single .exe file for my cocos2d-x game?

I managed to build a Windows executable for my cocos2d-x game using the cocos console and Visual Studio 2015 Express C++.
The output, in the "Publish" folder, is my executable game and several .dll files. As well as the game resources. In other words, my game is not contained in a single .exe, which was my expected output.
Is it possible to build one single .exe file for my cocos2d-x game? One that has everything it needs contained?
The cocos console command I used for the build was
cocos deploy -p WIN32 -m RELEASE
Probably not. But you could try.
You would need to change the project quite a lot however:
You would need to add the explicit cocos framework project to your workspace, and change that to generate static libraries. Repeat that for all other 3rd party libraries that are being included as dlls - including changing all the projects to use the static rather than dynamic c runtime. This would remove the need to have any supplementary dlls.
What would remain would be the assets. Here you would need to create a windows RC file and add all your assets as RT_BINARY resources to that. To actually load resources from your EXE's resources chunk you would need to provide a custom version of cocos2d::FileUtils, and override all the getFileDataFrom(... methods to look first in the exe's resources using the relevant win32 apis (FindResource, LoadResource, LockResource).
Very likely however there are parts of coco's that require a file path and will explicitly use file io to read from the file, in which case you would override FileUtils::fillPathForFilename to write out the resource as a file to a temp folder, and return that path to cocos.
Here is a useful blog post showing how to embed resources in a win32 binary:
* https://blog.kowalczyk.info/article/zy/Embedding-binary-resources-on-Windows.html

Run a script in eclipse before build

Simply put:
In eclipse how do I run a shell/batch script when I build? I have an external tool that can be run by hand but I want to trigger it when the project is built. Using build variables in the script would be an added bonus.
Why I want this:
I work on multi-platform games for mobile. The teams in the company I'm at use X-Code, Visual Studio, and Eclipse (Momentics) for our games. We want to be able to pick up a phone and see overlay on-top of it with information such as who built it, when it was built, what branch and revision it's from, and what library versions are being used. I've done this with X-Code by running a script on build that dumps some of that information to the resource directory of my game that I can then parse at runtime. It's really simple and I'm up for alternate suggestions if you have them; keeping in mind it must work for the three IDE's our developers use.
Bonus Sugar:
In X-Code we can use build variables which would be super nice to have for eclipse as well. I use them to change to the active cocos2d-x repository and get a git log to tell us when the last commit to that repository was made and by who. If that isn't possible in eclipse I can figure something out.
Thanks in advance!
Add a custom builder to your project: open Project properties from the popup menu, on the builders page add a new Program. That will open a "External tool configuration" page.
There you can define a script to run, and also add parameters, where you can add Eclipse variables, such as ${workspace}, etc.
Be careful though: this will run every time when the incremental project builder runs, and the configuration is shared through version control (so beware of absolute paths).

how to organize configure for plugins

There is application called "runner" located in 'app/bin' directory.
And there are a lot of plugin modules that should be located in 'app/bin/modules/' directory.
Mainly we are developing plugin modules and running them with "runner", There are no much work on "runner", only bugfixes.
Currently, to compile plugin, we compile whole project with "runner" and deploy to run environment.
Now I want reorganize it, so compile only source code of plugin.
The problem is: to compile modules we need to modify "configure.ac" to add module Makefile path, and then run "./configure"
(Second approach)
To avoid modification of main "configure.ac" I can create secondary "configure" files for plugin modules. In this case we will have a lot of "configure.ac"s. One module is implemented 1-2 days max.
I would like to hear experts' opinion for such situation.
Which approach is preferable ?
I'd go with the second approach. Adding to a system is better than modifying a system.

Can a Windows Installer perform logic like a normal application

Can a Windows Installer perform logic like a normal application?
For example: I am creating an installer that installs plugin files to a 3rd Party Application's directory on the C drive. But the destination directory will be different if the user has an old version of the 3rd Party Application.
So the installer needs to determine what version of the 3rd Party Application is on the C drive. If its the new version I install the plugin files to C://Program Files//3rdPartyApplication// and if its the old I install to C://3rdPartyApplication//
So can a windows installer perform logic and if not can it run batch files that can do this?
An "installer" is just a regular application designed to unpack its contents onto a persons hard drive, and possibly perform actions like registry modifications.
If you use a installer like install shield for example you will have to look at that installer documentation to see what it can do. Most installer applications have some sort of area to create custom scripts.
You could also build your own, it is really not very hard.
Yes, installer can perform logic just like regular application. From this point of view, an installer is a regular application.
How you program installer logic depends on which installer suite you use. For detecting whether an application exists in C:\Program Files\3rdPartyApplication or in C:\3rdPartyApplication, you can use FileSearch element of WiX Toolset, look through Windows Installer documentation: Searching for Existing Applications, Files, Registry Entries or .ini File Entries.
More sophisticated logic can be implemented by custom actions. [Custom Actions}(http://msdn.microsoft.com/en-us/library/aa368066.aspx) can be written in JScript, VBScript, C/C++ (DLL or EXE; yet the EXE can't communicate to the Windows Installer session).
I'd like to give a different perspective. Windows Installer is a declarative domain specific programming language. It is not a Turing complete general purpose programming language. It is not intended to be just like any other application. It can be extended with custom actions written in general purpose programming languages such as C++/C# but it should stil follow the same declarative approach where you seperate the "how" to do something from the "what" to do.
Now to answer the second part of your question. Windows Installer has built in searching capabilities. Read the MSDN topics on the AppSearch standard action and related tables (AppSearch, Signature, DrLocator, CompLocator, RegLocator ) You can also put conditions on components and you can set directory destinations dynamically so yes, there are ways of doing what you want to do.
It would require much more information to explain exactly how to do it.
Yes, Windows Installer can perform logic like a normal application.
You can use the WiX Toolset, as suggested by Alexey to get the job done.
You can use the FileSearch element ( http://wix.sourceforge.net/manual-wix3/wix_xsd_filesearch.htm) to check for the existence of files or the RegistrySearch element ( http://wix.sourceforge.net/manual-wix2/wix_xsd_registrysearch.htm) in case you want to check using a registry key.
Alternatively, if the search isn't as simple as checking for a file or a registry, a Custom Action would let you write managed or unmanaged code (according to your preference) to check which version of the 3rd party application is installed.
On the basis of the result of your search, you can, at run-time, change your install directory. A Type 35 Custom Action would let you change the install directory:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa368093%28v=vs.85%29.aspx