Jump to content

Install Apps From Another Drive


Recommended Posts

I have put together an unattended cd with no problem, but I find that I am always updating apps with new versions.

I would rather create a generic xpcd that directs start.cmd or runonceex.cmd to install my various programs from my d:\install files directory.

This way I can update the apps without having to create a new cd and also install more programs than would fit on a cd in the $OEM$ folder.

I haven't been able to figure this out.

Link to comment
Share on other sites


I did read that post, but I'm not trying to install Windows from another hard drive, I just want RunOnceEx.cmd or Start.cmd to install programs from a hard drive after windows has been installed.

Normally, the programs are copied from the cd OEM folders and installed from C:\apps. I want to direct the install to be done from D:\install files (for example).

Link to comment
Share on other sites

Ow, sorry I misunderstood your question :P

This can be done very easily.

You can do this in two ways:

Method 1

You can use the drive path of which you want to install from.

Example, you want to install from another harddrive ( D:\ ) and you have your applications under d:\install_files.

You can now use this line under RunonceEX:

REG ADD %KEY%\010 /V 01 /D "D:\install_files\peace_of_software\application /Switch" /f

In this way $OEM$\$1 folder isn't neccesary anymore.

Method 2

Ofcourse you want to use direct paths as less as possible. So now we are going to change D:\ into %harddrive%

Add this line to the top of your RunonceEX:

SET tagfile=\install_files\install_from_harddrive.txt
FOR %%i in (c d e f g h i j k l m n o p q r s t u v w x y z) do if exist "%%i:%tagfile%" set harddrive=%%i:

Now, create a textfile (you can leave the file empty) and name it install_from_harddrive.txt

Be sure to put it in the right folder like this:

D:\install_files\install_from_harddrive.txt

.

D:\ can ofcourse be something else.

When this batch is loaded, it will check the locations C:\install_files to Z:\install_files to find if the file install_from_harddrive.txt exists. If so, this drive can be called with %harddrive%.

Now you can use code like this in your runonceex:

REG ADD %KEY%\010 /V 01 /D "%harddrive%\install_files\peace_of_software\application /Switch" /f

I hope this help

Erik

Link to comment
Share on other sites

Thanks for your help. That's what I'm looking for. I think my problem has been the spaces in the path.

Why is that not a problem for an install from OEM folder C:\apps, but it is when you direct it to D:?

For example, I had no problem with my Batch.cmd that I loaded from:

[GuiRunOnce]

%systemdrive%\apps\batch.cmd

Can I have winnt.sif directed to D:\install\batch.cmd or is it better to stick with runonceex.cmd?

ECHO.

ECHO Installing K-Lite Codec V2.34 ...

ECHO Please wait...

start /wait %systemdrive%\apps\K-Lite Codec\klcodec234f.exe /silent

But, to install it from D:\install\Batch.cmd I had to change it to:

ECHO.

ECHO Installing K-Lite Codec V2.34 ...

ECHO Please wait...

start /wait %systemdrive%\apps\K-Lite_Codec\klcodec234f.exe /silent

without the space in the folder name.

Link to comment
Share on other sites

Here Is Another Way With A Error Control

Blue Is The Folder adjust to your needs

echo off && cls && Mode 65,5 && Color 5e && Title My Install

set P4=Ping -n 4 127.0.0.1

SET tagfile=\SomeFolder

FOR %%i in (c d e f g h i j k l m n o p q r s t u v w x y z) do if exist "%%i:%tagfile%" set harddrive=%%i:\

if exist "%harddrive%" goto Confirm

if not exist "%harddrive%" goto Missing

:Confirm

echo. && echo Your Install Location -^> %harddrive%

%P4%>nul

goto quit

:Missing

echo. && Echo The Location Not Present && %P4%>nul

goto quit

:quit

Goto EOF

exit

Link to comment
Share on other sites

Thanks for your help. That's what I'm looking for. I think my problem has been the spaces in the path.

Why is that not a problem for an install from OEM folder C:\apps, but it is when you direct it to D:?

For example, I had no problem with my Batch.cmd that I loaded from:

[GuiRunOnce]

%systemdrive%\apps\batch.cmd

Can I have winnt.sif directed to D:\install\batch.cmd or is it better to stick with runonceex.cmd?

ECHO.

ECHO Installing K-Lite Codec V2.34 ...

ECHO Please wait...

start /wait %systemdrive%\apps\K-Lite Codec\klcodec234f.exe /silent

But, to install it from D:\install\Batch.cmd I had to change it to:

ECHO.

ECHO Installing K-Lite Codec V2.34 ...

ECHO Please wait...

start /wait %systemdrive%\apps\K-Lite_Codec\klcodec234f.exe /silent

without the space in the folder name.

The problem isnt the location.. the problem is that in your original example, you have spaces in your paths... you need to use quotes. i.e:

start /wait "%systemdrive%\apps\K-Lite Codec\klcodec234f.exe" /silent

Link to comment
Share on other sites

Ping -n 4 127.0.0.1>nul will ping that ip address (your local machines 'loopback' address) for 4 seconds (-n 4).

This is just a common way of 'stalling' or 'pausing' your batch file for a determined about of time.

The syntax he used just cleaned it up a bit... he created a variable called 'P4' and set it to 'Ping -n 4 127.0.0.1'. This way if he had to use it multple times through out the script he can simply reference the variable instead of typing out the entire line every time.

Link to comment
Share on other sites

Ping -n 4 127.0.0.1>nul will ping that ip address (your local machines 'loopback' address) for 4 seconds (-n 4).

This is just a common way of 'stalling' or 'pausing' your batch file for a determined about of time.

The syntax he used just cleaned it up a bit... he created a variable called 'P4' and set it to 'Ping -n 4 127.0.0.1'.  This way if he had to use it multple times through out the script he can simply reference the variable instead of typing out the entire line every time.

You Beat Me To It Thanks For Replying :thumbup

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...