Uninstall requires installation media unnecessarily - 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!

crairdin
Posts: 15
Joined: Wed Mar 07, 2007 7:26 pm

Uninstall requires installation media unnecessarily

I install my application from a CD-ROM. When uninstalling my application I get an error "Folder path 'My Folder' contains an invalid character". If I uninstall while the CD is inserted, then the uninstall works fine.

I have narrowed this down to a search. I am doing a search in the SETUPEXEDIR for a folder called "My Folder" then using that as the source for a copy/move during installation (all the files in My Folder on the SETUPEXEDIR directory are copied to a folder on the target machine).

If I change my install so that it does not do this search and copy operation, the uninstall works without the installation media being present.

If I change my install so that it does the search and I add the property-based folder to my "Files and Folders" but DO NOT add the copy operation to move the files, then the uninstall fails as described above.

I'm doing my testing under Vista since that is the OS that sucks the most.

What I think is happening is that the program is doing the search DURING UNINSTALL when the SETUPEXEDIR is not present. Instead of failing gracefully it generates an error and aborts the uninstall. There doesn't seem to be a way to tell Windows Installer not to do the search during uninstall.

You can easily recreate this by simply creating an install that does a search for a folder in [SETUPEXEDIR], then create the corresponding property-based folder in "Files and Folders" and try to install/uninstall your app.

I was supposed to ship this product on Monday and thought I had all the setup issues worked out. I was running the setup from the hard drive. When I created my master CD is when I noticed it wouldn't uninstall. I'd appreciate your prompt attention.

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

Hi,

This happens because Windows Installer caches the MSI package. Since in you package you create a folder that will be resolved to the CD-ROM, during the uninstall this folder will not be available, therefore it cannot be accessed by the package.

The solution is to use custom actions instead of the search. You need to make these modifications:
- initialize the BOOKFILES in the "Install Parameters" page to a value on the disk (it doesn't matter what this value is because the folder BOOKFILES will not contain files)
- remove the search from the "Search" page
- in the "Custom Actions" page you can create these "Property set with formatted" custom actions:
Initialize_BOOKFILES (sets the BOOKFILES property to a valid value that can be accessed by the MSI)
Set_BOOKFILES (sets the path of the BOOKFILES folder to "[SETUPEXEDIR]Laridian Books" in order to allow the File Copy/Move operation)
Restore_BOOKFILES (sets the BOOKFILES property to a valid value after the file operation is complete)

If you encounter any other problems, don't hesitate to ask.

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

Return to “Common Problems”