summaryrefslogtreecommitdiff
path: root/setup.nsi
diff options
context:
space:
mode:
authorced <>2007-06-11 11:10:47 +0000
committerced <>2007-06-11 11:10:47 +0000
commit10efe308d58fef36e7e48aad9f3de7052d70225b (patch)
treed81b43c55f236dabf6e64135644a22203bc02aab /setup.nsi
parent6232b2e8ab94c5c8be5841182780ca2875ca8fc8 (diff)
KERNEL: add win32 compile
bzr revid: ced-5040a2a33469b094dd0fa2a7ca9a3e60d3547708
Diffstat (limited to 'setup.nsi')
-rw-r--r--setup.nsi33
1 files changed, 33 insertions, 0 deletions
diff --git a/setup.nsi b/setup.nsi
index c15b48cda72..5923536aa99 100644
--- a/setup.nsi
+++ b/setup.nsi
@@ -52,6 +52,10 @@
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_NOAUTOCLOSE
+ !define MUI_FINISHPAGE_RUN
+ !define MUI_FINISHPAGE_RUN_CHECKED
+ !define MUI_FINISHPAGE_RUN_TEXT "Start TinyERP Server"
+ !define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink"
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
!define MUI_FINISHPAGE_SHOWREADME $INSTDIR\README.txt
!insertmacro MUI_PAGE_FINISH
@@ -71,26 +75,42 @@
Section "TinyERP Server" SecTinyERPServer
+ nsExec::Exec "net stop tinyerp-service"
+ sleep 2
+
SetOutPath "$INSTDIR"
;ADD YOUR OWN FILES HERE...
File /r "dist\\*"
+ SetOutPath "$INSTDIR\service"
+ File /r "win32\\dist\\*"
+ File "win32\\start.bat"
+ File "win32\\stop.bat"
+
;Store installation folder
WriteRegStr HKCU "Software\TinyERP Server" "" $INSTDIR
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
+
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
;Create shortcuts
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\TinyERP Server.lnk" "$INSTDIR\tinyerp-server.exe"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
+ CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Start service.lnk" "$INSTDIR\service\start.bat"
+ CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Stop service.lnk" "$INSTDIR\service\stop.bat"
+ CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Edit config.lnk" "notepad.exe" "$INSTDIR\tinyerp-server.conf"
+ CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Edit log.lnk" "notepad.exe" "$INSTDIR\tinyerp-server.log"
!insertmacro MUI_STARTMENU_WRITE_END
+ nsExec::Exec '"$INSTDIR\\tinyerp-server.exe" --stop-after-init --logfile "$INSTDIR\\tinyerp-server.log" -s'
+ nsExec::Exec '"$INSTDIR\\service\\TinyERPServerService.exe" -auto -install'
+
SectionEnd
;Descriptions
@@ -108,11 +128,17 @@ SectionEnd
Section "Uninstall"
+ nsExec::Exec "net stop tinyerp-service"
+ sleep 2
+ nsExec::Exec '"$INSTDIR\\service\\TinyERPServerService.exe" -remove'
+ sleep 2
+
;ADD YOUR OWN FILES HERE...
Delete "$INSTDIR\Uninstall.exe"
Push "$INSTDIR\addons"
Push ""
Call un.RmFilesButOne
+ Delete "$INSTDIR\service\*"
Delete "$INSTDIR\*"
Delete "$INSTDIR\Uninstall.exe"
@@ -120,12 +146,15 @@ Section "Uninstall"
Push ""
Call un.RmDirsButOne
RMDir "$INSTDIR\addons"
+ RMDir "$INSTDIR\service"
RMDir "$INSTDIR"
!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
Delete "$SMPROGRAMS\$MUI_TEMP\TinyERP Server.lnk"
Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
+ Delete "$SMPROGRAMS\$MUI_TEMP\Start service.lnk"
+ Delete "$SMPROGRAMS\$MUI_TEMP\Stop service.lnk"
;Delete empty start menu parent diretories
StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
@@ -144,6 +173,10 @@ Section "Uninstall"
SectionEnd
+Function LaunchLink
+ nsExec::Exec "net start tinyerp-service"
+FunctionEnd
+
Function un.RmDirsButOne
Exch $R0 ; exclude dir
Exch