Solved

How do I prompt user to insert Windows installation CD to install a file from there?

Posted on 1998-12-04
3
224 Views
Last Modified: 2010-04-02
Hi,

I am writing a setup program and I want the user to install the latest
version of, let's say, unidrv.dll, from the Windows installation CD. How
would I prompt the user to insert the CD, get the file and ask them to
reboot if neccessary?

If anyone can help me, I really appreciate it.

Thanks,
Sinping
0
Comment
Question by:sinping
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
trillo earned 100 total points
ID: 1179217
Your install program should check:
1) First locate which drive is the CD-ROM. You use  the GetLogicalDrives or the GetLogicalDriveStrings functions to know which drive letters are available.
2) Use GetDriveType to know which one of the drives is a CD-ROM
3) You must know the VolumeLabel of the CD, in order to know if the correct CD is in the Drive. This can be done using the GetVolumeInformation function.
4) If the wrong CD is in drive you prompt the user with a MessageBox to insert the correct CD (When the user presses OK you go back to step (3) until the correct disk is in the CD-ROM.

Optional and Extreme Luxe: How do you know when the Cd door is closed?.. Well, you catch the WM_DEVICECHANGE message with the DBT_DEVICEARRIVAL      parameter (wParam). This will notify your app when a new disk has been inserted in the CD-ROM.

5) You do your necessary file operations, reading from the CD and writing to the Hard Disk.

------------ To reboot
If you decide that the changes made by the Setup program need the computer to rebbot you must use the ExitWindowsEx fucntion with the EWX_REBOOT flag in the first parameter.

I hope to have helped you. I fyou need more help, tell me... also if you need the declarations for the functions I mentioned (you can find the in your developmnet tool help files)

Trillo
0
 

Author Comment

by:sinping
ID: 1179218
Your answer is helpful. However, for different OS, the layout of the CDs are different. How will I know where on the CD to look for the file? For example, Win98 CD has all those Win98.cab files.

Is there a particular SDK function to perform the update? On Win95, Win98 and Win NT?
0
 
LVL 2

Expert Comment

by:trillo
ID: 1179219
Not that I know, I think you have to build some algorithm to detect all the cabinet files in the CD
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
C++ Class Serialization, Encapsulation and Formatted Output 8 90
C++ question 3 74
object oriented programming comparison 5 85
Gaming Software 1 28
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question