Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
userspace:dynamics_navision_2009_client [2012/10/27 10:42]
MatCris
userspace:dynamics_navision_2009_client [2012/12/05 10:41] (current)
Thomas_H
Line 1: Line 1:
-====== Dynamics Navision 2009 Client ====== +====== Dynamics Navision 2009 Client ​Classic ​======
- +
-Das Skript scheint doch noch fehlerbehaftet zu sein. Arbeite daran. Ggf. erfordert die Install Adminrechte. +
  
 **Versions**\\ **Versions**\\
-By  //​[[matteo.cristofaro(at)wupsi.de|Matteo Cristofaro]] 2012/10/19 21:33// \\+By  //​[[matteo.cristofaro(at)wupsi.de|Matteo Cristofaro]] 2012/10/27 21:33// \\
  
  
 Tested with opsi 4.0.1.36\\ Tested with opsi 4.0.1.36\\
 requiredWinstVersion >= 4.10.8.6 requiredWinstVersion >= 4.10.8.6
-By  //​[[matteo.cristofaro(at)wupsi.de|Matteo Cristofaro]] 2012/10/19 21:33// \\+By  //​[[matteo.cristofaro(at)wupsi.de|Matteo Cristofaro]] 2012/10/27 21:33// \\
  
  
-Das Setup-File wird im ScriptPath in einem Unterverzeichnis "​setup"​ abgelegt, also "​CLIENT_DATA\setup\Nav2009R2..."+Das Setup-File wird im ScriptPath in einem Unterverzeichnis "​setup"​ abgelegt, also "​CLIENT_DATA\setup\CsideClient\..."
  
-Das Verzeichnis ​Nav2009R2 entspricht der DVD; in diesem Verzeichnis befinden sich die erforderlichen Setup-Dateien+Das Verzeichnis ​CsideClient enthält ​die Install-Dateien des Classic-Clients ​und ist auf der DVD zu finden.
- +
-Um die Automatisierung zu ermöglichen,​ muss vorab eine Konfigurations-/​Antwortdatei erstellt werden. Hierzu muss teilweise das Setup des Client einmal durchlaufen werden +
- +
-1. „Setup.exe“ ausführen +
-2. „weiter“ klicken und "Ich akzeptiere“ klicken +
-3. „Wählen Sie die Installationsoption“ und „Benutzerdefinierte Komponenten“ +
-4. Wählen Sie die Clients aus (RTC oder Classic) und geben Sie den Zieldordner an +
-5. Beim RTC den DB-Server-Parameter,​ also den Servernamen ​und den Port vorgeben +
-6. Und „Speichern ​der Konfiguration“ und Xml-Datei abspeichern +
- +
-Die Konfig-dAtei heißt bei mir: dynamics_navision_2009_clientconfig.xml+
  
 +Tree:
 +<​code>​
 +├ navision-2009-classicclient.png
 +├ /setup
 +│   └ /​CsideClient
 +│          └ setup.ins
 +├ uninstall.ins
 +└ delsub.ins
 +</​code>​
  
-Tree:\\ 
-delsub32.ins\\ 
-navision2009.jpeg\\ 
-setup\Nav2009R2\...\\ 
-setup\dynamics_navision_2009_clientconfig.xml\\ 
-setup32.ins\\ 
-uninstall32.ins 
  
-==== setup32.ins ====+==== setup.ins ====
 <code winst> <code winst>
 [Actions] [Actions]
-requiredWinstVersion >= "​4.10.8.6"​ 
- 
-DefVar $UninstallProgram32$ 
 DefVar $LogDir$ DefVar $LogDir$
-DefVar $ProductId$ ​ +Set $LogDir$ = "​%SystemDrive%\tmp"​ 
 +DefVar $ProductId$
 DefVar $MinimumSpace$ DefVar $MinimumSpace$
-DefVar $InstallDir32$ +DefVar $InstallDir$
-DefVar $Setupfile$ +
-DefVar $Logo$+
 DefVar $ExitCode$ DefVar $ExitCode$
-DefVar $INST_SystemType+DefVar $LicenseRequired
-DefVar $INST_architecture$+DefVar $LicenseKey$ 
 +DefVar $LicensePool$
  
-Set $INST_SystemType$ = GetSystemType +; ---------------------------------------------------------------- 
-set $INST_architecture$ = GetProductProperty("​install_architecture","​system specific"​) +; - Please edit the following values ​                            - 
- +; ---------------------------------------------------------------- 
-Set $LogDir$ = "​%SystemDrive%\tmp"​ +Set $ProductId$ ​       = "navision-2009-classicclient"
-Set $ProductId$ ​       = "microsoft-nav-2009-client"+
 Set $MinimumSpace$ ​   = "200 MB" Set $MinimumSpace$ ​   = "200 MB"
