Sign in to follow this  
Followers 0
kpmwrestler

Makin portable applications

4 posts in this topic

I was wondering if it is possible to make programs portable with autoit?

I would like to force programs to write to a different folder than the default folder, like application data, and redirect the program to from looking in the registry to an INI file instead.

Is that possible?

Share this post


Link to post
Share on other sites



Are you saying you want to use AutoIt to modify an existing non-portal program and make it portable, or just write a program in AutoIt that is portable?

If it's the latter, of course you can since you have full control of the program.

If the former, I really don't think that's possible, unless you write a system hook to intercept that program's attempts to access the registry or specific directories.

Share this post


Link to post
Share on other sites

I want to make any program portable by changing what a program thinks is something like the application data folder or the registry and change the folder that it writes to. Kind of catching it and redirecting the writing to somewhere else.

Share this post


Link to post
Share on other sites

I want to make any program portable by changing what a program thinks is something like the application data folder or the registry and change the folder that it writes to. Kind of catching it and redirecting the writing to somewhere else.

Use SetEnv() to change the environmental variable before running the application. The example below makes @ComSpec believe that %APPDATA% is actually @ScriptDir. Some portable loaders like PStart allow for setting environmental variables which I have not used yet but assume it may do similar as the example below.

EnvSet('%APPDATA%', @ScriptDir)
Run(@ComSpec & ' /k set APPDATA')

As for registry entries, some people check for entries before starting the application, run the application, and then clean up or restore registry entries as needed. That is what the guys at PortableApps do with NSIS wrappers.

:)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0