MSI Session Property

Das folgende Script ist wie die meisten der hier aufgeführten Beispiele als CusomAction in ein MSI verbaut worden.
Anders als die anderen Beispiele interagiert dieses Script jedoch mit dem InstallerProzess.

Die Zuweisung "access = session.property("ACCESSFOLDER")" liest die Property "Access"
aus dem MSI aus. Analog des Propertywertes werden RegistryEinträge geschrieben.

Noch etwas zum generellen Vorgehen (was vielleicht den Paketierer interessiert):

1. Anlegen der Property Access, Wert = 0

2. SystemSearch auf eine vorhandene Office Installation anhand des Speicherortes von
MSAccess.exe (Search for File: return containing directory only)

3. CA unter "Execute Immediate" (nicht unter "Execute Deferred"), Embedded VB-Code, Einfügen des u.g. Scriptes, Syncronous, Ignore ExitCode

4. Evtl. Conditions für die CA (NOT REMOVE)


 

option explicit
on error resume next

dim wshell, fso, access, overs, progfiles

set wshell = createobject("wscript.shell")
set fso = createobject("scripting.filesystemobject")

access = session.property("ACCESSFOLDER")
progfiles = wshell.ExpandEnvironmentStrings("%PROGRAMFILES%")
overs = right(access,3)
overs = left (overs,2)

Select Case overs

case "12"
wshell.regwrite "HKCU\Software\Microsoft\Office\"
wshell.regwrite "HKCU\Software\Microsoft\Office\12.0\"
wshell.regwrite "HKCU\Software\Microsoft\Office\12.0\Access\"
wshell.regwrite "HKCU\Software\Microsoft\Office\12.0\Access\Security\"
wshell.regwrite "HKCU\Software\Microsoft\Office\12.0\Access\Security\Trusted Locations\"
wshell.regwrite "HKCU\Software\Microsoft\Office\12.0\Access\Security\Trusted Locations\RePro_5.1_backend\"

Case "14"
wshell.regwrite "HKCU\Software\Microsoft\Office\"
wshell.regwrite "HKCU\Software\Microsoft\Office\14.0\"
wshell.regwrite "HKCU\Software\Microsoft\Office\14.0\Access\"
wshell.regwrite "HKCU\Software\Microsoft\Office\14.0\Access\Security\"
wshell.regwrite "HKCU\Software\Microsoft\Office\14.0\Access\Security\Trusted Locations\"
wshell.regwrite "HKCU\Software\Microsoft\Office\14.0\Access\Security\Trusted Locations\RePro_5.1_backend\"

End select

  • Donnerstag, 22 März 2018

Leave a comment

You are commenting as guest.