-Set $InstallDir32     = "%ProgramFiles32Dir%\Microsoft Dynamics NAV" +Set $InstallDir      = "%ProgramFilesDir%\Microsoft Dynamics NAV" 
-Set $Setupfile$ = "setup.exe+Set $LicenseRequired = "false
-Set $Logo$ = "navision2009.jpeg"+Set $LicensePool    = "p_" ​+ $ProductId$
 ; ---------------------------------------------------------------- ; ----------------------------------------------------------------
  
Line 70: Line 54:
 else else
  comment "Show product picture"​  comment "Show product picture"​
- ShowBitmap "​%ScriptPath%\"​ + $Logo$ $ProductId$ + ShowBitmap "​%ScriptPath%\"​ + $ProductId+ "​.png" ​$ProductId$ 
-  + 
- if FileExists("​%ScriptPath%\_delsub32.ins")+ if FileExists("​%ScriptPath%\delsub.ins")
  comment "Start uninstall sub section"​  comment "Start uninstall sub section"​
- Sub "​%ScriptPath%\delsub32.ins"+ Sub "​%ScriptPath%\delsub.ins"
  endif  endif
   
 + Message "​Installing " + $ProductId$ + " ..."
   
- comment "​installing"​ + if not ($LicenseRequired$ = "false") 
- + comment ​"Licensing required, reserve license and get license key
- if (($INST_SystemType$ = "x86 System"​) and ($INST_architecture$ = "​system specific"​)) or ($INST_architecture$ = "​both"​) or ($INST_architecture$ = "32 only") + Sub_get_licensekey
- Message ​"Installing " + $ProductId$ + " 32 Bit...+
-  +
- Message "​Installiere jetzt Dynamics Navision 2009 Client..."​ +
- Winbatch_install_32 +
- Sub_check_exitcode +
  endif  endif
- ExitWindows /Reboot+  
 + comment "Start setup program"​ 
 + Winbatch_install 
 + Sub_check_exitcode
 endif endif
  
  
-[Winbatch_install_32] 
-%ScriptPath%\setup\Nav2009R2\$Setupfile$ /quiet /config %ScriptPath%\setup\dynamics_navision_2009_clientconfig.xml 
-;/log '​$InstallDir32$'​ 
  
 +[Winbatch_install]
 +msiexec /i "​%ScriptPath%\setup\CsideClient\Microsoft Dynamics NAV Classic.msi"​ /l* "​$LogDir$\$ProductId$.install_log.txt"​ /qb! ALLUSERS=2 REBOOT=ReallySuppress
 +
 +
 +
 +[Sub_get_licensekey]
 +if opsiLicenseManagementEnabled
 + comment "​License management is enabled and will be used"
 +
 + comment "​Trying to get a license key"
 + Set $LicenseKey$ = demandLicenseKey ($LicensePool$)
 + ; If there is an assignment of exactly one licensepool to the product the following call is possible:
 + ; Set $LicenseKey$ = demandLicenseKey ("",​ $ProductId$)
 + ;
 + ; If there is an assignment of a license pool to a windows software id, it is possible to use:
 + ; DefVar $WindowsSoftwareId$
 + ; $WindowsSoftwareId$ = "​..."​
 + ; Set $LicenseKey$ = demandLicenseKey ("",​ "",​ $WindowsSoftwareId$)
 +
 + DefVar $ServiceErrorClass$
 + set $ServiceErrorClass$ = getLastServiceErrorClass
 + comment "Error class: " + $ServiceErrorClass$
 +
 + if $ServiceErrorClass$ = "​None"​
 + comment "​Everything fine, we got the license key '"​ + $LicenseKey$ + "'"​
 + else
 + if $ServiceErrorClass$ = "​LicenseConfigurationError"​
 + LogError "​Fatal:​ license configuration must be corrected"​
 + LogError getLastServiceErrorMessage
 + ExitWindows /Reboot
 + isFatalError
 + else ​
 + if $ServiceErrorClass$ = "​LicenseMissingError"​
 + LogError "​Fatal:​ required license is not supplied"​
 + ExitWindows /Reboot
 + isFatalError
 + endif
 + endif
 + endif
 +else
 + LogError "​Fatal:​ license required, but license management not enabled"​
 + isFatalError
 +endif
  
  
Line 127: Line 150:
 </​code>​ </​code>​
  
-==== delsub32.ins ====+ 
 + 
 +==== delsub.ins ====
 <code winst> <code winst>
-Set $UninstallProgram32= "​%ScriptPath%\setup\Nav2009R2\"​ + $Setupfile$+DefVar ​$MsiId$ 
 +Set $MsiId= '​{00000000-0000-6002-0000-0000836BD2D2}'​
  
-if (($INST_SystemType$ = "x86 System"​) and ($INST_architecture$ = "​system specific"​)) or ($INST_architecture$ = "​both"​) or ($INST_architecture$ = "32 only"​) +Message "​Uninstalling " + $ProductId$ + " ..."
- Message "​Uninstalling " + $ProductId$ + " ​32 Bit..."+
  
