!define py2exeOutputDir 'dist' !define exe 'main.exe' !define skin 'olpc' !define icon 'skin/${skin}/icon/ball.ico' !define compressor 'lzma' ;one of 'zlib', 'bzip2', 'lzma' !define onlyOneInstance ; - - - - do not edit below this line, normaly - - - - !ifdef compressor SetCompressor ${compressor} !else SetCompress Off !endif Name ${exe} OutFile ${exe} SilentInstall silent !ifdef icon Icon ${icon} !endif ; - - - - Allow only one installer instance - - - - !ifdef onlyOneInstance Function .onInit System::Call "kernel32::CreateMutexA(i 0, i 0, t '$(^Name)') i .r0 ?e" Pop $0 StrCmp $0 0 launch MessageBox MB_OK "You can only run one copy of the game at a time" launch: FunctionEnd !endif ; - - - - Allow only one installer instance - - - - Section InitPluginsDir SetOutPath '$PLUGINSDIR' File '${py2exeOutputDir}\*.*' File /r '${py2exeOutputDir}\data' File /r '${py2exeOutputDir}\cache' File /r '${py2exeOutputDir}\skin' File /r '${py2exeOutputDir}\img' GetTempFileName $0 DetailPrint $0 Delete $0 StrCpy $0 '$0.bat' FileOpen $1 $0 'w' FileWrite $1 '@echo off$\r$\n' StrCpy $2 $TEMP 2 FileWrite $1 '$2$\r$\n' FileWrite $1 'cd $PLUGINSDIR$\r$\n' FileWrite $1 '${exe} --skin ${skin}$\r$\n' FileClose $1 nsExec::Exec $0 Delete $0 SectionEnd