; Script generated by the HM NIS Edit Script Wizard.
var str4500
var str4501
var str4700
var strProductName
!include "logiclib.nsh"
!include "FileFunc.nsh"
Name "DC系列"
OutFile "Setup.exe"
SilentInstall silent
AutoCloseWindow true
ShowInstDetails nevershow
Section "MainSection" SEC01
通過命令行設(shè)置需要安裝的產(chǎn)品名稱和安裝路徑
push $R0
push $R1
push $R2
獲取命令行參數(shù)览濒,形式:-product=“DC-4501” -path="D:\TEMP"
${Getparameters} $R0
解析參數(shù)數(shù)據(jù)
${GetOptions} $R0 "-Product=" $R1
${GetOptions} $R0 "-Path=" $R2
pop $R0
設(shè)置安裝路徑
StrCpy $INSTDIR "$R2"
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
File "D:\NsisPackage\公共文件.txt"
StrCpy $strProductName $R1
${if} $R1 == $str4500
File /r "D:\NsisPackage\DC-4500"
${elseif} $R1 == $str4501
File /r "D:\NsisPackage\DC-4501"
${elseif} $R1 == $str4700
File /r "D:\NsisPackage\DC-4700"
${endif}
pop $R1
pop $R2
SectionEnd
Function .onInit
Call SetString
Functionend
Function SetString
StrCpy $str4500 "DC-4500"
StrCpy $str4501 "DC-4501"
StrCpy $str4700 "DC-4700"
FunctionEnd