- if FileExists($UninstallProgram32$) +if not (GetRegistryStringValue("​[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"​ + $MsiId+ "] DisplayName"​) = ""​
- comment "Uninstall program ​found, starting uninstall"​ + comment "MSI id " + $MsiId$ + " ​found in registry, starting ​msiexec to uninstall"​ 
- Winbatch_uninstall_32 + Winbatch_uninstall_msi 
- sub_check_exitcode + sub_check_exitcode
- endif+
 endif endif
  
-[Winbatch_uninstall_32+comment "​Delete files"​ 
-"$UninstallProgram32$" ​/quiet /uninstall+Files_uninstall 
 + 
 + 
 + 
 +[Winbatch_uninstall_msi
 +msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress 
 + 
 + 
 + 
 +[Files_uninstall] 
 +delete -sf "$InstallDir$\" 
  
  
Line 175: Line 210:
 </​code>​ </​code>​
  
-==== uninstall32.ins ====+ 
 + 
 +==== uninstall.ins ====
 <code winst> <code winst>
-[Actions+[Initial
-requiredWinstVersion >= "4.10.8.6"+requiredWinstVersion >= "​4.8.6"​ 
 +LogLevel=2 ;​ Log Errors in Logfile but don't abort: 
 +ExitOnError=false ;​ Show syntax errors in the script: 
 +ScriptErrorMessages=on ;​ Dont trace step by step through the script: 
 +TraceMode=off ;​ Let started programs run in front of the winst window 
 +StayOnTop=false
  
-DefVar $UninstallProgram32$+[Aktionen] 
 +DefVar $TEMP$ 
 +Set $TEMP$ = EnvVar("​TEMP"​)
 DefVar $LogDir$ DefVar $LogDir$
 +Set $LogDir$ = "​%SystemDrive%\tmp"​
 DefVar $ExitCode$ DefVar $ExitCode$
 DefVar $ProductId$ DefVar $ProductId$
-DefVar $InstallDir32+DefVar $InstallDir
-DefVar $Setupfile+DefVar $LicenseRequired
-DefVar $Logo$ +DefVar $LicensePool$
-DefVar $INST_SystemType$ +
-DefVar $INST_architecture$+
  
-Set $INST_SystemType$ = GetSystemType +; ---------------------------------------------------------------- 
-set $INST_architecture$ = GetProductProperty("​install_architecture","​system specific"​) +; - Please edit the following values ​                            - 
- +; ---------------------------------------------------------------- 
-Set $LogDir$ = "​%SystemDrive%\tmp"​ +Set $ProductId$ ​      ​= "navision-2009-classicclient
-Set $ProductId$ ​      = "microsoft-nav-2009-client+Set $InstallDir     = "%ProgramFilesDir%\Microsoft Dynamics NAV" 
-Set $InstallDir32    = "%ProgramFiles32Dir%\Microsoft Dynamics NAV" +Set $LicenseRequired$ = "false
-Set $Setupfile$ = "setup.exe+Set $LicensePool    ​= "p_" ​+ $ProductId$
-Set $Logo$ = "navision2009.jpeg"+
 ; ---------------------------------------------------------------- ; ----------------------------------------------------------------
  
 comment "Show product picture"​ comment "Show product picture"​
-ShowBitmap "​%ScriptPath%\"​ + $Logo$ $ProductId$+ShowBitmap ​/3 "​%ScriptPath%\"​ + $ProductId+ "​.png" ​$ProductId$
  
 Message "​Uninstalling " + $ProductId$ + " ..." Message "​Uninstalling " + $ProductId$ + " ..."
  
-if FileExists("​%ScriptPath%\delsub32.ins")+if FileExists("​%ScriptPath%\delsub.ins")
  comment "Start uninstall sub section"​  comment "Start uninstall sub section"​
- Sub "​%ScriptPath%\delsub32.ins"+ Sub "​%ScriptPath%\delsub.ins" 
 +endif 
 + 
 +if not ($LicenseRequired$ = "​false"​) 
 + comment "​Licensing required, free license used"​ 
 + Sub_free_license 
 +endif 
 + 
 +[Sub_free_license] 
 +if opsiLicenseManagementEnabled 
 + comment "​License management is enabled and will be used"​ 
 + 
 + comment "​Trying to free license used for the product"​ 
 + DefVar $result$ 
 + Set $result$ = FreeLicense($LicensePool$) 
 + ; If there is an assignment of a license pool to the product, it is possible to use 
 + ; Set $result$ = FreeLicense("",​ $ProductId$) 
 +
 + ; If there is an assignment of a license pool to a windows software id, it is possible to use 
 + ; DefVar $WindowsSoftwareId$ 
 + ; $WindowsSoftwareId$ = "​..."​ 
 + ; set $result$ = FreeLicense("",​ "",​ $WindowsSoftwareId$) 
 +else 
 + LogError "​Error:​ licensing required, but license management not enabled"​ 
 + isFatalError
 endif endif
-ExitWindows /Reboot 
 </​code>​ </​code>​

QR Code
QR Code userspace:dynamics_navision_2009_client (generated for current page)