在Win10發佈綠色版Meteor應用,發佈成功後用戶不須要安裝Node、Mongodb、Meteor等軟件,解壓縮就能夠運行Meteor應用。 基本思路就是經過demeteorizer打包Meteor應用,而後經過npm install
安裝好依賴的NPM包,最後把所須要的exe和dll文件打包在一塊兒,造成一個解壓便可運行的Meteor應用壓縮包。node
Developer Command Prompt VS2012
,進入須要發佈的Meteor應用目錄運行demeteorizer
.demeteorizer
目錄,執行npm install --registry=https://registry.npm.taobao.org --disturl=https://npm.taobao.org/dist
npm uninstall bcrypt && npm install bcrypt --registry=https://registry.npm.taobao.org
-/bin --node.exe --mongod.exe --libeay32.dll --ssleay32.dll --run64.cmd -/resources --/data --/bundle ---/server ---/programs ---main.js
bin目錄下的exe和DLL文件從Node、MongoDB的安裝目錄下拷貝,run64.cmd是程序啓動腳本,下面會給出一個模板。 resources目錄由.demeteorizer目錄拷貝重命名而來,/data
目錄是新建目錄,用來存儲應用數據庫。python
@ECHO off :: Basic bathc file to run a meteor app including mongod :: Set some common variables SETLOCAL ENABLEEXTENSIONS SET me=%~n0 SET parent=%~dp0 :: Step 1 -- Launch mongod since this needs to be running of course SET MONGODATA=..\resources\data\dbfolder SET MONGOPORT=20172 SET MONGOIP=127.0.0.1 mkdir %MONGODATA% echo %me% - Launching Mongo @ %MONGOIP%:%MONGOPORT% Data dir @ %MONGODATA% START /b %parent%/mongod --nohttpinterface --smallfiles --bind_ip %MONGOIP% --port %MONGOPORT% --dbpath %MONGODATA% TIMEOUT /t 5 /NOBREAK cls echo launch jubo :: Now launch our application SET MONGO_URL=mongodb://%MONGOIP%:%MONGOPORT%/jubo SET PORT=8080 SET ROOT_URL=http://localhost:%PORT%/ cd ..\resources\bundle %parent%/node main.js
set METEOR_SETTINGS
來設置。