unknown variable/constant warning
Any help on why I am getting this warning would be really appreciated. I am basically doing a silent install of apache and php then I want to move the folders/files from Apache to another folder.
My Code:
##====================================================================
##Section Start
##====================================================================
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "Setup.exe"
InstallDir "$PROGRAMFILES\AmegaWeb2"
ShowInstDetails show
!include 'FileFunc.nsh'
!insertmacro Locateunkno
!include "${NSISDIR}\Include\MoveFolder.nsh"
Section "Apache" SEC01
SetOutPath "$INSTDIR\AmegaWeb2"
MessageBox MB_YESNO "Are you sure you want to install Apache Web Server and PHP" /SD IDYES IDNO endApache
#File "${NSISDIR}\Amega\httpd-2.2.17-win32-x86-openssl-0.9.8o.msi"
ExecWait '"msiexec" /I "$INSTDIR\AmegaWeb2\httpd-2.2.17-win32-x86-openssl-0.9.8o.msi" /passive ALLUSERS=1 SERVERADMIN=admin@localhost SERVERNAME=localhost SERVERDOMAIN=localhost SERVERPORT=80'
endApache:
##===========================================================
##Move Apache2.2 folder into AmegaWeb
##==========================================================
Var /GLOBAL switch_overwrite
StrCpy $switch_overwrite 0
!insertmacro MoveFolder "$INSTDIR\Apache Software Foundation\Apache2.2\" "$INSTDIR\AmegaWeb2\" "*.*"
##CopyFiles /SILENT /FILESONLY "$INSTDIR\Apache Software Foundation\Apache2.2\" "$INSTDIR\AmegaWeb2\"
##=================================================================
##PHP Install
##=================================================================
# File "${NSISDIR}\Amega\php-5.3.6-nts-Win32-VC9-x86.msi"
ExecWait '"msiexec" /i "$INSTDIR\AmegaWeb2\php-5.3.6-nts-Win32-VC9-x86.msi"/q INSTALLDIR=c:\PHP2 ADDLOCAL=cgi,ext_php_mysqli'
#endPHP:
SectionEnd
Output from
Command line:
"C:\Program Files (x86)\NSIS\makensis.exe" /NOTIFYHWND 262744 "C:\Program Files (x86)\NSIS\Amega\amegatest.nsi"
MakeNSIS v2.46 - Copyright 1995-2009 Contributors
See the file COPYING for license details.
Credits can be found in the Users Manual.
Processing config:
Processing plugin dlls: "C:\Program Files (x86)\NSIS\Plugins\*.dll"
- AdvSplash::show
- Banner::destroy
- Banner::getWindow
- Banner::show
- BgImage::AddImage
- BgImage::AddText
- BgImage::Clear
- BgImage::Destroy
- BgImage::Redraw
- BgImage::SetBg
- BgImage::SetReturn
- BgImage::Sound
- Dialer::AttemptConnect
- Dialer::AutodialHangup
- Dialer::AutodialOnline
- Dialer::AutodialUnattended
- Dialer::GetConnectedState
- InstallOptions::dialog
- InstallOptions::initDialog
- InstallOptions::show
- LangDLL::LangDialog
- Math::Script
- NSISdl::download
- NSISdl::download_quiet
- Splash::show
- StartMenu::Init
- StartMenu::Select
- StartMenu::Show
- System::Alloc
- System::Call
- System::Copy
- System::Free
- System::Get
- System::Int64Op
- System::Store
- TypeLib::GetLibVersion
- TypeLib::Register
- TypeLib::UnRegister
- UserInfo::GetAccountType
- UserInfo::GetName
- UserInfo::GetOriginalAccountType
- VPatch::GetFileCRC32
- VPatch::GetFileMD5
- VPatch::vpatchfile
- nsDialogs::Create
- nsDialogs::CreateControl
- nsDialogs::CreateItem
- nsDialogs::CreateTimer
- nsDialogs::GetUserData
- nsDialogs::KillTimer
- nsDialogs::OnBack
- nsDialogs::OnChange
- nsDialogs::OnClick
- nsDialogs::OnNotify
- nsDialogs::SelectFileDialog
- nsDialogs::SelectFolderDialog
- nsDialogs::SetRTL
- nsDialogs::SetUserData
- nsDialogs::Show
- nsExec::Exec
- nsExec::ExecToLog
- nsExec::ExecToStack
!define: "MUI_INSERT_NSISCONF"=""
Changing directory to: "C:\Program Files (x86)\NSIS\Amega"
Processing script file: "C:\Program Files (x86)\NSIS\Amega\amegatest.nsi"
!define: "PRODUCT_NAME"="AmegaWeb"
!define: "PRODUCT_VERSION"="3.5"
!define: "PRODUCT_PUBLISHER"="Amega Scientific Corp."
!define: "PRODUCT_WEB_SITE"="http://www.amegascientific.com"
!include: "C:\Program Files (x86)\NSIS\Include\MUI.nsh"
!include: "C:\Program Files (x86)\NSIS\Contrib\Modern UI\System.nsh"
NSIS Modern User Interface version 1.8 - Copyright 2002-2009 Joost Verburg (C:\Program Files (x86)\NSIS\Contrib\Modern UI\System.nsh:8)
!define: "MUI_INCLUDED"=""
!define: "MUI_SYSVERSION"="1.8"
!define: "MUI_VERBOSE"="3"
!include: closed: "C:\Program Files (x86)\NSIS\Contrib\Modern UI\System.nsh"
!include: closed: "C:\Program Files (x86)\NSIS\Include\MUI.nsh"
!define: "MUI_ABORTWARNING"=""
!define: "MUI_ICON"="C:\Program Files (x86)\NSIS\Amega\ASbutton.ico"
!insertmacro: MUI_PAGE_DIRECTORY
!insertmacro: end of MUI_PAGE_DIRECTORY
!insertmacro: MUI_PAGE_INSTFILES
!insertmacro: end of MUI_PAGE_INSTFILES
!insertmacro: MUI_PAGE_FINISH
!insertmacro: end of MUI_PAGE_FINISH
!insertmacro: MUI_LANGUAGE
!insertmacro: end of MUI_LANGUAGE
Name: "AmegaWeb 3.5"
OutFile: "Setup.exe"
InstallDir: "$PROGRAMFILES\AmegaWeb2"
ShowInstDetails: show
!include: "C:\Program Files (x86)\NSIS\Include\FileFunc.nsh"
!define: "FILEFUNC_INCLUDED"=""
!include: "C:\Program Files (x86)\NSIS\Include\Util.nsh"
!include: closed: "C:\Program Files (x86)\NSIS\Include\Util.nsh"
!define: "Locate"="!insertmacro LocateCall"
!define: "un.Locate"="!insertmacro LocateCall"
!define: "GetSize"="!insertmacro GetSizeCall"
!define: "un.GetSize"="!insertmacro GetSizeCall"
!define: "DriveSpace"="!insertmacro DriveSpaceCall"
!define: "un.DriveSpace"="!insertmacro DriveSpaceCall"
!define: "GetDrives"="!insertmacro GetDrivesCall"
!define: "un.GetDrives"="!insertmacro GetDrivesCall"
!define: "GetTime"="!insertmacro GetTimeCall"
!define: "un.GetTime"="!insertmacro GetTimeCall"
!define: "GetFileAttributes"="!insertmacro GetFileAttributesCall"
!define: "un.GetFileAttributes"="!insertmacro GetFileAttributesCall"
!define: "GetFileVersion"="!insertmacro GetFileVersionCall"
!define: "un.GetFileVersion"="!insertmacro GetFileVersionCall"
!define: "GetExeName"="!insertmacro GetExeNameCall"
!define: "un.GetExeName"="!insertmacro GetExeNameCall"
!define: "GetExePath"="!insertmacro GetExePathCall"
!define: "un.GetExePath"="!insertmacro GetExePathCall"
!define: "GetParameters"="!insertmacro GetParametersCall"
!define: "un.GetParameters"="!insertmacro GetParametersCall"
!define: "GetOptions"="!insertmacro GetOptionsCall"
!define: "un.GetOptions"="!insertmacro GetOptionsCall"
!define: "GetOptionsS"="!insertmacro GetOptionsSCall"
!define: "un.GetOptionsS"="!insertmacro GetOptionsSCall"
!define: "GetRoot"="!insertmacro GetRootCall"
!define: "un.GetRoot"="!insertmacro GetRootCall"
!define: "GetParent"="!insertmacro GetParentCall"
!define: "un.GetParent"="!insertmacro GetParentCall"
!define: "GetFileName"="!insertmacro GetFileNameCall"
!define: "un.GetFileName"="!insertmacro GetFileNameCall"
!define: "GetBaseName"="!insertmacro GetBaseNameCall"
!define: "un.GetBaseName"="!insertmacro GetBaseNameCall"
!define: "GetFileExt"="!insertmacro GetFileExtCall"
!define: "un.GetFileExt"="!insertmacro GetFileExtCall"
!define: "BannerTrimPath"="!insertmacro BannerTrimPathCall"
!define: "un.BannerTrimPath"="!insertmacro BannerTrimPathCall"
!define: "DirState"="!insertmacro DirStateCall"
!define: "un.DirState"="!insertmacro DirStateCall"
!define: "RefreshShellIcons"="!insertmacro RefreshShellIconsCall"
!define: "un.RefreshShellIcons"="!insertmacro RefreshShellIconsCall"
!include: closed: "C:\Program Files (x86)\NSIS\Include\FileFunc.nsh"
!insertmacro: Locate
!insertmacro: end of Locate
!include: "C:\Program Files (x86)\NSIS\Include\MoveFolder.nsh"
Function: ".MoveFolder_Locate_createDir"
!insertmacro: _If
!insertmacro: end of _If
Push: $R2
StrLen $R2 "$R0"
StrCpy $R2 "$R9" () ($R2)
CreateDirectory: "$R1$R2"
Pop: $R2
!insertmacro: _EndIf
!insertmacro: end of _EndIf
Push: $R1
FunctionEnd
Function: ".MoveFolder_Locate_moveFile"
Push: $R2
StrLen $R2 "$R0"
StrCpy $R2 "$R9" () ($R2)
StrCpy $R2 "$R1$R2" () ()
IfFileExists: "$R2" ? +3 : 0
Rename: $R9->$R2
Goto: done
!insertmacro: _If
warning: unknown variable/constant "switch_overwrite" detected, ignoring (macro:_==:1)
!insertmacro: end of _If
Delete: "$R2"
Rename: $R9->$R2
Delete: "$R9"
Goto: done
!insertmacro: _EndIf
!insertmacro: end of _EndIf
Push: $0
Push: $1
Push: $2
Push: $3
GetFileTime: $R9->$0,$1
GetFileTime: $R2->$2,$3
IntCmp $0:$2 equal=0, < older, > newer
IntCmp $1:$3 equal=older, < older, > newer
Delete: "$R9"
Goto: time_check_done
Delete: "$R2"
Rename: $R9->$R2
Delete: "$R9"
Pop: $3
Pop: $2
Pop: $1
Pop: $0
Pop: $R2
Push: $R1
FunctionEnd
Function: ".MoveFolder_Locate_deleteDir"
!insertmacro: _If
!insertmacro: end of _If
RMDir: "$R9"
IntOp: $R2=$R2+1
!insertmacro: _EndIf
!insertmacro: end of _EndIf
Push: $R1
FunctionEnd
!include: closed: "C:\Program Files (x86)\NSIS\Include\MoveFolder.nsh"
Section: "Apache" ->(SEC01)
SetOutPath: "$INSTDIR\AmegaWeb2"
MessageBox: 4: "Are you sure you want to install Apache Web Server and PHP" (on IDNO goto endApache)
ExecWait: ""msiexec" /I "$INSTDIR\AmegaWeb2\httpd-2.2.17-win32-x86-openssl-0.9.8o.msi" /passive ALLUSERS=1 SERVERADMIN=admin@localhost SERVERNAME=localhost SERVERDOMAIN=localhost SERVERPORT=80" (->)
Var: "switch_overwrite"
StrCpy $switch_overwrite "1" () ()
!insertmacro: MoveFolder
!define: "MOVEFOLDER_JUMP"="55.2"
Push: $R0
Push: $R1
StrCpy $R0 "$INSTDIR\Apache Software Foundation\Apache2.2\" () ()
StrCpy $R1 "$INSTDIR\AmegaWeb2\" () ()
Push: $0
StrCpy $0 "$R0" (1) (-1)
StrCmp "$0" "\" equal=0, nonequal=+2
StrCpy $R0 "$R0" (-1) ()
StrCpy $0 "$R1" (1) (-1)
StrCmp "$0" "\" equal=0, nonequal=+2
StrCpy $R1 "$R1" (-1) ()
Pop: $0
CreateDirectory: "$R1"
DetailPrint: "Moving files: $R0\*.* to $R1\"
Push: $R6
Push: $R7
Push: $R8
Push: $R9
!insertmacro: LocateCall
!insertmacro: end of LocateCall
!insertmacro: LocateCall
!insertmacro: end of LocateCall
Push: $R2
StrCpy $R2 "0" () ()
!insertmacro: LocateCall
!insertmacro: end of LocateCall
StrCmp "$R2" "0" equal=0, nonequal=deldir_loop_55.2
Pop: $R2
Push: $R2
StrCpy $R2 "0" () ()
!insertmacro: LocateCall
!insertmacro: end of LocateCall
StrCmp "$R2" "0" equal=0, nonequal=delnewdir_loop_55.2
Pop: $R2
Pop: $R9
Pop: $R8
Pop: $R7
Pop: $R6
RMDir: "$R0"
Pop: $R1
Pop: $R0
!undef: "MOVEFOLDER_JUMP"
!insertmacro: end of MoveFolder
ExecWait: ""msiexec" /i "$INSTDIR\AmegaWeb2\php-5.3.6-nts-Win32-VC9-x86.msi"/q INSTALLDIR=c:\PHP2 ADDLOCAL=cgi,ext_php_mysqli" (->)
SectionEnd
Processed 1 file, writing output:
Adding plug-ins initializing function... Done!
Processing pages... Done!
Removing unused resources... Done!
Generating language tables... Done!
Output: "C:\Program Files (x86)\NSIS\Amega\Setup.exe"
Install: 4 pages (256 bytes), 1 section (1048 bytes), 575 instructions (16100 bytes), 195 strings (2783 bytes), 1 language table (294 bytes).
Datablock optimizer saved 8009 bytes (~9.4%).
Using zlib compression.
EXE header size: 60416 / 35840 bytes
Install code: 4173 / 20857 bytes
Install data: 16216 / 67685 bytes
CRC (0x8143ADB9): 4 / 4 bytes
Total size: 80809 / 124386 bytes (64.9%)
1 warning:
unknown variable/constant "switch_overwrite" detected, ignoring (macro:_==:1)