Solved

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

Posted on 1998-12-04
3
227 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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

628 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