out_vectorama.nsi 6.38 KB
; NSIS script - ONLY for use with AutoPublish/AutoUpdate system

; //keitsi



;--------------------------------

;Include Modern UI



  !include "MUI.nsh"



;--------------------------------

;Configuration

  SetCompressor lzma



  Name "RamaSignup v1_00_06 vectorama"

  ; DO NOT CHANGE OutFile "installer_temp.exe" !!! AutoPublish requires this.

  ; AutoPublish will move the installer according to autopublish.xml file.

  OutFile "installer_temp.exe"



  ;Folder selection page

  InstallDir "$PROGRAMFILES\RamaSignup"

  

  ;Get install folder from registry if available

  InstallDirRegKey HKCU "Software\RamaSignup" ""



;--------------------------------

;Interface Settings



  !define MUI_ABORTWARNING



;--------------------------------

;Pages



  ; !insertmacro MUI_PAGE_LICENSE "license.txt"

  !insertmacro MUI_PAGE_COMPONENTS

  !insertmacro MUI_PAGE_DIRECTORY

  !insertmacro MUI_PAGE_INSTFILES



  ; !define MUI_FINISHPAGE_RUN $INSTDIR\<$BINARYNAME$>

  !insertmacro MUI_PAGE_FINISH



  !insertmacro MUI_UNPAGE_CONFIRM

  !insertmacro MUI_UNPAGE_INSTFILES



;--------------------------------

;Languages

 

  !insertmacro MUI_LANGUAGE "English"



;--------------------------------

;Installer Sections



Function GetDotNet

  IfFileExists "$WINDIR\Microsoft.NET\Framework\v2.0.50727\installUtil.exe" NextStep

  MessageBox MB_OK|MB_ICONEXCLAMATION "You must have the Microsoft .NET Framework 2.0 Installed to use this application. $\n$\nClick 'Open' in the following file dialog to download and run the Microsoft .NET Framework Installer..."

  ExecShell Open "http://www.microsoft.com/downloads/info.aspx?na=90&p=&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=0856eacb-4362-4b0d-8edd-aab15c5e04f5&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2f5%2f6%2f7%2f567758a3-759e-473e-bf8f-52154438565a%2fdotnetfx.exe" SW_SHOWNORMAL

  Quit

NextStep:

FunctionEnd



Function .onInit

	Call GetDotNet

FunctionEnd



Function .onInstSuccess

	Exec '"$INSTDIR\<$BINARYNAME$>"'

FunctionEnd



Function WaitProgramClose

	IfFileExists "$INSTDIR\<$BINARYNAME$>" loop NotInstalled

loop:

	ClearErrors

	Delete "$INSTDIR\<$BINARYNAME$>"

	${If} ${Errors}

		; Delete failed - means the program is still running. Sleep 2 seconds and retry.

		Sleep 2000

		ClearErrors

		Delete "$INSTDIR\<$BINARYNAME$>"

		${If} ${Errors}

			MessageBox MB_OK "Program <$BINARYNAME$> didn't close in 2 seconds. Automatic update can't continue before it's closed. Please close the program manually and hit OK to retry."

			goto loop

		${EndIf}

	${EndIf}

NotInstalled:

FunctionEnd



Section "!RamaSignup v1_00_06" SecMain

  SetOutPath "$INSTDIR"

  Call WaitProgramClose

  SetOverwrite off

  File /oname=ramasignup.conf "C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\ramasignup.conf"

  SetOverwrite on

  File /oname=autoupdate.xml "C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\autoupdate.vectorama.xml"

  File /oname=<$BINARYNAME$> "C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\<$BINARYNAME$>"

  File /oname=RamaSignup.pdb "C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\RamaSignup.pdb"

;  File /oname=Npgsql.pdb "C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\Npgsql.pdb"







;  File /oname=NpgsqlAltPool.pdb "C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\NpgsqlAltPool.pdb"

  File /oname=AutoUpdateLib.pdb "C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\AutoUpdateLib.pdb"

;  File /oname=ConfLibSql.pdb "C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\ConfLibSql.pdb"

  File autoupdate.crt

 ;File "..\..\res\speexenc.exe"

  ; File "C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\logo.jpg"

  ; this line will be replicated for every non-default existing assembly

  ; that is referenced to the main project.

  File "C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\MoyaAdminLib.dll"
  File "C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\DirectShowLib.dll"
  File "C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\ThermoPrinterLibrary.dll"
  File "C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\Emgu.CV.dll"
  File "C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\Emgu.Util.dll"
  File "C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\Emgu.CV.UI.dll"
  File "C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\ZedGraph.dll"
  File "C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\QRCoder.dll"
  File "C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\UnityEngine.dll"
  File "C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\Mono.Security.dll"



  WriteRegStr HKCU "Software\RamaSignup" "" $INSTDIR

  

  ;Create uninstaller

  WriteUninstaller "$INSTDIR\Uninstall.exe"



    ;Create shortcuts

    CreateDirectory "$SMPROGRAMS\RamaSignup"

    CreateShortCut "$SMPROGRAMS\RamaSignup\RamaSignup.lnk" "$INSTDIR\<$BINARYNAME$>"

    CreateShortCut "$SMPROGRAMS\RamaSignup\Uninstall RamaSignup.lnk" "$INSTDIR\Uninstall.exe"

  

SectionEnd



;--------------------------------

;Descriptions



  LangString DESC_SecMain ${LANG_ENGLISH} "Base (required)"



;--------------------------------

;Uninstaller Section



Section "Uninstall"



  Delete "$SMPROGRAMS\RamaSignup\*"



  RMDir "$SMPROGRAMS\RamaSignup"

  Delete "$INSTDIR\<$BINARYNAME$>"

  Delete "$INSTDIR\autoupdate.xml"

  Delete "$INSTDIR\autoupdate.crt"

  Delete "$INSTDIR\speexenc.exe"



  ; this line will be replicated for every non-default existing assembly

  ; that is referenced to the main project.

  Delete "$INSTDIR\C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\MoyaAdminLib.dll"
  Delete "$INSTDIR\C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\DirectShowLib.dll"
  Delete "$INSTDIR\C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\ThermoPrinterLibrary.dll"
  Delete "$INSTDIR\C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\Emgu.CV.dll"
  Delete "$INSTDIR\C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\Emgu.Util.dll"
  Delete "$INSTDIR\C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\Emgu.CV.UI.dll"
  Delete "$INSTDIR\C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\ZedGraph.dll"
  Delete "$INSTDIR\C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\QRCoder.dll"
  Delete "$INSTDIR\C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\UnityEngine.dll"
  Delete "$INSTDIR\C:\devel\proj\moya-info-tools\MoyaSignup\bin\x86\Debug\Mono.Security.dll"



  Delete "$INSTDIR\Uninstall.exe"



  RMDir "$INSTDIR"

  

SectionEnd