Skip to content
Snippets Groups Projects
Commit a641c0f5 authored by Edileuton Henrique de Oliveira's avatar Edileuton Henrique de Oliveira
Browse files

Add windows agent installer


Signed-off-by: default avatarEdileuton Henrique de Oliveira <eho09@c3sl.ufpr.br>
parent fdaac92e
No related branches found
No related tags found
No related merge requests found
C3SL - Centro de Computacao Cientifica e Software Livre
Agtha Cristina de Nadai
Adriano da Luz
Aryane Ast dos Santos
Bruno Cesar Ribas
Carlos Carvalho
Cleide Luzia Bonfim Possamai
Daniel Weingaertner
Danilo Kiyoshi Simizu Yorinori
Diego Giovane Pasqualin
Eduardo Cunha de Almeida
Erik Alexandre Pucci
Fabiano Silva
Felipe Cys Laskoski
Guilherme Zasyeki Machado
Jorge Augusto Meira
Josiney de Souza
Juliana Bueno
Klismann Smoger Mottin
Luis Carlos Erpen de Bona
Marcos Castilho
Marcos Sunye
Pedro Eugenio Rocha
Renan Franca De Miranda
Ricardo Tavares De Oliveira
Rubens Massayuki Suguimoto
Thiago Henrique Dos Santos Picharski
Tiago Rodrigo Kepe
Victor Tarabola Cortiano
Vinicius Kwiecien Ruoso
This diff is collapsed.
MAKENSIS = wine ~/.wine/drive_c/Program\ Files/NSIS/Unicode/makensis.exe
#makensis
#p7zip-full
#7zS.sfx : z442_extra.tar.bz2
#gcc-mingw-w64
#nsis-2.45-Unicode: compila o instalador http://unsis.googlecode.com/files/nsis-2.45.1-Unicode-setup.exe
#py2exe http://downloads.sourceforge.net/project/py2exe/py2exe/0.6.9/py2exe-0.6.9.win32-py2.7.exe?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fpy2exe%2Ffiles%2Fpy2exe%2F0.6.9%2F&ts=1377212687&use_mirror=ufpr
#pywin32 http://sourceforge.net/settings/mirror_choices?projectname=pywin32&filename=pywin32/Build%20218/pywin32-218.win32-py2.7.exe
#wmi https://pypi.python.org/packages/any/W/WMI/WMI-1.4.9.win32.exe#md5=31ef47dc10ff13a81a0cb8e6a98a0819
#python2.7 http://www.python.org/ftp/python/2.7.5/python-2.7.5.msi
#wine msiexec /i python-2.7.5.msi
WININSTDIR = $(PWD)
SRCDIR = $(WININSTDIR)/src
BUILD = build
BINDIR = $(BUILD)/bin
CLIENTDIR = $(WININSTDIR)/../agent/src
CLIENTBIN = $(CLIENTDIR)/bin/client.exe
PATCH = $(BUILD)/stdsoap2.patch
GSOAPVER = 2.7
GSOAPREL = 15
GSOAPURL = http://ufpr.dl.sourceforge.net/project/gsoap2/gSOAP/gSOAP%202.7.15%20stable/gsoap_$(GSOAPVER).$(GSOAPREL).tar.gz
GSOAP = gsoap-$(GSOAPVER)
WSCLIENT = build/wsclient.h
WINCC = i686-w64-mingw32-gcc
CDEP = client.c soapC.c soapClient.c $(GSOAP)/gsoap/stdsoap2.c
WSNAME = DataSID
WSURL = http://bisimmcdev.c3sl.ufpr.br:8080/axis2/services/$(WSNAME)?wsdl
INSTALLERSRC = ./src/installer.nsi
COLLECTDIR = $(WININSTDIR)/../windows-collect
all: client collect installer
client: $(BUILD)/$(GSOAP)/.patched wsdl_win
@mkdir -p $(BINDIR)
@cd $(BUILD) && $(WINCC) -g -Wall -m32 -static -o bin/client.exe $(CDEP) -lws2_32
$(BUILD)/$(GSOAP).tar.gz: client-dep
@mkdir -p $(BUILD)
@if ! test -f $@; then \
wget -O $@ $(GSOAPURL); \
fi
client-dep:
@mkdir -p $(BUILD)
@cp $(CLIENTDIR)/client* $(BUILD)
@cp $(WININSTDIR)/../agent/stdsoap2.patch $(BUILD)
$(BUILD)/$(GSOAP)/.extracted: $(BUILD)/$(GSOAP).tar.gz
cd $(BUILD); tar xzvf $(GSOAP).tar.gz
@touch $@
$(BUILD)/$(GSOAP)/.patched: $(BUILD)/$(GSOAP)/.extracted
@if ! test -f $@; then \
patch -d $(BUILD)/$(GSOAP) -p0 < $(PATCH); \
cp $(BUILD)/$(GSOAP)/gsoap/stdsoap2.h $(BUILD); \
@touch $@
fi
wsdl_win: soap_win
@if ! test -f $(BUILD)/$(WSNAME).wsdl; then \
wget $(WSURL) -O $(BUILD)/$(WSNAME).wsdl; \
fi
@wine $(BUILD)/$(GSOAP)/gsoap/bin/win32/wsdl2h.exe -c -o $(BUILD)/wsclient.h $(BUILD)/$(WSNAME).wsdl
soap_win:
@touch $(BUILD)/wsclient.h
@wine $(BUILD)/$(GSOAP)/gsoap/bin/win32/soapcpp2.exe -d $(BUILD) -C -w -x $(BUILD)/wsclient.h
collect:
@cd $(COLLECTDIR) && make
installer:
#@cd $(SRCDIR)
@$(MAKENSIS) $(INSTALLERSRC)
7z a -y ./build/data.7z ./build/DataSID.exe ./build/telecentroInfo #./build/proxy
echo ";!@Install@!UTF-8! \
Title=\"Software Installation\" \
ExecuteFile=\"DataSID.exe\" \
;!@InstallEnd@!\" " > build/7zip.conf
cat ./build/7zS.sfx build/7zip.conf ./build/data.7z > DataSID-1.0.0.exe
- Create a Makefile to compile the installer.nsi
- Add coleta-windows files to the installer
windows-installer/images/headerLeft.bmp

