Wrap a portable app into a single .exe file, or anything clean ?

  • (2 Pages)
  • +
  • 1
  • 2

28 Replies - 832 Views - Last Post: 09 March 2018 - 09:24 AM Rate Topic: -----

#16 ge∅   User is offline

  • D.I.C Lover

Reputation: 192
  • View blog
  • Posts: 1,184
  • Joined: 21-November 13

Re: Wrap a portable app into a single .exe file, or anything clean ?

Posted 07 March 2018 - 01:07 PM

baavgai, I have the feeling you imagine some kind of IT guy is going to install the app on the users' computer, or help them if they have issues. It is not the case.

I have found this thing https://www.boxedapp.com/
Of course I need Windows to try it out, so it will have to wait (I guess I should set up a VM once and for all...), but if this works I may end up with a single .exe file, and you can't find an easier process for the end user than downloading a .exe and double-clicking on it. Nothing to explain, no extra step, no skills required.

I'm not against installing. Most applications we all use require installation, but making a portable app is the task I have been given.
Was This Post Helpful? 1
  • +
  • -

#17 baavgai   User is offline

  • Dreaming Coder
  • member icon


Reputation: 7183
  • View blog
  • Posts: 14,969
  • Joined: 16-October 07

Re: Wrap a portable app into a single .exe file, or anything clean ?

Posted 07 March 2018 - 02:14 PM

View Postge∅, on 07 March 2018 - 03:07 PM, said:

I'm not against installing. Most applications we all use require installation, but making a portable app is the task I have been given.


I see. You defined "portable" as "requiring no install whatsoever." At the same time, you do need something to put on the user's box. At which point, it comes down to how you define "installation."

The BoxedApp thing looks interesting. Thanks for the update.
Was This Post Helpful? 0
  • +
  • -

#18 ge∅   User is offline

  • D.I.C Lover

Reputation: 192
  • View blog
  • Posts: 1,184
  • Joined: 21-November 13

Re: Wrap a portable app into a single .exe file, or anything clean ?

Posted 08 March 2018 - 06:22 AM

I have checked what "portable" could be mistaken for and I realised it means something more like "cross-platform" when you say "portable software" and something more like "standalone" when you say "portable application". To me, "portable" means it's not attached to anything else, like a mobile phone which is not attached to the wall via a socket.

I may have confused the two in my messages because in French "mobile" and "portable" are synonyms, as well as "software" ("logiciel" in French) and "application" are synonyms (or, more precisely, "application" becomes "applicatif" when you use it to mean something which is not hardware, whereas "logiciel" doesn't change. I suppose it is a style issue: there is no standard way to decline it).

Fun fact: we tend to say "logiciel" when we refer to Windows applications and "application" when we refer to MacOS applications. I think it is Microsoft's fault: they must have mistranslated "application" in Windows and it sticked (or is it the other way round?). I will check if they have corrected it when I install Windows 10 on my VM.

And even more fun (woohooo), when people say "application" to refer to an application in France, they are often called Apple fanboys when, in truth, they are correct and Apple translated correctly. It is also funny that we had to create the word "applicatif" when there was already a word to mean "software": "logiciel", simply because it had been misused. It is further proof that in languages usage prevails.

Oh, and yet another thing! We tend to use "application" when we refer to mobile apps and "logiciel" when we refer to desktop apps, simply because the first smartphones were iOS or Android phones, so their wording, for most people who use Windows desktops, has been associated with mobile and smart devices. Isn't that funny? I mean, what a mess!

It probably doesn't interest anyone but me here but I share it anyway XD

This post has been edited by ge∅: 08 March 2018 - 06:40 AM

Was This Post Helpful? 0
  • +
  • -

#19 baavgai   User is offline

  • Dreaming Coder
  • member icon


Reputation: 7183
  • View blog
  • Posts: 14,969
  • Joined: 16-October 07

Re: Wrap a portable app into a single .exe file, or anything clean ?

Posted 08 March 2018 - 07:48 AM

Actually, for me, that's quite interesting.

I recently had great fun trying to worry out all the signs in France. Amiens seemed to have more than its fair share real estate agents, or "agent immobiliers," which revealed a whole weird rabbit hole of how the French use "mobile" and "immobile" in various contexts.
Was This Post Helpful? 0
  • +
  • -

#20 Radius Nightly   User is offline

  • D.I.C Regular

Reputation: 33
  • View blog
  • Posts: 291
  • Joined: 07-May 15

Re: Wrap a portable app into a single .exe file, or anything clean ?

Posted 08 March 2018 - 07:54 AM

Packing it inside single exe is a problem for you. You will lose functionality of some dlls or similar files (so they have to be written somewhere in order to work, maybe TEMP), and there is a chance that your web-game wont work for same reason, you will have to include your web-render engine (like firefox, that leads to other problems for users), so you have to use IE that most Windowses has (make it similar as how Steam are using it), if your game doesnt have problems with that running from RAM.

You can use some SFX extractors or iexpress (built it Windows), so each time you run exe, it gets extracted to temporary files, and launch, after closing it, files gets deleted. Will work fine without extraction progress if your project are not so big. Some SFX will protect packed exe if you are afraid that someone will simply extract them, and do whatever he wants.

For that reason, if you dont want installer, self-extracting will probably be a better option, but making it not look like just as extractor, for example, run exe, accept license, and your project gets extracted to local files of a current user (so another user would need to accept license too in order to have/use it), creating shortcut at start menu and desktop, and launching your main.exe. Users wont sneak into local files to see whats there of your project if everything is fine, even if they do, it can be packed (things that are working inside of one exe, and the rest thats not working such as some dll for itself). So you can still hide most files in a single exe.

Also that virtualization method doesnt working well on every Windows. For example im working on similar thing, i made it working, its fine, on XP, its great success, on Windows 10 working, another Windows 10, for each success there is an error. Sounds confusing, something execute successfully, going to close and boom, crash itself (but whole software continue to working leading to success), and send/dont send Windows option are annoying, so be prepared to hunt down this kind of problems. Its by Windows, and peoples likes to tweak their beast.

There is a free and paid solutions, both went into the same war and same problems, but paid solution are better to secure/encrypt your application files (if you really want that). VMW got probably the best one overall, but you will need to boot Windows installation disc, go to CMD, and make your portable application for best results, but it cost like $1k.
Was This Post Helpful? 1
  • +
  • -

#21 ge∅   User is offline

  • D.I.C Lover

Reputation: 192
  • View blog
  • Posts: 1,184
  • Joined: 21-November 13

Re: Wrap a portable app into a single .exe file, or anything clean ?

Posted 08 March 2018 - 10:54 AM

Thanks a lot Radius for your Input. It contains tons of keywords for me to look up.

You have scared me about the virtualisation method. I can't offer support for desktop applications and lower level stuff. This is why I use Elelctron, because it's not a native app: if something goes wrong, it will be related to the included browser engine and I will know how to deal with it. I was a bit worried that the virtualisation method impacts too much performances anyway, and it wouldn't benefit me as much because the app is already portable, there is no need to emulate a registry, this kind of thing, There is already a Javascript interpreter and a web renderer included. I just want a clean executable.

I like the idea of the self-extracting archive which cleans after itself. If I can make it hide the files it's even better.

The encryption is a big issue for me, because the app use to be secure when it was web-based, and there are relatively sensitive informations in it, but the client is ready to give up the security and have their user password-protect their devices and be mindful about what they do with the executable, which is so easy to share or steal. If I can make it secure I am sure the client will be happy to pay an extra ($1k is very big for such a little app though, and I don't see myself answering such requests many times a year - by the way I just bought another licence of Windows 10 and it's incredible how a full OS costs so little when an app like CMD costs so much)


baavgai, I agree "immobilier" is a funny concept. "mobilier" is for furniture, because you can move them around, and "immobilier" is for the walls, because you can't move them. That's how it was explained to me when I was a child and it made a lot of sense to me. But you actually make the same distinction for many things. For instance, you have "street furniture" (literally the same in French, "mobilier" being the French for "furniture", with this extra component of mobility in it), which always made me laugh (I imagine tables and shelves in the streets), it's obvious that street furniture is meant to be moved and replaced/upgraded easily. In accounting you also use the wording "fixed asset" ("actif immobilisé" in French, same idea), but you don't carry the metaphor further: when we literally say "circulating assets" in French, you say "current assets", but really, it's the same idea, you simply stopped half-way (well I say "you" but I don't know where each of you guys come from).

