PDA

View Full Version : Run From CD-DVD ROM



ender
04-27-2013, 09:55 AM
I trying to get my exe to copy a file\folder structure from compainon DVD. I'm found the below code in anohter thread, howeve I cannot find some of the items; i.e. "Count List Items". Is this because I'm using a newer version of SetupBuilder. Started with 7.x, now using 8, and this post was from 2007.

Set Variable %AVAILABLEDRIVES% to ScriptItem->Get System Information(Enumerate Disk Drives)
Set Variable %COUNTDRIVES% to ScriptItem->Count List Items(%AVAILABLEDRIVES%)
Set Variable %DRIVEID% to "0"
Loop (%COUNTDRIVES% Times)
Set Variable %DRIVEID% to (Increment Variable by 1)
Set Variable %DRIVE% to ScriptItem->Get List Item(%AVAILABLEDRIVES%, %DRIVEID%)
Set Variable %DRIVETYPE% to ScriptItem->Get System Information(Drive Type) of "%DRIVE%"
If %DRIVETYPE% Equals "$DRIVE_REMOTE$" Then
Display Message Box "%DRIVE% is a network drive!" -- ""

linder
04-27-2013, 10:13 AM
Hello,

Quick question: is your setup.exe located on this CD/DVD and you would like to copy a folder tree as part as your installation from CD/DVD to the target machine?

Friedrich

ender
04-27-2013, 11:55 AM
No. It will be external.

ender
04-27-2013, 06:30 PM
Setup.exe will be on seperate.

linder
04-28-2013, 02:34 AM
Hello,

You can the following in:

1. Get System Information(Enumerate Disk Drives)

Script Editor -> "Get System Info..." -> Enumerate Disk Drives

2. Count List Items

Script Editor -> "Handle String Operation..." -> List Item: Count

3. Get List Item

Script Editor -> "Handle String Operation..." -> List Item: Get

4. Get System Information(Drive Type)

Script Editor -> "Get System Info..." -> Drive Type

Friedrich

ender
04-28-2013, 09:30 PM
My it just my inexperience with programing; not a programer. I'm using the following code trying to get to copy info from DVD onto the C:\. I did set the code to do a pop box to verify it would find the DVD\CD ROM. See attached.

Trying to get the variable set to use Copy folder no matter what drive letter is set for the dvd.

linder
04-29-2013, 12:20 AM
To be honest with you, I still don't understand what you are trying to do. What if the user has multiple CD/DVD drives? Why is the setup.exe not located on that specific CD/DVD? Why do you need this code at all?

Friedrich

ender
04-30-2013, 08:13 AM
I thought about that after the last post; multiple drives. Over 90% of our clients have single drives. Creating an exe for our techs to prefrom workstation setup. Would like the exe to be able to do both; if possilbe find the files from an DVD ISO rather the setup.exe was on the media or local to the workstation.

I'm trying to work on how to detect the CD\DVD ROM (done), then assign it as a variable. Long term I would like to work this out to be something like if drive is CDROM and has "X" folder then ___. For right now, just working on setting the CDROM as a variable.

linder
04-30-2013, 08:34 AM
It's still not clear to me why do you have to do all this <g>. In fact, CD/DVD is already a thing from the past. Even if customers receive something on CD/DVD, most users will copy it over to a portable USB hard drive or an USB stick or a WiFi hard drive, etc. So IMO, it would be a bad idea to use this CD/DVD detection mechanism for your install. An installation should continue to work if the media format changes.

Friedrich

ender
04-30-2013, 08:44 AM
Sending out compainon media on 8.5 DVDs. Other installation files are totaling about 8.4 GIG. DVDs are cheap media, and we don't have to track them; once they leave they are gone. I just need a tech to run the exe and copy the additional staging files from the media; in ISO. Most of our clients are using VMs, so this format we can ship out and forget about it. Once client receives it, they place the DVD in the drive, tech mounts the ISO on the VM, runs the setup.exe to prep the system and extract the staging files.

linder
04-30-2013, 09:08 AM
Aha, okay. This makes sense. For quite a few custom script writing projects, we also created .ISO images (stores setup.exe and optional external files) to be mounted on VMs. But what we do is, we let the setup.exe detect its on source location. Based on this information, we know where all the other external files (that are not included in the setup.exe) are located and then simply copy them over ("Copy Files" and/or "Copy Folder Tree" script functions) from the source to the target.

Friedrich

ender
04-30-2013, 10:02 AM
I'm using the Extract Drive Letter, but when I run from the DVD, it is not populating the dirve letter in my variable. If I run from the harddrive, it will detect the drive letter. To test this, I ran from both Hard Drive and DVD and had it write the variable into line 1 of a text file to see if it was passing the variable.

When running from hard drive it passed "C:" into my text document. When running from DVD it passed ":" into my text document; not the drive letter. Thoughts?

linder
04-30-2013, 10:34 AM
Hello,

I have developed and uploaded a source code project for you:

http://www.lindersoft.com/projects/extractdrive.zip

What does the compiled "extractdrive.exe" return on your DVD?

If your DVD is drive letter E:\ and "extractdrive.exe" is located in the root folder then it should display E: as drive letter.

Friedrich