25.7 KiB

windows-installer/images/proinfodata.ico

25.6 KiB

windows-installer/images/wizard.bmp

151 KiB

; Copyright (C) 2009-2012 Centro de Computacao Cientifica e Software Livre
; Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
;
; This file is part of ProInfoData Windows Installer
;
; ProInfoData Windows Installer is free software you can redistribute it
; and/or modify it under the terms of the GNU General Public License as
; published by the Free Software Foundation; either version 3 of the
; License, or (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
; USA.
;Used variables
; R0 -> General use
; R1 -> General use
; R2 -> Temp variable
; R3 -> Variable used to set the lock state of the "next" button in INEP page
!define PRODUCT_NAME "DataSID"
!define PRODUCT_VERSION "1.0.0"
!define PRODUCT_PUBLISHER "C3SL - UFPR"
!define PRODUCT_WEB_SITE "http://datasid.c3sl.ufpr.br/"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\\
Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!define PRODUCT_UNINST_NAME "Desinstalar ${PRODUCT_NAME}"
!define PRODUCT_TASK "$PROGRAMFILES\${PRODUCT_NAME}\bin\agent\datasidAgent.exe"
!define MUI_FINISHPAGE_NOAUTOCLOSE
SetCompressor bzip2
RequestExecutionLevel admin
XPStyle on
BrandingText "DataSID - C3SL"
;!addplugindir "~/.wine/drive_c/Program Files/NSIS/Unicode/Plugins"
;Installer headers
!include "nsDialogs.nsh"
!include "MUI.nsh"
!include LogicLib.nsh
;Installer images
!define MUI_ICON "..\images\proinfodata.ico"
!define MUI_UNICON "..\images\proinfodata.ico"
!define MUI_WELCOMEFINISHPAGE_BITMAP "..\images\wizard.bmp"
!define MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "..\images\headerLeft.bmp"
;MUI Settings
!define MUI_ABORTWARNING
;Installer pages
!insertmacro MUI_PAGE_WELCOME
!define MUI_LICENSEPAGE_CHECKBOX
!insertmacro MUI_PAGE_LICENSE "../COPYING"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
;Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES
;Language files
!insertmacro MUI_LANGUAGE "PortugueseBR"
;Reserve files
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
;MUI end ------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "..\build\${PRODUCT_NAME}.exe"
InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
Var ProxyHost
Var ProxyPort
Var ProxyUser
Var ProxyPass
;Installer init function
Function .onInit
;Get Proxy info
ClearErrors
FileOpen $0 "$EXEDIR\proxy" r
${If} ${Errors}
StrCpy $ProxyHost ""
StrCpy $ProxyPort ""
StrCpy $ProxyUser ""
StrCpy $ProxyPass ""
${Else}
FileRead $0 $ProxyHost
FileRead $0 $ProxyPort
FileRead $0 $ProxyUser
FileRead $0 $ProxyPass
FileClose $0
${EndIf}
;Prevent the user from run multiple instances of this installer
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "Instalador \
DataSID") i .r1 ?e'
Pop $R0
StrCmp $R0 0 +3
MessageBox MB_OK|MB_ICONEXCLAMATION "Uma instância do instalador já \
está em execução."
Abort
;Kill datasidAgent.exe process
StrCpy $0 "datasidAgent.exe"
DetailPrint "Killing all processes called '$0'"
KillProc::KillProcesses
FunctionEnd
;Main installer section
Section "SeçãoPrincipal" SEC01
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
ClearErrors
ReadRegStr $R2 HKLM "SOFTWARE\${PRODUCT_NAME}" "ProxyHost"
${If} ${Errors}
WriteRegStr HKLM "SOFTWARE\${PRODUCT_NAME}" "ProxyHost" $ProxyHost
WriteRegStr HKLM "SOFTWARE\${PRODUCT_NAME}" "ProxyPort" $ProxyPort
WriteRegStr HKLM "SOFTWARE\${PRODUCT_NAME}" "ProxyUser" $ProxyUser
WriteRegStr HKLM "SOFTWARE\${PRODUCT_NAME}" "ProxyPass" $ProxyPass
${EndIf}
;Add DatasidAgent task in Windows task scheduler
nsExec::Exec "schtasks /Create /SC HOURLY /MO 1 /TN DatasidAgent \
/TR $\"\$\"${PRODUCT_TASK}$\"\$\" /RU System /F"
Pop $R2
File "..\COPYING"
CreateDirectory "$INSTDIR\conf"
CreateDirectory "$INSTDIR\data"
CreateDirectory "$INSTDIR\log"
CreateDirectory "$INSTDIR\update"
CreateDirectory "$INSTDIR\..\data"
SetOutPath "$INSTDIR\bin"
File "..\build\bin\client.exe"
SetOutPath "$INSTDIR\bin\agent"
File "..\..\windows-collect\src\dist\API-MS-Win-Core-LocalRegistry-L1-1-0.dll"
File "..\..\windows-collect\src\dist\API-MS-Win-Core-ProcessThreads-L1-1-0.dll"
File "..\..\windows-collect\src\dist\API-MS-Win-Security-Base-L1-1-0.dll"
File "..\..\windows-collect\src\dist\bz2.pyd"
;File "..\..\windows-collect\src\dist\KernelBase.dll"
File "..\..\windows-collect\src\dist\library.zip"
;File "..\..\windows-collect\src\dist\powrprof.dll"
File "..\..\windows-collect\src\dist\datasidAgent.exe"
File "..\..\windows-collect\src\dist\pyexpat.pyd"
File "..\..\windows-collect\src\dist\python27.dll"
File "..\..\windows-collect\src\dist\pythoncom27.dll"
File "..\..\windows-collect\src\dist\pywintypes27.dll"
File "..\..\windows-collect\src\dist\select.pyd"
File "..\..\windows-collect\src\dist\unicodedata.pyd"
File "..\..\windows-collect\src\dist\w9xpopen.exe"
File "..\..\windows-collect\src\dist\win32api.pyd"
File "..\..\windows-collect\src\dist\win32ui.pyd"
File "..\..\windows-collect\src\dist\_ctypes.pyd"
File "..\..\windows-collect\src\dist\_hashlib.pyd"
File "..\..\windows-collect\src\dist\_socket.pyd"
File "..\..\windows-collect\src\dist\_ssl.pyd"
File "..\..\windows-collect\src\dist\_win32sysloader.pyd"
CopyFiles "$EXEDIR\telecentroInfo" "$INSTDIR\conf"
WriteRegStr HKLM "SOFTWARE\${PRODUCT_NAME}" "Version" ${PRODUCT_VERSION}
;Execute DataSID Agent
nsExec::Exec "schtasks /Run /TN DatasidAgent"
SectionEnd
;Uninstaller creation
Section -Post
WriteUninstaller "$INSTDIR\${PRODUCT_UNINST_NAME}.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
"DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
"UninstallString" "$INSTDIR\${PRODUCT_UNINST_NAME}.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
"DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
"URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
"Publisher" "${PRODUCT_PUBLISHER}"
SectionEnd
;Uninstaller init function
Function un.onInit
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Tem certeza que quer \
remover completamente $(^Name) e todos os seus componentes?" IDYES +2
Abort
FunctionEnd
;Shows a messagebox if the uninstall process is succeeded
Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) foi removido com sucesso \
do seu computador."
FunctionEnd
;Remove datasid files
Section Uninstall
Delete "$INSTDIR\${PRODUCT_UNINST_NAME}.exe"
Delete "$INSTDIR\COPYING"
Delete "$INSTDIR\bin\client.exe"
Delete "$INSTDIR\bin\agent\API-MS-Win-Core-LocalRegistry-L1-1-0.dll"
Delete "$INSTDIR\bin\agent\API-MS-Win-Core-ProcessThreads-L1-1-0.dll"
Delete "$INSTDIR\bin\agent\API-MS-Win-Security-Base-L1-1-0.dll"
Delete "$INSTDIR\bin\agent\bz2.pyd"
Delete "$INSTDIR\bin\agent\KERNELBASE.dll"
Delete "$INSTDIR\bin\agent\library.zip"
Delete "$INSTDIR\bin\agent\POWRPROF.dll"
Delete "$INSTDIR\bin\agent\datasidAgent.exe"
Delete "$INSTDIR\bin\agent\pyexpat.pyd"
Delete "$INSTDIR\bin\agent\python27.dll"
Delete "$INSTDIR\bin\agent\pythoncom27.dll"
Delete "$INSTDIR\bin\agent\pywintypes27.dll"
Delete "$INSTDIR\bin\agent\select.pyd"
Delete "$INSTDIR\bin\agent\unicodedata.pyd"
Delete "$INSTDIR\bin\agent\w9xpopen.exe"
Delete "$INSTDIR\bin\agent\win32api.pyd"
Delete "$INSTDIR\bin\agent\win32ui.pyd"
Delete "$INSTDIR\bin\agent\_ctypes.pyd"
Delete "$INSTDIR\bin\agent\_hashlib.pyd"
Delete "$INSTDIR\bin\agent\_socket.pyd"
Delete "$INSTDIR\bin\agent\_ssl.pyd"
Delete "$INSTDIR\bin\agent\_win32sysloader.pyd"
RMDir "$INSTDIR\bin"
RMDir "$INSTDIR\conf"
RMDir "$INSTDIR\data"
RMDir "$INSTDIR\log"
RMDir "$INSTDIR\update"
RMDir "$INSTDIR\..\data"
RMDir "$INSTDIR"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegValue HKLM "SOTWARE\${PRODUCT_NAME}" "Version"
DeleteRegValue HKLM "SOFTWARE\${PRODUCT_NAME}" "ProxyHost"
DeleteRegValue HKLM "SOFTWARE\${PRODUCT_NAME}" "ProxyPort"
DeleteRegValue HKLM "SOFTWARE\${PRODUCT_NAME}" "ProxyUser"
DeleteRegValue HKLM "SOFTWARE\${PRODUCT_NAME}" "ProxyPass"
DeleteRegKey HKLM "SOFTWARE\${PRODUCT_NAME}"
;Delete scheduled task
nsExec::Exec "schtasks /Delete /TN DatasidAgent /F"
Pop $R2
SetAutoClose true
SectionEnd
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment