LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Run labview application without a seperate installer

Whole large NSIS Script here. This installs many things, and verifies that things are installed or downloads and installs some. 

 

!include "WinMessages.nsh"
!include "FileFunc.nsh"
!include "zipdll.nsh"
!include "Sections.nsh"
!include "x64.nsh"
!include "FileAssociation.nsh"
!include LogicLib.nsh

NAME "Program Installer"
OutFile "C:\LabVIEW\Builds\Program Installer.exe"
InstallDir "C:\Company\"
RequestExecutionLevel admin
Page directory
Page instfiles

Function .onInit
UserInfo::GetAccountType
pop $0
${If} $0 != "admin" ;Require admin rights on NT4+
MessageBox mb_iconstop "Administrator rights required!"
SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED
Quit
${EndIf}
FunctionEnd

Section "SoftwareDriverInstaller"
var /Global Skipall
StrCpy $Skipall "0"
SetOutPath $INSTDIR
MessageBox MB_YESNO|MB_ICONQUESTION \
"ATTENTION: If currently running a version previous to 6.7.2, this installer will take a long time to run. Ensure you have a fast internet connection speed or the software will not work. Please cancel the installation and wait until faster internet is available. Internet connection required for first time installation. Would you like to continue?" \
IDNO SkipInstall IDYES ContinueInstall
SkipInstall:
StrCpy $Skipall "1"
ContinueInstall:
IntCmp $Skipall 1 D E
😧
Goto SkipDrivers
E:
Goto Stay
Stay:
FILE /r "install.ini"
IfFileExists "C:\saphirp\data\ap_int_usb.dll" SkipDrivers InstallPSV2
InstallPSV2:
FILE /r "3 - Install Software Drivers - 11"
Execwait '"$INSTDIR\3 - Install Software Drivers - 11\setup.exe" /qb-! /r'
CopyFiles "$INSTDIR\install.ini" "C:\saphirp\data\install.ini"
${If} ${RunningX64}
CopyFiles "C:\Drivers for Software\64Bit drivers\*" "C:\windows\system32"
CopyFiles "C:\Drivers for Software\64Bit drivers\*" "C:\windows\system32\drivers"
CopyFiles "C:\Drivers for Software\64Bit drivers\*" "C:\windows\inf"
CopyFiles "C:\Drivers for Software\64Bit drivers\*" "C:\windows\ServicePackFiles"
${Else}
CopyFiles "C:\Drivers for Software\32Bit drivers\*" "C:\windows\system32"
CopyFiles "C:\Drivers for Software\32Bit drivers\*" "C:\windows\system32\drivers"
CopyFiles "C:\Drivers for Software\32Bit drivers\*" "C:\windows\inf"
CopyFiles "C:\Drivers for Software\32Bit drivers\*" "C:\windows\ServicePackFiles"
${EndIf}
SkipDrivers:
SectionEnd

Section "ControllerDriverInstaller"
IntCmp $Skipall 1 A B
A:
Goto SkipControllerInstall
B:
Goto Stay
Stay:
FILE /r "5 - Install Controller Drivers"
IfFileExists "C:\Program Files\silabs\mcu" SkipControllerInstall Checkx86ControllerInstaller
Checkx86ControllerInstaller:
IfFileExists "C:\Program Files (x86)\silabs\mcu" SkipControllerInstall InstallControllerDrivers
InstallControllerDrivers:
Execwait "$INSTDIR\5 - Install Controller Drivers\CP210x_VCP_Win2K_XP_S2K3.exe"
SkipControllerInstall:
SectionEnd

Section "Install FTDI"
IntCmp $Skipall 1 A B
A:
Goto IgnoreFTDI
B:
Goto Stay
Stay:
File /r "FTDI Drivers"
${DisableX64FSRedirection}
IfFileExists C:\Windows\System32\Drivers\ftser2k.sys SkipFTDIDrivers InstallFTDIDrivers
InstallFTDIDrivers:
ExecWait "$INSTDIR\FTDI Drivers\Controller Drivers.exe"
SkipFTDIDrivers:
${EnableX64FSRedirection}
IgnoreFTDI:
SectionEnd

Section "LaserDriverInstaller"
IntCmp $Skipall 1 A B
A:
Goto IgnoreLaser
B:
Goto Stay
Stay:
FILE /r "7 - Install Laser Driver"
IfFileExists "C:\Program Files\Company\USB4\Drivers" SkipLaserInstall Checkx86LaserInstaller
Checkx86LaserInstaller:
IfFileExists "C:\Program Files (x86)\Company\USB4\Drivers" SkipLaserInstall InstallLaserDrivers
InstallLaserDrivers:
Execwait '"$INSTDIR\7 - Install Laser Driver\CompanySolutionsDriverSetup.EXE" /silent'
SkipLaserInstall:
Delete "C:\Program Files (x86)\Company\USB4\Drivers\Instructions for Found New Hardware Wizard.txt"
IgnoreLaser:
SectionEnd


Section "VisualCInstall"
IntCmp $Skipall 1 A B
A:
Goto IgnoreVisualC
B:
Goto Stay
Stay:
FILE /r "8 - Visual C Installer"
IfFileExists "C:\Windows\SysWOW64\MSVCP100.dll" SkipVisualCInstall CheckVisualC32
CheckVisualC32:
IfFileExists "C:\Windows\system32\msvcp100.dll" SkipVisualCInstall InstallVisualC
InstallVisualC:
Execwait '"$INSTDIR\8 - Visual C Installer\vcredist_x86.exe" /qb-! /r'
SkipVisualCInstall:
IgnoreVisualC:
SectionEnd

