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

Re: if application folder deleted,uninstall is to be error.

Hi,

This can be done by using a custom action. Here is some sample VBScript code which finds the installation folder:

Code: Select all

Function findFolder()

'declare the variables
dim filesys, newfolder
'initialize the file system object
set filesys=CreateObject("Scripting.FileSystemObject")

'test if the folder exists
If  Not filesys.FolderExists(Session.Property("APPDIR")) Then
   MsgBox "The application folder does not exist. Please restore it."
   findFolder = 1603
End If

End Function 
This code can be copied into a .VBS file and added as an Attached custom action in your project. You can scheduled it under the "InstallExecuteSequence" -> "InstallValidate" standard action with the condition REMOVE="ALL". Please note that the "Function Name" field in the Custom Action Properties page should be set to the name of the function in the VBScript code ("findFolder").

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: if application folder deleted,uninstall is to be error.

Hi,
I don't want to show message box, I just resume uninstall,this operations need to success.
I'm not sure I understand what you need. In your first post you mentioned you want to give an error if the installation folder is missing during an uninstall. Since an error is received some text will be shown and the uninstall will be stopped.

Can you please give me more details about what you need to do?

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

Return to “Common Problems”