I'm converting from an Innosetup installer to Wix, and in Innosetup, I'm
using the {app} folder to retrieve files for installation in Outlook
forms.
How do I use the Directory path from the Wix setup in the custom action
in vbscript? In Innosetup I was just passing it as a parameter to the
InstallForms.vbs, but I want to do away with the Main() function, and
just substitute in the CalendaringClient Directory path.
This is what I have so far....
<InstallExecuteSequence>
<Custom Action="RemoveForms" After="RemoveFiles">REMOVE="ALL"</Custom>
<Custom Action="InstallForms" Before="InstallFinalize">Install</Custom>
</InstallExecuteSequence>
<CustomAction Id="InstallForms" Script="vbscript" Execute="immediate" >
<![CDATA[
Const olFolderCalendar = 9
Const olPersonalRegistry = 2
Const olText = 1
Const olDiscard = 1
'-----------------------------------------------------------------------
--------
'-----------------------------------------------------------------------
--------
Function InstallField(objApp, iFolder, sField, iType)
Dim objFolder
Dim objItem
Dim objNS
Set objNS = objApp.GetNamespace("MAPI")
Set objFolder = objNS.GetDefaultFolder(iFolder)
Set objItem = objFolder.Items.Add("IPM.Appointment")
objItem.UserProperties.Add sField, iType, True
objItem.Save
objItem.Delete
End Function
'-----------------------------------------------------------------------
--------
'-----------------------------------------------------------------------
--------
Function InstallForm(objApp, sFile, sName)
Dim objForm
Set objForm = objApp.CreateItemFromTemplate(sFile)
If (Err.Number = 0) Then
objForm.Body = ""
objForm.FormDescription.Name = sName
objForm.FormDescription.PublishForm olPersonalRegistry
objForm.Close olDiscard
End If
End Function
'-----------------------------------------------------------------------
--------
'--- I need to substitute the Directory "CalendaringClient" in for the
WScript arguments
'--- instead of using a "Main" function
'-----------------------------------------------------------------------
--------
Main
Sub Main()
If WScript.Arguments.Count > 0 Then
Dim objApp
Dim sFormFolder
sFormFolder = WScript.Arguments.Item(0)
Set objApp = CreateObject("Outlook.Application")
If (Not objApp Is Nothing) Then
InstallForm objApp, sFormFolder & "Appointment.oft",
"Maestro.Appointment"
InstallForm objApp, sFormFolder & "RequestInvite.oft",
"Maestro.RequestInvite"
InstallForm objApp, sFormFolder & "RequestInviteTentative.oft",
"Maestro.RequestInviteTentative"
InstallField objApp, olFolderCalendar, "MeetingID", olText
End If
End If
End Sub
]]>
</CustomAction>
David Bartmess
Wall Street On Demand
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
direct: 303.417.9999 x585
cell: 303.883-9117
fax: 303.444.2586
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users