기본 콘텐츠로 건너뛰기

라벨이 NSIS인 게시물 표시

VisualStudio 재배포판 설치여부 확인하기

원문 VC 8.0 Redistributables This function detects if VC++ 8.0 redistributables are installed on the machine ;------------------------------- ; Test if Visual Studio Redistributables 2005+ SP1 installed ; Returns -1 if there is no VC redistributables intstalled Function CheckVCRedist Push $R0 ClearErrors ReadRegDword $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7299052b-02a4-4627-81f2-1818da5d550d}" "Version"  ; if VS 2005+ redist SP1 not installed, install it IfErrors 0 VSRedistInstalled StrCpy $R0 "-1" VSRedistInstalled: Exch $R0 FunctionEnd It should be noted that the DLLs could be installed even if the redistributable isn't installed. One example would be if the user has Visual Studios installed, then they have the dlls without the redist. Newer Visual Studio runtime versions: Visual Studio 2005, x86 SP1: ( 8.0.59193) "{837b34e3-7c30-493c-8f6a-2b0f04e2912c}" Visual Studio 2008, x86 S...

Enable multi-user installation

어떤 설치 프로그램을 보면 설치시 전체 사용자들이 사용 가능하도록 설치할 것인지, 혹은 현재 사용자만 사용가능 하도록 할것인지 물어보는 페이지가 있습니다. NSIS에서 이를 가능하게 해보도록 하겠습니다. multi-user page를 사용하기 위해서는 modern UI 2를 사용해야 합니다. 만일 MUI.nsh를 인클루드 하더라도 MUI2.nsh를 먼저 인클루드 해야만 합니다. 그렇지 않을경우에는 에러를 발생합니다. 아래는 코드의 일부입니다. ---------- !define MULTIUSER_EXECUTIONLEVEL Admin !define MULTIUSER_MUI !define MULTIUSER_INSTALLMODE_COMMANDLINE . . . !insertmacro MULTIUSER_PAGE_INSTALLMODE Function .onInit !insertmacro MULTIUSER_INIT . . . FunctionEnd Function un.onInit !insertmacro MULTIUSER_UNINIT . . . FunctionEnd

Embedding other installers

설치 중에 MSI 파일을 설치할 필요가 있어 단순히 1 ExecWait  "$INSTDIR\NetPlantWAVE_PDS168.msi" cs 로 실행시키니 설치가 되지 않았습니다. nsis 홈페이지에 가보니 해결책이 있더라구요. 아래와 같이 호출하면 MSI 파일을 설치할 수 있습니다. 1 ExecWait  '"msiexec" /i "$INSTDIR\NetPlantWAVE_PDS168.msi"' cs 퇴근길에 잠시 생각해 보니 어려운 문제가 아니었습니다. MSI는 실행 파일이 아니기 때문에 msiexec.exe로 실행시켜줘야 합니다.

Constants

4.2.3 Constants Constants can also be used in the InstallDirattribute. Note that some of the new constants will not work on every OS. For example, \$CDBURN_AREA will only work on Windows XP and above. If it's used on Windows 98, it'll be empty. Unless mentioned otherwise, a constant should be available on every OS. \$PROGRAMFILES , \$PROGRAMFILES32 , \$PROGRAMFILES64 The program files directory (usually C:\Program Filesbut detected at runtime). On Windows x64, \$PROGRAMFILES and \$PROGRAMFILES32 point to C:\Program Files (x86) while \$PROGRAMFILES64 points to C:\Program Files. Use \$PROGRAMFILES64 when installing x64 applications. \$COMMONFILES, \$COMMONFILES32, \$COMMONFILES64 The common files directory. This is a directory for components that are shared across applications (usually C:\Program Files\Common Filesbut detected at runtime). On Windows x64, \$COMMONFILES and \$COMMONFILES32 point to C:\Program Files (x86)\Common Files while \$COMMONFILES64 points t...

Component 선택하기

Component 선택 페이지를 삽입하기 위해서 아래 매크로를 입력합니다. ; Component를 선택할 수 있도록 한다. Page Components 이렇게 하면 Section들의 이름이 모두 Component 페이지에 표시가 되구요. 기본값으로 선택이 되어 있습니다. NSIS는 선택된 Section만을 설치를 하게 되는데요. 프로그램에서 꼭 설치를 해야만 하는 필수 요소들이 있는데요. 이것들을 사용자들이 선택해제 하지 못하도록 Read-Only로 나타내야할 필요가 있습니다. 그럴경우 Section 안에 아래와 같은 코드를 입력하면 됩니다. SectionIn RO Section "DLL" SEC02 SectionIn RO SetOutPath "$INSTDIR" File "AutoUp.dll" File "IsGUI2008.dll" File "IsUtil2008.dll" File "log4cxx.dll" File "cximagecrt.dll" File "GdiPlus.dll" File "mfc90.dll" File "msado15.dll" File "msvcp90.dll" File "msvcr90.dll" File "msvcrt.dll" File "python26.dll" File "pythoncom26.dll" File "pywintypes26.dll" File "WinGraphviz.dll" File "Zip.dll" File "Zlib1.dll" ;File "CrashRpt.dll" SectionEnd 앞서도 얘기 했지만 Componen...

BrandingText

BrandingText란 인스톨시 아래의 그림과 같이 하단에 보이는 텍스트를 말합니다. BrandingText - 사람 중심의 기술을 지원하는..."

[NSIS] 사용자 페이지 추가하기

NSIS에서 사용자 페이지를 추가하는 방법을 알아봅시다. 일단은 추가할 페이지를 디자인해야 하는데, HM NIS을 사용하는 것이 편합니다. 아마도 이글을 보시는 분들은 다들 설치를 하셨겠죠... File-> New Install Options file 저는 아래와 같이 간단히 디자인을 했습니다. 이렇게 디자인한 내용은 ini 파일 형식으로 저장이 됩니다. 그리고 나중에 ini 파일 형식에서 사용자가 입력한 내용을 가져오게 됩니다. .onInit 에서 아래의 두 줄을 추가합니다. InitPluginsDir File /oname=$INSTDIR\AutoUGM_NSIS.ini "AutoUGM_NSIS.ini" ;ini을 Install 폴더에 복사 만든 페이지를 추가합니다. Page custom AutoUGM_NSIS AutoUGM_NSISLeave ; msapps폴더를 선택하는 화면 AutoUGM_NSIS 와 AutoUGM_NSIS는 페이지가 시작될 때 그리고 끝날 때 실행되는 함수이므로 함수를 추가해 줘야 합니다. 아래는 저의 예제입니다. Function AutoUGM_NSIS Push ${TEMP1} !insertmacro MUI_HEADER_TEXT 'mdlapps' 'ma 파일을 설치할 폴더를 선택하세요' ; 헤더에 나타낼 텍스트 InstallOptions::dialog "$INSTDIR\AutoUGM_NSIS.ini" ; 페이지를 화면에 보이게 됩니다. Pop ${TEMP1} Pop ${TEMP1} FunctionEnd Function AutoUGM_NSISLeave ReadINIStr $hMdlApps_Folder "$INSTDIR\AutoUGM_NSIS.ini" "Field 2" "State" ;사용자가 입력한 내용을 ini 파일을 통...