Re: [WiX-users] VBScript CA Object not supported error

2008-08-29 Thread Richard

In article <[EMAIL PROTECTED]>,
Andy2k8 <[EMAIL PROTECTED]>  writes:

> option explicit
> 
> Dim fso,InstallPath,tmp,res
> 
> Set installer = CreateObject("WindowsInstaller.Installer")
> Set fso = CreateObject("Scripting.FileSystemObject")
> 
> InstallPath = Property("INSTALLDIR")
> 
> tmp = Mid(InstallPath,1,3)
> 
> res = tmp & "ConfigFolder"
> 
> If (fso.FolderExists(res)) Then
>   fso.DeleteFolder(res)
>   msgbox "Left over folder found!Deleted!"
>  Else
>   msgbox "Folder not found!Nothing deleted!"
> End If 

A couple observations:

1) You can delete a folder without a custom action.  The RemoveFile
table can be used to remove an empty folder by specifying an empty
FileName column.  The standard actions RemoveFiles and RemoveFolders
will process this table and the CreateFolder table to remove files and
folders when a component is uninstalled.

2) You don't need to call CreateObject to get the Installer object; it
is available in a script custom action as the global Session object,
which is also the default object.

3) You don't use the installer variable that you're trying to create.

4) The Property() call that gets the value of INSTALLDIR is using the
default, global object named Session to obtain this value.
-- 
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
  

Legalize Adulthood! 

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


[WiX-users] VBScript CA Object not supported error

2008-08-28 Thread Andy2k8

I get the following error when MSI tries to run the this VBScript CA that
deletes a folder

option explicit

Dim fso,InstallPath,tmp,res

Set installer = CreateObject("WindowsInstaller.Installer")
Set fso = CreateObject("Scripting.FileSystemObject")

InstallPath = Property("INSTALLDIR")

tmp = Mid(InstallPath,1,3)

res = tmp & "ConfigFolder"

If (fso.FolderExists(res)) Then
  fso.DeleteFolder(res)
  msgbox "Left over folder found!Deleted!"
 Else
  msgbox "Folder not found!Nothing deleted!"
End If 

Error 1720. There is a problem with this Windows Installer package. A script
required for this install to complete could not be run. Contact your support
personnel or package vendor. Custom action DeleteConfigFolder script error
-2146827850, Microsoft VBScript runtime error: Object doesn't support this
property or method: 'installer' Line 9, Column 1,  

Can anybody help me to understand this error? I've tried googling but could
find anything helpful




-
Andy
MSI Developer
Schneider Electric:working:
-- 
View this message in context: 
http://n2.nabble.com/VBScript-CA-Object-not-supported-error-tp791531p791531.html
Sent from the wix-users mailing list archive at Nabble.com.


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users