;getROdir.nsi(http://ragnarok.reharmonize.net/ragnarok/RoAddr/upload/src/tool356.txt)の使用例: ;RoAddr.iniを自動的にダウンロードし、RagnarokOnlineのディレクトリに設置するスクリプトのサンプルです。 ;別途inetc(http://nsis.sourceforge.net/Inetc_plug-in)のinetc.dllをNSISのPluginsディレクトリに ;インストールする必要があります。 ;2008/01/02 by Logue(logue@hotmail.co.jp) ;-------------------------------- ; General Attributes Name "RoAddr.ini" OutFile "getRoAddrIni.exe" ;SilentInstall silent ShowInstDetails show ShowUnInstDetails show ;-------------------------------- ;Interface Settings !include "MUI.nsh" !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install-colorful.ico" !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_LANGUAGE "Japanese" ;SetFont 14 ;RODIRを定義 var RODIR !define $RODIR RODIR ;ROのインストール先を取得するマクロ !macro GET_RODIR Push $R0 ClearErrors ReadRegStr $R0 HKCU "Software\Gravity\RagnarokOnline" "RagPath" Exch $R0 Pop $R0 StrCpy $RODIR $R0 !macroend ;-------------------------------- ;Installer Sections Section "Install" Install ;ROのインストール先を取得するマクロを読み込み、$RODIRに格納する。 !insertmacro GET_RODIR DetailPrint "ラグナロクオンラインのインストール先:$RODIR" ;inetc(http://nsis.sourceforge.net/Inetc_plug-in)を使う場合 inetc::get /caption "RoAddr.iniのダウンロード" /popup "http://zerodrive.dip.jp/ragnarok/RoAddr/RoAddr.ini" "$RODIR\RoAddr.ini" /end Pop $0 ;返り値が格納される 例:"OK"の場合成功 StrCmp $0 "OK" dlok DetailPrint "ダウンロードに失敗しました。$0" Abort ;中断 dlok: DetailPrint "ダウンロードに成功しました。$0" SectionEnd