section "UpdateRuntime"
IntCmp $Skipall 1 A B
A:
Goto IgnoreRuntime
B:
Goto Stay
Stay:
SetOutPath $INSTDIR
IfFileExists "C:\Program Files\National Instruments\Shared\LabVIEW Run-Time\2016\variable" doneRT CheckRT
CheckRT:
IfFileExists "C:\Program Files (x86)\National Instruments\Shared\LabVIEW Run-Time\2016\variable" doneRT downloadRT
downloadRT:
ClearErrors
NSISdl::Download "www.Companysolutions.net/downloads/LVRTE2016std.exe" $INSTDIR\lvrun.exe
ZipDLL::extractall "$INSTDIR\lvrun.exe" "$INSTDIR\lvruntime"
Delete "$INSTDIR\lvrun.exe"
Execwait '"$INSTDIR\lvruntime\setup.exe" /qb-! /r'
doneRT:
IgnoreRuntime:
SectionEnd


Section "UpdateVISA"
IntCmp $Skipall 1 A B
A:
Goto IgnoreVisa
B:
Goto Stay
Stay:
SetOutPath $INSTDIR
IfFileExists "C:\Windows\SysWOW64\visa32.dll" doneVisa Check32
Check32:
IfFileExists "C:\Windows\SysWOW32\visa32.dll" doneVisa CheckXP
CheckXP:
IfFileExists "C:\Windows\System32\visa32.dll" doneVisa DownloadVisa
DownloadVisa:
NSISdl::Download "www.Companysolutions.net/downloads/NIVISA1600runtime.exe" "$INSTDIR\NIVISA1600runtime.exe"
ZipDLL::extractall "$INSTDIR\NIVISA1600runtime.exe" "$INSTDIR\visaruntime"
Delete "$INSTDIR\NIVISA1600runtime.exe"
Execwait '"$INSTDIR\visaruntime\setup.exe" /qb-! /r'
doneVisa:
Ignorevisa:
SectionEnd

Section "InstallSoftware"
IntCmp $Skipall 1 A B
A:
Goto IgnoreSoftware
B:
Goto Stay
Stay:
;FILE "install_update.bat"
FILE /r "Builds"
ExecWait '"$INSTDIR\Builds\Volume\setup.exe" /qb /acceptlicenses yes'
;ExecWait "$INSTDIR\install_update.bat"
IgnoreSoftware:
SectionEnd


Section "InstallController"
IntCmp $Skipall 1 A B
A:
Goto IgnoreController
B:
Goto Stay
Stay:
File /r "c:\LabVIEW\Controller Installer\Builds\Volume"
ExecWait '"$INSTDIR\Volume\setup.exe" /qb /acceptlicenses yes'
;RMDir /r "C:\Company\Software Other\Scanners"
FILE /r "c:\labview\Controller Installer\Scanners"
CopyFiles "$INSTDIR\Scanners" "c:\Company\Software Other\Scanners"
IgnoreController:
SectionEnd


Section "InstallPBPC"
IntCmp $Skipall 1 A B
A:
Goto IgnorePBPC
B:
Goto Stay
Stay:
File /r "c:\LabVIEW\Pipe Burst Calculator Installer\Builds\Volume"
ExecWait '"$INSTDIR\Volume\setup.exe" /qb /acceptlicenses yes'
IgnorePBPC:
SectionEnd


Section "DeleteEverything"
IntCmp $Skipall 1 A B
A:
Goto IgnoreDelete
B:
Goto Stay
Stay:
;Delete "$INSTDIR\install_update.bat"
Delete "$INSTDIR\install.ini"
RMDir /r "$INSTDIR\Volume"
RMDir /r "$INSTDIR\Builds"
RMDir /r "$INSTDIR\visaruntime"
RMDir /r "$INSTDIR\lvruntime"
RMDir /r "$INSTDIR\3 - Install Software Drivers - 11"
RMDir /r "$INSTDIR\5 - Install Controller Drivers"
RMDir /r "$INSTDIR\7 - Install Laser Driver"
RMDir /r "$INSTDIR\8 - Visual C Installer"
RMDir /r "$INSTDIR\FTDI Drivers"
RMDir /r "$INSTDIR\LT Drivers"
RMDir /r "$INSTDIR\Scanners"
File "Laser.XML"
CopyFiles "$INSTDIR\Laser.XML" "$INSTDIR\Software\Laser.XML"
Delete "$INSTDIR\Laser.xml"
File "Software.XML"
CopyFiles "$INSTDIR\Software.XML" "$INSTDIR\Software\Software.XML"
Delete "$INSTDIR\Software.xml"
File "Software Analysis.XML"
CopyFiles "$INSTDIR\Software Analysis.XML" "$INSTDIR\Software\Software Analysis.XML"
Delete "$INSTDIR\Software Analysis.xml"
File "Controller.XML"
CopyFiles "$INSTDIR\Controller.XML" "$INSTDIR\Software Other\Controller.XML"
Delete "$INSTDIR\Controller.xml"
File "PBPC.XML"
;Execwait '"$INSTDIR\Software\Software" /LF'
;Execwait '"$INSTDIR\Software Other\Software Other" /LF'
${unregisterExtension} ".rbp" "RBP File"
${RegisterExtension} "c:\Company\pbpc\Company PBPC.exe" ".rbp" "RBP File"
${RefreshShellIcons}
IgnoreDelete:
SectionEnd

Message 11 of 11
(185 Views)