This post has been edited by ge∅: 08 March 2018 - 10:58 AM

Was This Post Helpful? 0
  • +
  • -

#22 Radius Nightly   User is offline

  • D.I.C Regular

Reputation: 33
  • View blog
  • Posts: 291
  • Joined: 07-May 15

Re: Wrap a portable app into a single .exe file, or anything clean ?

Posted 08 March 2018 - 12:33 PM

View Postge∅, on 08 March 2018 - 06:54 PM, said:

virtualisation method impacts too much performances

Depends on your files. Virtualization loads all files in RAM before launching your game, even if its a big amount of data (like 500MB), game will launch in between, so most important files goes first (intro, start menu, etc.), and while you are in the game, process of unpacking files that will be needed later will continue (stage 2, 3, 4...), using 500MB of RAM for files, +4KB per file, and your game requirements, if any of this files are needed, to be read, modified or so, its faster then SSD on PCI-E. About registry, you can use virtual registry (static things), as well as users real one (thats not virtual).
If its small, not a big deal, no one today care if your game will consume 30 or 100 MB of RAM. But if its 2GB, it may eat 6-8GB of RAM, and Windows OS have problems with I/O on files bigger then 2GB.

View Postge∅, on 08 March 2018 - 06:54 PM, said:

I like the idea of the self-extracting archive which cleans after itself. If I can make it hide the files it's even better.

With self-extracting, when they unpack, they are there and can be exploited, applying system hidden attribute may cover stuff for non geeks, not a good thing, but virtualization are hiding them, and protecting, only trough your application this files are accessible, and because there is a protection, if user try to see this files trough Windows (and most explorers), your game will crash, because Windows trough your application knows there are files, trying to access them leads to RAM thats protected, OS gets confused and crash everything thats connected to it (whole game).
Here is example, what Windows can see (left, files doesnt exist, they are in RAM), what virtualized application can see (right, and can use them), but because me (as user, saw it or tried to use it in another way, maybe exploit), crash is unavoidable. http://i.cubeupload.com/0hKSX6.png

View Postge∅, on 08 March 2018 - 06:54 PM, said:

The encryption is a big issue for me,...

Thats probably what you mean by performance issue. Virtualization encrypting it, needs additional CPU power to decrypt and encrypt all the time, it also constantly changing variables and moving them around in RAM, until its needed by your application, making hacking hard, so if someone try to hunt down the password, its in RAM, password are changing to random things every several MS, and jumping around like fragmenting and defragmenting, if you capture it, it will be non-sense garbage and not encrypted password. All of that cost additional power based on size, but if its something small (eg. 20MB), it wont cost even CPUs 0.1% of usage, while using more RAM grants performance and protection. However, because of various problems that are unknown for each project, making virtualization requires additional tests in order to get information if something doesnt working well trough VT (from RAM), eg. some dlls wont work from RAM for various reason, and you dont know that, until you test it.

Im currently using VT, he got one archive with hell of a generated password (in case someone try to hack the main exe file instead of RAM), and he is extracting it from RAM to TEMP when needed, so you can combine virtualization with self-extraction.
If you already got portable application (with lots of files), you can try both options combined:
-Make self-extraction (clear at close and that kind of thing, while its running, user can access it finding it)
-Make virtualization of everything (probably wont work, some things may require extraction to disk)
-Make virtualization with static files only (eg. game.exe will contain license.txt, image.png, static.dll, this will be and work from RAM), then make self-extraction of that and the rest of data (game.exe, dynamic.dll, cache.tmp), if user finds it, there will be less files to exploit (in this example only dynamic.dll and cache.tmp, and also virtualization can take care of this files extracting them again, same as self-extract).
You can try it and see.

This post has been edited by Radius Nightly: 08 March 2018 - 12:39 PM

Was This Post Helpful? 1
  • +
  • -

#23 ge∅   User is offline

  • D.I.C Lover

Reputation: 192
  • View blog
  • Posts: 1,184
  • Joined: 21-November 13

Re: Wrap a portable app into a single .exe file, or anything clean ?

Posted 08 March 2018 - 03:46 PM

