3

I'm struggling to find any method that works with current Unity.

This for a conventional Windows build (not a Windows Universal via VS).

So, there's the separate data, dll, etc files of a build: how to create a civilian-usable "single exe" for Windows, with current Unity??

Fattie
  • 27,874
  • 70
  • 431
  • 719
  • 1
    Excuse my missing of knowledge but wasn't this always the case anyway? :D I remember at least building Standalone with 2017 also created the exe + folder with additional files or am I confused? ^^ – derHugo Jul 21 '20 at 14:08
  • Also maybe you could use something like [Appacker](https://github.com/SerGreen/Appacker) to finally pack the entire build folder into one exe? – derHugo Jul 21 '20 at 14:15
  • Agreed with @derHugo, afaik nothing changed for the Windows build target between 2020 and pre-2020. [Left folder is build in 2020, right folder build in 2019.3](https://gyazo.com/f3271bb446996f0bd1c076a642631c7e) And as far as I can remember Unity never had an option to build everything into just one single .exe. could it be you are thinking about an installation wizard that is a single .exe that installs the rest of the required files? – Remy Jul 21 '20 at 14:19
  • Men - understood; you may well be correct. But then ...... what to use?? Appacker is not usable due to windows defender :/ – Fattie Jul 21 '20 at 15:39

2 Answers2

7

As said afaik this was actually always the case.

See e.g. Windows standalone Player build binaries to see a list of resulting output of a build. It exists back until version 2017.2.

So the short answer is:

It is how it is. You will always get multiple files and the data folder as output.


What you can do however is using a pack tool which simply packs all your folder content into one single exe file.

One example is Appacker

enter image description here

=>

enter image description here

BUT unfortunately there is one known issue: Windows Defender recognizes it and every exe created with it as malware. The reason for that is actually mentioned by the author in the link

Spoiler: A self-extracting .exe file? Windows Defender hates that trick!

So either with this tool or any similar one there is no real way around that except you need to trust the tool and your users need to trust you ^^

(The icon is also only used for the process window, not for the exe file itself ^^)


The long and correct way would probably be to create an actual installer for your final app which is then allowed to extract all the files to a certain location.

So in the end the user anyway will again have an exe and according data and dll files e.g. in the Programs folder but get a registered shortcut to the Start Menu which is just how any other application on Windows usually works like.

derHugo
  • 83,094
  • 9
  • 75
  • 115
  • Ah, thanks for this answer - but unfortunately then Apppacker is not usable? – Fattie Jul 21 '20 at 15:38
  • Well it is if you trust it and your users trust you ;) Unfortunately it will most probably be the same for most other tools that do the same as well .. the author just answered my comment on the issue and it looks like there is no real way around since the anti-malware searches for exactly the things the tool necessarily does .. it is e.g. it's while purpose to extract/unpack data from itself .. but exactly this (among other similar criteria) is recognized as a malware ^^ – derHugo Jul 21 '20 at 16:02
  • @Fattie I added a bit more detail and at the bottom the probably "correct" way: Create an actual Installer for your program like it is usually done for any other programs you install on your PC ;) – derHugo Jul 21 '20 at 16:14
1

Just to add to the answer.

In 2020 if it's a game you should just use Steam. Making auto-update way easier for your users.

https://partner.steamgames.com/doc/gettingstarted

  • This is better as a comment, basically a lot of people still practice something known as demos where it's much easier to send a game as a single file that doesn't need unziped. Appacker is more or less a work-around since it unzips then runs a file for the end user, meaning re-launching is a pain most of the time. – Codingale Dec 15 '21 at 20:39
  • Still can't add comments to this site. >< I'm sorry. It just won't let me do anything. As for demos, I get it to post on site like itch.io. Steam also has a demo feature that's also nice. But then it gets into the realm of the dev preference. – Linkupdated Dec 17 '21 at 08:18