Solved

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

Posted on 1998-12-04
3
219 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
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
trillo earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Not that I know, I think you have to build some algorithm to detect all the cabinet files in the CD
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now