Nikon ViewNX

Views: 1.3k  |  Created: 12/21/2010

Average Rating: 0
ViewNX has 8 inventory records, 0 Questions, 0 Blogs and 0 links. Please help add to this by sharing more!

Deployment Tips (1)

Most Common Setup Type
Windows Installer (MSI)
Average Package Difficulty Rating
Rated 2 / 5 (Somewhat Easy) based on 1 ratings
Most Commonly Reported Deployment Method
Windows Installer Command Line (No MST)
or cancel
This content is currently hidden from public view.
Reason: Duplicate
For more information, visit our FAQ's.
0
Script
<# 
setup.ps1
 
Uninstalls Nikon ViewNX2 and installs current version
 
http://support.nikonusa.com/app/answers/detail/a_id/18205
 
Setup:
Expand the x86 and x64 installers. Create and x86 and x64 subdirectory. Copy
the vcredist installers into these folders. Run manual installs on x86 and x64
Test machines. Use the FindInstallers function to identify the four MSI files. Copy
those to the x86 and x64 directores and rename them. Run this script for an
automated install.
 
http://msdn.microsoft.com/en-us/library/aa394373%28v=VS.85%29.aspx
Win32_Processor.AddressWidth provides the Operating System's word-width
Win32_Processor.DataWidth provides the Processor's word-width
 
OS: Win7
Arch: x86, x64
 
Adam Sailer
oliverku_at_gmail_dot_com
2013.05.03
#>
 
 
## Globals
$invoke = split-path -path $myinvocation.mycommand.path -parent
$os = gwmi Win32_OperatingSystem
$proc = gwmi Win32_Processor
$debug = $false
 
 
Function KillApps
{
    write-host "`n`n@@ Called KillApps" -for Magenta
 
    get-process -name *viewnx*, *nkm*, *nkt* | stop-process -force
}
 
 
Function Uninstall
{
    Param([string]$inp)
 
    write-host "`n`n@@ Called Uninstall" -fore Magenta
         
    if (!$inp) { Return }
 
    $paths = @(
        'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall',
        'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall'
        ) | where-object { test-path $_ }
 
    $items = @(dir $paths | % { gp $_.PsPath } | ? { $_.DisplayName -imatch $inp })
    
    foreach ($item in $items)
    {
        if ($debug) { write $item }
        $uString = $item.UninstallString
                        
        if ($uString)
        {
            $app = $uString
            $options = '/S'
            
            if ($uString -imatch 'msiexec')
            {
                $array = $uString.Split(' {}')
                $app = $array[0]
                $options = "/qn /x {$($array[2])}"
            }                                            
            
            write "Uninstalling : $($item.DisplayName)"
            if (!$debug)
            {
                $process = (Start-Process -FilePath $app -ArgumentList $options -Wait -Passthru)
                if ($process.ExitCode) { write $process.ExitCode; exit $process.ExitCode }
            }
        }
    }
}
 
 
Function Setup
{
    write-host "`n`n@@ Called Setup" -fore Magenta
 
    $source = "$invoke\x86"
    if (($proc.AddressWidth -eq 64) -and ($proc.DataWidth -eq 64))
    { $source = "$invoke\x64" }
 
    $order = @(        
        'vcredist',
        'Picture Control Utility',
        'Nikon Movie Editor',
        'ViewNX'
        )
    
    foreach ($ord in $order)
    {
        $items = @(dir $source -recurse -force -include *$ord*)
 
        foreach ($item in $items)
        {
            $item
 
            $app = 'msiexec.exe'
            ## $param = "/qn /i `"$item`" REGION=0x0409 /l `"$env:TEMP\$($item.Name).log`""
            $param = "/qn /i `"$item`" REGION=0x0409"
 
            if ($item -imatch '.exe') 
            { $app = $item; $param = '/q' }
 
            if (!$debug)
            {
                $process = (Start-Process -FilePath $app -ArgumentList $param -Wait -Passthru)
                if ($process.ExitCode)
                { if ($item -inotmatch 'picture') { write $process.ExitCode; exit $process.ExitCode } }
            } 
            else { write $options }        
        }
    }
}
 
 
Function CleanDesktop
{
    write-host "`n`n@@ Called CleanDesktop" -fore Magenta
    
    $paths = @(
        "$env:allUsersProfile\Desktop",
        "$env:public\Desktop"
        ) | where-object { $_ }
    
    $links = @(dir -path $paths -force -recurse -include viewnx*.lnk -ea SilentlyContinue)
 
    foreach ($link in $links)
    {
        write "Deleted : $($link.FullName)"
        if (!$debug -and (test-path $link)) { remove-item -path $link -force }
    }
}
 
 
Function Remove
{
    write-host "`n`n@@ Called Remove" -fore Magenta
 
    $order = @(
        'ViewNX',
        'Capture NX',
        'Picture Control Utility',
        'Nikon Movie Editor',
        'Nikon Message Center',
        'Nikon'
        )
 
    $order | % { Uninstall $_ }
}
 
 
Function FindInstallers
{
    write-host "`n`n@@ Called FindInstallers" -fore Magenta
 
    gwmi win32_Product | select-object Name, PackageCache, PackageName, Version, InstallDate | sort-object -property Name | ogv
}
 
 
#
#
 
 
Clear
KillApps
## FindInstallers ##; exit
Remove
Setup
CleanDesktop

 

Setup Information:
Setup Type: Windows Installer (MSI)
Deployment Method Used: Windows Installer Command Line (No MST)
Deployment Difficulty: Average
Platform(s): Windows
Please log in to comment

Inventory Records (8)

View inventory records anonymously contributed by opt-in users of the K1000 Systems Management Appliance.

ViewNX

Version

2.1.1

Uninstall String

MsiExec.exe /X{DDD62492-32A7-412B-8AF1-2CF032AD42E3}

Questions & Answers (0)

Questions & Answers related to Nikon ViewNX

Blogs (0)

Blog posts related to Nikon ViewNX

Reviews (0)

Reviews related to Nikon ViewNX