Thank you for all of this information. It's stimulating my curiosity like crazy and it makes me want to learn more about how Windows works. It is funny because I have always been interested by low level stuff (by the way this youtube channel is very cool) and cosmetic stuff like procedural images and animations, but not by what lies in the middle and I understand it was a mistake.

I am not a fan of hiding files in general (I hate it in MacOSX, you always find them messing your server code, or you realise you have deleted some which were actually useful to you...), but since the extraction is only temporary, it can make things look more tidy, or even be used creatively: you can for example leave one file visible with a custom icon saying that the app is running (I imagine you shouldn't remove the external storage while the application is open, so it makes sense to warn the user - by the way this seems to be a downside of the self-extracting approach). But that's just looks.

Oh, and I have just looked it up and Windows10 uses the (transparent) words "program", "application" and "functionality" instead of "software", and it uses them correctly, even though it is a bit confusing (to delete an app you click "ad and remove programs" and it opens a window entitled "Applications and functionalities"...)
Was This Post Helpful? 0
  • +
  • -

#24 ge∅   User is offline

  • D.I.C Lover

Reputation: 192
  • View blog
  • Posts: 1,184
  • Joined: 21-November 13

Re: Wrap a portable app into a single .exe file, or anything clean ?

Posted 09 March 2018 - 04:10 AM

A little update about the Bat_To_Exe_Converter solution: on some computers, Windows Defender gets crazy and deletes the generated executable, or there is a warning, or the user is asked to run in as administrator.
Was This Post Helpful? 0
  • +
  • -

#25 baavgai   User is offline

  • Dreaming Coder
  • member icon


Reputation: 7183
  • View blog
  • Posts: 14,969
  • Joined: 16-October 07

Re: Wrap a portable app into a single .exe file, or anything clean ?

Posted 09 March 2018 - 05:39 AM

You mentioned Windows 10. That opens up a world of toys.

Windows 10 comes with PowerShell and this helpful function: Mount-DiskImage. So, if you could make a self contained ISO...

Now, to make an iso, you'll need extra stuff. Using my cygwin ( well, babun ) I made a quick ISO:
mkdir stage
cp `which calc` stage
rm myapp.iso
mkisofs -r -R -J -l -L -V "myapp" -o myapp.iso stage



So, now I have an ISO with a single exciting exe. Of course, it could have anything and all supporting resources.

I'd make a script to do this: one iso, one script. Though you could have the user mount it with a right click, if they were up to that.

Here's an example script:
$appIso = "$pwd\myapp.iso"
Dismount-DiskImage -ImagePath $appIso
$drive = Mount-DiskImage -PassThru $appIso | Get-Volume | %{ $_.DriveLetter }
$appPath = "$($drive):\calc.exe"
Invoke-Expression $appPath



I kind of like this approach and might use it myself sometime. Alas, at the moment I have too many users who need Win7 pried from their cold dead hands.
Was This Post Helpful? 1
  • +
  • -

#26 ge∅   User is offline

  • D.I.C Lover

Reputation: 192
  • View blog
  • Posts: 1,184
  • Joined: 21-November 13

Re: Wrap a portable app into a single .exe file, or anything clean ?

Posted 09 March 2018 - 07:17 AM

This is nice indeed.

It is surprising how many solutions there are to this problem. I am starting to wonder why portable apps are always so unattractively packaged (when they are not part of a suit with a launcher).
Was This Post Helpful? 0
  • +
  • -

#27 Radius Nightly   User is offline

  • D.I.C Regular

Reputation: 33
  • View blog
  • Posts: 291
  • Joined: 07-May 15

Re: Wrap a portable app into a single .exe file, or anything clean ?

Posted 09 March 2018 - 07:56 AM

Thats interesting, i think Windows Disk Image are used for installations of Windows only. Does it working without PS? Can it be clean by ECM or does it support compressed ISO? Unpacking is a problem for him, because there are some important files that can be exploited.

BAT to EXE are usually banned by all AntiViruses, because long time ago (2001, XP...) it was used to make all kind of viruses (like 99% of viruses was packed with BAT to EXE and UPX), because its encrypted, protection softwares cant know what it is, so cant scan it, but it have a clue thats BAT in EXE, it extract BAT as TMP file in TEMP in order to work, if its something bad, its too late for protection, because who knows what its doing.
Dont know status of LUA compiled EXE that containing BAT.

There are some sexy portable launchers, but most of them trying to be simple as possible, or without any GUI or CLI.
Was This Post Helpful? 1
  • +
  • -

#28 baavgai   User is offline

  • Dreaming Coder
  • member icon


Reputation: 7183
  • View blog
  • Posts: 14,969
  • Joined: 16-October 07

Re: Wrap a portable app into a single .exe file, or anything clean ?

Posted 09 March 2018 - 08:31 AM

PowerShell is just a wrapper around Windows DLLs and .NET GAC. So, if you can do it in PS, you can probably find a way without. It's more about Windows 8.1 or greater, which provides mount ISO ability natively. Indeed, from good ole cmd.exe, that OS should mount and open an .iso with explorer isofile. Which is interesting, though not that helpful. If you have Windows 8.1 or greater, you also already have PowerShell.

An .iso is a disk image. If by compressed iso you're talking about foo.iso.zip, then that wouldn't work. However, within the iso itself you could compress anything you like. It helps if you think about an .iso as a DVD you're going to hand someone. Only, it's the file that would be used to create the DVD and the OS has the ability to pretend it's a physical DVD, rather than a virtual one.
Was This Post Helpful? 0
  • +
  • -

#29 Radius Nightly   User is offline

  • D.I.C Regular

Reputation: 33
  • View blog
  • Posts: 291
  • Joined: 07-May 15

Re: Wrap a portable app into a single .exe file, or anything clean ?

Posted 09 March 2018 - 09:24 AM

I know PS are introduced in 8+, but im not much into PS, useful information. Compiling LUA code that running Batch (eg. os.execute("echo:Hello World")) may not have any problems with protections (like anti-virus, because its not BAT to EXE, its a compiled script).

I know what ISO is, and how its working, but im asking things that i dont know if its available, because it sounds interesting.
CISO is same as ISO, but compressed, also image, same functionality, same thing, so im not talking about foo.iso.zip.rar.7z... im talking about foo.iso and foo.ciso, both are equal. Sony first made it, so right extension of CISO would be CSO (check it out, its short).
So, Windows has his own disk image (extension is .wim - Windows Imaging Format), used for installing OS trough ramdisk, and some applications trough PS. So it make sense they support compression to save storage and make installation quicker. ECM actually encrypting ISO making X% of recovery possible, but there are softwares who can clear garbage (such as files date, time, attributes, etc.) from ISO file to make it smaller (small amount), sorry for wrong information.
It means, Windows OS support his own WIM (you can make it, does it support compression and can you use it for different things then installation is a question?), as well as ISO (probably from burning segment). What im asking, does Windows support CISO (Compressed ISO) or does it support his own (WIM) compression (since its used by OS and because we can make the same image). For example, Sony PSP (like PSP Vita) and similar devices that support running games from ISO, also support CISO, in order to save storage and increase its speed for the price of launching speed (like 3sec longer launching).
Because CISO needs some rework (most ISO softwares doesnt support CISO and dont have their custom compression ISO option, including all kind of burners, so its probably very big deal to make), means there is a greater chance that Windows support compression of his own image (WIM), same as others supports their own image option (this is example from my Daemon: http://i.cubeupload.com/g6mUsX.png ), but even Nero, Alcohol or any other burning software that have its own custom disk image usually support compression. Turning it down to 25% ratio is a big deal for big files, but also useful for smaller files (eg. 300MB). And because IDK too much about WIM, the idea sounds interesting to me.

BTW Its interested, because peoples arnt using this. Storing files in ISO putting them in danger, while storing them in CISO, WIM (with compression and/or password, etc.) or another not so popular image bringing problems to this who wanna reverse it or so. Edit: Looks like WIM works with LZX compression.

Edit:
This is example of running batch code from lua thats compiled into single exe:
http://i.cubeupload.com/4rCn4w.png
And this is what VirusTotal say about it:
https://www.virustot...e2ccc/detection
Much better then any BAT to EXE converter. Same thing can be done in other languages.

This post has been edited by Radius Nightly: 09 March 2018 - 01:30 PM

Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2