Jump to content

Install applications in any directory you want


khadgar

Recommended Posts

Install applications in any directory you want

Got stuck while trying to get a Wise Installer application to perform a silent install into the directory of my choice.

First I tried to change the programfiles variable by using:

set programfiles=X:\Program Files\CustomDir

This trick didn't work for the Wise Installer but the next one did :lol:

So far I have been using this for WinRAR and QuickPar.

Start Notepad and copy and paste the following code into it:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion]
"ProgramFilesDir"="C:\\Program Files"

Save this as progfiles.reg in the root of your $OEM$\$1\Install directory.

Now you have a reg file with the default location of the Program Files directory.

Next we're going to customize this:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion]
"ProgramFilesDir"="C:\\Program Files\\Tools Compression"

Save this as progfilestmp.reg in the root of your $OEM$\$1\Install directory.

In the example of WinRAR the code in my startup.cmd would look like this:

ECHO.
ECHO Installing WinRAR 3.40
ECHO Please wait...
regedit /s %systemdrive%\install\progfilestmp.reg
start /wait %systemdrive%\install\Applications\ToolsCompression\WinRAR34\wrar340.exe /s
regedit /s %systemdrive%\install\progfiles.reg

Echo Moving WinRar Start Menu Items and Shortcuts
move "%systemdrive%\Documents and Settings\All Users\Start Menu\Programs\WinRar" "%systemdrive%\Documents and Settings\All Users\Start Menu\Programs\Tools Compression"
DEL /Q "%systemdrive%\Documents and Settings\Administrator\Start Menu\Programs\WinRar"
RD "%systemdrive%\Documents and Settings\Administrator\Start Menu\Programs\WinRar"

This installs WinRAR into the Directory I specified in progfilestmp.reg and also moves the Start Menu shortcuts to the directory of my choice.

I think this might be usefull, for me it is anyway ;)

Link to comment
Share on other sites


Well I've started to do some thing of the sort with my AutoIt scripts....tho I'm just setting its install path if allowed by the installing app....some don't give you this option...so maybe in some corner cases I'll see about applying your idea. :)

Any ways good post :)

Link to comment
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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...