Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Connecting to MS SQL db from Win32 application written in C 3 79
ADO Memory leak with DELPHI 2007 37 171
What does std::atomic give me? 7 114
Safe conversion? 4 58
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
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…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

861 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

25 Experts available now in Live!

Get 1:1 Help Now