Nice scripts to install NAV RTC

Nice scripts to install NAV RTC

nice posts on NAVUG by W Mak and Mathew Ealy about this topic.

The following batch file can detect and install RTC clients on workstations

@echo off

wmic product get name,version /format:csv | find “Microsoft Dynamics NAV 2017 RoleTailored Client,10.0.14199.0”
if %errorlevel%==0 (
goto:1
) else (
goto:2
)

:1
echo NAV 2017 version 10.0.14199.0 installed, continue
goto:eof

:2
echo Checking if previous version of NAV exist, and uninstall old version
if exist “%CommonProgramFiles(x86)%\Microsoft Dynamics Nav\100\Setup\setup.exe” (
echo old version exist, start uninstalling old version
“%CommonProgramFiles(x86)%\Microsoft Dynamics Nav\100\Setup\Setup.exe” /uninstall /quiet
)
echo Installing NAV2017 10.0.14199.0 in background

net use n: {your network path that store the DVD folder}
start n:\Setup.exe /config n:\2017Config.xml /quiet

goto:eof

:eof

 

Powershell script that could be called to install and create a shortcut on the desktop to a shared executable.

import-module \\InstallMediaShare\NavInstallationTools.psm1
#Install Nav
install-navcomponent -configfile \\Share\navinstallmedia\ConfigFile.xml

#Copy Over short cut
$TargetFile = "\\Shortcut\Nav16\"
$ShortcutFile = "$env:Public\Desktop\nav16.lnk"
$Icon = "C:\Program Files (x86)\Microsoft Dynamics NAV\90\RoleTailored Client\Microsoft.Dynamics.Nav.Client.exe"
$WScriptShell = New-Object -ComObject WScript.Shell
$Shortcut = $WScriptShell.CreateShortcut($ShortcutFile)
$Shortcut.TargetPath = $TargetFile
$Shortcut.IconLocation = $Icon
$Shortcut.Save()

also a couple other powershell scripts for NAV (13 & 16) on my github page

Source on NAVUG share my code section