1; Licensed under the Apache License, Version 2.0 (the "License"); you may not 2; use this file except in compliance with the License. You may obtain a copy of 3; the License at 4; 5; http://www.apache.org/licenses/LICENSE-2.0 6; 7; Unless required by applicable law or agreed to in writing, software 8; distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9; WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10; License for the specific language governing permissions and limitations under 11; the License. 12 13; CouchDB inno installer script 14; %configure_input% 15 16[Setup] 17AppID=ApacheCouchDB 18AppName=%package_name% 19AppVerName=%package_name% %version% 20AppPublisher=Apache Software Foundation 21AppPublisherURL=http://couchdb.apache.org/ 22LicenseFile=../../LICENSE 23DefaultDirName={pf}\Apache Software Foundation\CouchDB 24DefaultGroupName=%package_name% 25OutputBaseFilename=setup-couchdb-%version% 26OutputDir=. 27 28[Files] 29Source: "%locallibbindir%\..\*.*"; DestDir: "{app}"; Flags: ignoreversion uninsrestartdelete restartreplace 30; bin dir 31Source: "%locallibbindir%\*.*"; DestDir: "{app}\bin"; Flags: ignoreversion uninsrestartdelete restartreplace recursesubdirs 32; other dirs copied '*.*' 33Source: "%locallibbindir%\..\erts-%erts_version%\*.*"; DestDir: "{app}\erts-%erts_version%"; Flags: ignoreversion uninsrestartdelete restartreplace recursesubdirs 34Source: "%locallibbindir%\..\lib\*.*"; DestDir: "{app}\lib"; Flags: ignoreversion uninsrestartdelete restartreplace recursesubdirs 35Source: "%locallibbindir%\..\share\*.*"; DestDir: "{app}\share"; Flags: ignoreversion uninsrestartdelete restartreplace recursesubdirs 36Source: "%locallibbindir%\..\releases\*.*"; DestDir: "{app}\releases"; Flags: ignoreversion uninsrestartdelete restartreplace recursesubdirs 37; skip ./usr, ./var 38 39; custom stuff... 40; ./etc/default.ini is unconditional 41Source: "%locallibbindir%\..\etc\couchdb\default.ini"; DestDir: "{app}\etc\couchdb"; Flags: ignoreversion uninsrestartdelete restartreplace 42; ./etc/local.ini is preserved and should not be updated if it exists 43Source: "%locallibbindir%\..\etc\couchdb\local.ini"; DestDir: "{app}\etc\couchdb"; Flags: onlyifdoesntexist uninsneveruninstall 44; readme 45Source: "README.txt"; DestDir: "{app}"; Flags: isreadme 46 47; msvc redists - see comments in configure.ac for notes about these... 48; ( deleteafterinstall - not needed - {tmp} auto cleaned???? 49Source: "%msvc_redist_dir%\%msvc_redist_name%"; DestDir: "{tmp}"; Flags: deleteafterinstall 50 51; These are erlang requirements and not copied by our makefiles. 52Source: "%openssl_bin_dir%\ssleay32.dll"; DestDir: "{app}\bin"; Flags: ignoreversion uninsrestartdelete restartreplace 53Source: "%openssl_bin_dir%\libeay32.dll"; DestDir: "{app}\bin"; Flags: ignoreversion uninsrestartdelete restartreplace 54 55[Dirs] 56Name: "{app}\var\lib\couchdb"; Permissions: authusers-modify 57Name: "{app}\var\log\couchdb"; Permissions: authusers-modify 58Name: "{app}\etc\couchdb"; Permissions: authusers-modify 59 60[Icons] 61Name: "{group}\Start CouchDB"; Filename: "{app}\bin\couchdb.bat" 62Name: "{group}\Futon (CouchDB web interface)"; Filename: "http://127.0.0.1:5984/_utils" 63Name: "{group}\CouchDB Web Site"; Filename: "http://couchdb.apache.org/" 64 65[Tasks] 66Name: service; Description: "Install couchdb as a Windows service" 67Name: service\start; Description: "Start the service after installation" 68 69[Run] 70Filename: "{tmp}\%msvc_redist_name%"; Parameters: "/q" 71; This is erlang's Install.exe which updates erl.ini correctly. 72Filename: "{app}\Install.exe"; Parameters: "-s"; Flags: runhidden 73 74; Commands for a service 75; First attempt to nuke an existing service of this name, incase they are 76; reinstalling without uninstalling 77Filename: "{app}\erts-%erts_version%\bin\erlsrv.exe"; Parameters: "remove ""%package_name%"""; Flags: runhidden; Tasks: service 78; add a new service, including automatic restart by default on failure 79Filename: "{app}\erts-%erts_version%\bin\erlsrv.exe"; Parameters: "add ""%package_name%"" -workdir ""{app}\bin"" -onfail restart_always -args ""-sasl errlog_type error -s couch +A 4 +W w"" -comment ""%package_name% %version%"""; Flags: runhidden; Tasks: service 80; and start it if requested 81Filename: "{app}\erts-%erts_version%\bin\erlsrv.exe"; Parameters: "start ""%package_name%"""; Flags: runhidden; Tasks: service\start 82 83[UninstallRun] 84; erlsrv stops services prior to removing them 85Filename: "{app}\erts-%erts_version%\bin\erlsrv.exe"; Parameters: "remove ""%package_name%"""; Flags: runhidden; Tasks: service 86; kill epmd.exe if running to ensure uninstaller is not prevented from removing all binaries 87Filename: "{app}\erts-%erts_version%\bin\epmd.exe"; Parameters: "-kill"; Flags: runhidden 88