khadgar Posted September 21, 2004 Share Posted September 21, 2004 Install applications in any directory you wantGot 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\CustomDirThis trick didn't work for the Wise Installer but the next one did 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.40ECHO Please wait...regedit /s %systemdrive%\install\progfilestmp.regstart /wait %systemdrive%\install\Applications\ToolsCompression\WinRAR34\wrar340.exe /sregedit /s %systemdrive%\install\progfiles.regEcho Moving WinRar Start Menu Items and Shortcutsmove "%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 More sharing options...
sleepnmojo Posted September 21, 2004 Share Posted September 21, 2004 You can use CommonFilesDir for the common files directory.Also rather than using the registry files, stick with REG.EXE. Would be a little cleaner here, IMHO. Link to comment Share on other sites More sharing options...
Nologic Posted September 21, 2004 Share Posted September 21, 2004 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now