You are here

How to bypass the restriction to run from C:\Program Files | Program Files (x86) ?

8 posts / 0 new
Last post
pitoloko
Offline
Last seen: 1 year 11 months ago
Joined: 2019-12-08 20:49
How to bypass the restriction to run from C:\Program Files | Program Files (x86) ?

Hi.

I come from reading a lot of old topics from year 2012-2014 on this forum from people that were asking the same thing regarding the error when trying to run a portable app from Program Files folder.

For this reason, I don't need someone to suggest me to create a "C:\PortableApps" folder or to suggest me to use normal installers instead of portable ones or to teach me about why for some (unknown, not tested at all) portable apps it is a bad idea to run them from C:\Program Files, because I already have read everything about all the warnings and issues on those old topics by answers from the developers explaining everything.

I'm only in search of an answer to the next question (which I didn't managed to figure out after my previous research reading old topics):
Is there a way to bypass the "C:\Program Files" \ C:\Program Files (x86)" restriction that does not imply to modify and recompile the source-code?. Lets say for example maybe a "hidden" field that I could set in the INI ffile of the launcher?... or something else that easy?...

In some of those old topics an user ('Aluísio A. S. G.') said there is one undocumented way to do so... but he will not give any info. What the hell?, I don't understand all this mistery and occultism just to share a solution documented or not for an user that really wants to run the portable app from 'C:\Porgram Files' even after being aware of the possible issues that it can cause, it is our decision regardless of the restriction put by-design.

Anyways. I downloaded the source-code for the PortableApps.com launcher on sourceforge and with a tool (File Locator) I searched for the env. var / string "PROGRAMFILES" inside every file of the source-code, but I didn't found anything.

It is possible to bypass the restriction without recompiling the source-code, or it is not?. If does not exist an INI field to bypass this, then another suitable way for me would be that in case of maybe exists a data in a fixed address (the same address) in every launcher generated within the same build, then I could patch all the launcher executables I want with IDA or by using an hexadecimal editor (but I'm not expert on reverse engineering so I need help to locate which instruction is disallowing the application run from C:\Program Files). Any ideas?...

That's all. Thanks in advance.

JLim
Offline
Last seen: 2 months 6 days ago
Joined: 2013-07-17 01:30
Run in Program Files directory

You need to write custome code or modify the source code of PAL Generator. Anyway you have to recompile the launcher.

John T. Haller
John T. Haller's picture
Online
Last seen: 26 min 9 sec ago
AdminDeveloperModerator
Joined: 2005-11-28 22:21
Environment Variable In Source

There's a specific environment variable you can set on your local machine that you will find in the source for the PA.c Installer. We don't mention it in the forums. As the variable indicates, if you do this you will receive no support from us for anything at all to do with any portable software. Some apps will fail to function in Program Files. Some will run in local mode no matter what due to you placing them in Program Files (Chrome et al). Even if an app deletes everything on your computer, steals your dog, and sets your house on fire, you're entirely on your own with everything. And note that not all apps will support this setting.

Sometimes, the impossible can become possible, if you're awesome!

pitoloko
Offline
Last seen: 1 year 11 months ago
Joined: 2019-12-08 20:49
Hi.

Hi and sorry for the delay.

Even if the program cheats me and have sex with my wife, I am determined to take the risk and the consequences for myself. In fact, what I intend is to use various portable third-party applications (from websites external to portableapps.com) that were created with the portableapps.com installer, so in no case could I demand support or similar things. I don't care of some apps running in local mode, I don't require some apps to be "isolated", I can let them wirte files outside installation dir.

Now, I'm aware about how to set a new global environment variable on the current machine, and you gave me a hint about the variable name but that is not enough for me, I mean that I still didn't found the variable name, because I think that I downloaded a wrong, different or maybe old version of PA from sourceforge. In fact I think what I downloaded is PA.com platform source-code which is not what I'm looking for.

I'm confused since it is supposed that PA installer was written with Embarcadero Delphi (that is what I read in this forum), but you are pointing me to a C/C++ source file (PA.c) which I didn't found. And in sourceforge there is only a readme.txt ( https://sourceforge.net/projects/portableapps/files/Source/PortableApps.... ) which says that the lastest PA installer source-code is included in the PA installer binary, but after I download and install the binary ( https://sourceforge.net/projects/portableapps/files/PortableApps.com%20I... ) it does not include any C/C++ source-file...

then...?

Maybe could you please point me to the right place where to download the PA source-code where that variable name is specified?.

I'm just asking for an hyperlink where to download the right source-code (or right binary that includes the right source-code), to be able analyze that 'PA.c' source file.

Thanks in advance.

John T. Haller
John T. Haller's picture
Online
Last seen: 26 min 9 sec ago
AdminDeveloperModerator
Joined: 2005-11-28 22:21
PA.c Installer

The PA.c Installer is written in NSIS and the installer source is included with the binary download in the App\installer directory in a file called PortableApps.comInstaller.nsi. Look at line 1000 and the following in the current 3.5.14 release. If anyone can't figure it out from this, they absolutely positively should not be doing this.

Again, I have no idea which apps will and won't support this. If a given app won't install when this setting is on, you can't ask for help making it work or a version that supports this. If a given app won't work when this setting is on, you can't ask for help making it work or a version that supports this. This switch may be discontinued or break at any time with any release of any app.

Sometimes, the impossible can become possible, if you're awesome!

pitoloko
Offline
Last seen: 1 year 11 months ago
Joined: 2019-12-08 20:49
Many thanks for your guidance

Many thanks for your guidance!. Problem solved.

ClockworkBastard
Offline
Last seen: 1 month 3 weeks ago
Joined: 2021-10-05 11:54
Zombie-thread go.

Zombie-thread go.
I try to run an application direct from its executable, and they say "can not be run in Program Files"
Does Hex editing an initial installer helps with that?
I really don't understand, why does we have a portable apps that can be run from any place but not in that particular any places Sad

John T. Haller
John T. Haller's picture
Online
Last seen: 26 min 9 sec ago
AdminDeveloperModerator
Joined: 2005-11-28 22:21
Explained Above

It's explained above. You can't do it in modern Windows without disabling UAC because apps don't have permission to write to Program Files, so all apps will fail there by default. Even if you disable UAC (which is a bad idea), many apps will run in local mode if they detect they are running in ProgramFiles and we can't bypass this with the AppNamePortable.exe launcher. We don't test which apps do and do not do this.

As mentioned above, if you really want to disable UAC and do this, you can manually set an environment variable to enable it. Look at the code to discover it. When you do this, your app will not be supported by either PortableApps.com or by the app publisher.

Sometimes, the impossible can become possible, if you're awesome!

Log in or register to post comments