Test for CD, copy files from CD - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

jafa
Posts: 51
Joined: Fri Feb 23, 2007 7:13 pm

Test for CD, copy files from CD

Hi,

I am writing an installer that needs to copy files from a CD supplied by the user.

1) I have created a custom dialog page to ask the user to select the CD-ROM drive from a combo box.
The result is stored a property "CDROM_LOCATION".

2) I created a target for CDROM_LOCATION and added a series of File Copy/Move operations to copy from CDROM_LOCATION to the APPDIR.

This works, but has two problems...

1) If the CD disc is not in the CDROM drive then the installer completes without error but does not copy the files.

2) Uninstalling does not remove the files that were copied from the CD disc to the APPDIR.
I also noticed that the files copied from the CD disc are marked as read-only. This isn't a problem but may be related.

Questions:

1) What is the best way to test if the right CD is in the CDROM drive?
I would prefer to do this as a UI action I can invoke to validate the users selection when they click Next.

2) How can I get the installer to uninstall the files copied from CD to the APPDIR.

Nick
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Test for CD, copy files from CD

Hi,
What is the best way to test if the right CD is in the CDROM drive?
This can be done by using a custom action which is executed after the user selects the CD-ROM drive. This custom action can search for the files you need to copy and show a custom message to the user if the files are not found.

Here you can find a VBScript custom action which finds and deletes a file (you can adapt the code for what you need).
How can I get the installer to uninstall the files copied from CD to the APPDIR.
During an uninstall Windows Installer removes only the resources which are registered in the MSI. If the installation folder contains files created by custom actions, by the application or by file operations, these files will not be removed. However, you can remove them by using file removal operations or a custom action. You can read more about this in the Remove a file or a folder during installation how-to.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”