3.9. adminstall.cfg


<< Prev   Next >>

The adminstall.cfg file indicates that the 1C:Enterprise application was installed using Windows administration tools. The file is located in the directory of 1C:Enterprise configuration files. It is a text document encoded in UTF-8.

The file can contain a single line defining the installation mode:

AdmInstall=<Mode>
<Mode>

Describes the installation mode:

  • Logon. Installation is performed using a logon script during user logon to the domain.
  • Restart. Installation performed using group policies.

The following is an example of an installation script that can be used to install the 1C:Enterprise application using Windows Administrative Tools.

Option Explicit

' Change user interface
Const msiUILevelNoChange = 0
' Use the default user interface
Const msiUILevelDefault = 1
' Do not display user interface (silent installation)
Const msiUILevelNone = 2
' Display only progress indicator and errors
Const msiUILevelBasic = 3
' User interface without dialog messages
Const msiUILevelReduced = 4
' Full user interface
Const msiUILevelFull = 5
' For msiUILevelBasic, progress indicator
' is displayed without the Cancel button.
Const msiUILevelHideCancel = 32
' For msiUILevelBasic, progress indicator
' is displayed without any dialog boxes, including error messages.
Const msiUILevelProgressOnly = 64
' If used with any of the listed values, the installer
' displays a message about the final result at the end of the installation.
Const msiUILevelEndDialog = 128

'***** Must be changed to the actual installation directory
Const DistrFolder="\\Server\1CDistr\"

Const shortcutName = "1C:Enterprise startup"
Dim shortcutTarget : shortcutTarget = DistrFolder & "1cestart.exe"

' Constants for defining the action
' installation required
Const requiredInstall = 1
' uninstallation required
Const requiredUninstall = 0

' Value of ProductCode parameter from the setup.ini file ...
'... of the version to uninstall
Const unInstallUID="{9173B91C-FF56-4F25-82D1-7F68244044CD}"
'... of the version to install
Const InstallUID="{0BC98727-04AD-470F-9EEE-0162C543833F}"

' procedure for installing or uninstalling the specified version of the product
Sub installOrUninstall (ByVal productCode, ByVal msiPackage, ByVal mstTransform, ByVal requiredAction)
' productCode - Product code information. Located in the file
' setup.ini, ProductCode key
' msiPackage - 1C:Enterprise distribution package
'mstTransform - language conversion file for installer
' requiredAction - required action, either requiredInstall or
' requiredUninstall

' Variable to generate additional
' parameters for installer
Dim cmdLine

On Error Resume Next

Dim installer, session

Set installer = Nothing
Set session = Nothing
Set installer = Wscript.CreateObject("WindowsInstaller.Installer") : processError
installer.UILevel = msiUILevelBasic 'msiUILevelNone 'or specify another user interface option
' product installation checking
Set session = installer.OpenProduct(productCode)

If session Is Nothing AND requiredAction = requiredInstall Then
' product is not installed, installation required
cmdLine = "TRANSFORMS=adminstallrelogon.mst;"
If Not mstTransform Is Empty Then
' add an instruction to the installer to use the specified language
cmdLine = cmdLine & mstTransform
' you may additionally specify which components to install
'cmdLine = cmdLine & " DESIGNERALLCLIENTS=1 THINCLIENT=1 WEBSERVEREXT=0 SERVER=0 CONFREPOSSERVER=0 CONVERTER77=0 SERVERCLIENT=1 LANGUAGES=RU"
End If
' installing the platform
Set session = installer.InstallProduct(msiPackage, cmdLine) : processError
' create a shortcut on the desktop
createShurtcut()

ElsIf Not session Is Nothing AND requiredAction = requiredUninstall Then
' platform is already installed, uninstallation required
' only one session object is allowed
Set session = Nothing
' specifying that this version should be removed from the user's computer
cmdLine = "REMOVE=ALL"
' uninstalling
Set session = installer.InstallProduct(msiPackage, cmdLine) : processError
End If

Set session = Nothing
Set installer = Nothing

End Sub


'error handling
Sub processError
Dim msg
If Err = 0 Then Exit Sub
msg = Err.Source & " " & Hex(Err) & ": " & Err.Description
Wscript.Echo msg
Wscript.Quit 2
End Sub

'creating a shortcut
Sub createShurtcut
Dim WshShell, oShellLink
Set WshShell = WScript.CreateObject("WScript.Shell")
Dim strDesktop : strDesktop = WshShell.SpecialFolders("Desktop")
Set oShellLink = WshShell.CreateShortcut(strDesktop & "\" & shortcutName & ".lnk")
oShellLink.TargetPath = shortcutTarget
oShellLink.WindowStyle = 1
oShellLink.Description = shortcutName
oShellLink.Save
Set oShellLink = Nothing
Set WshShell = Nothing
End Sub

' uninstalling version 260
installOrUninstall unInstallUID, DistrFolder + "8.2.9.260\setup\1CEnterprise 8.2.msi", "1049.mst", requiredUninstall
' installing version 356
installOrUninstall InstallUID, DistrFolder + "8.2.9.356\setup\1CEnterprise 8.2.msi", "1049.mst", requiredInstall

<< Prev   Next >>

Icon/Social/001 Icon/Social/006 Icon/Social/005 Icon/Social/004 Icon/Social/002