Skip to contentSkip to conversation

Patches to improve interactions between OpenVPN GUI and the installer

Openvpn-devel Karl O. Pinc 1 participant 1 message Apr 23, 2009

lore
Share & tools
lore
#0 lore raw

Hi,

Attached are 2 patches to install-win32/openvpn.nsi
to improve how the win32 installer interactions with OpenVPN GUI.

I noticed that if OpenVPN GUI is running when you run the (un)installer the GUI binary does not get removed/replaced. This is un-good.

openvpn.nsi.kill.patch fixes this problem by killing any running OpenVPN GUIs and children before the (un)installer does its work.

openvpn.nsi.startgui.patch extends the installer so there is an option to start OpenVPN GUI as the installer completes. It is to be applied on top of the first patch.

Regards,

Karl <[email protected]...>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein

openvpn.nsi.killer renamed from openvpn.nsi +14 -0
@@ -273,6 +273,13 @@
   nsExec::ExecToLog '"$INSTDIR\bin\${PRODUCT_UNIX_NAME}serv.exe" -remove'
   Pop $R0 # return value/error/timeout
 
+!ifdef USE_GUI
+  ; Stop OpenVPN GUI if currently running
+  DetailPrint "Stop running OpenVPN GUI (if exists) and child tasks"
+  nsExec::ExecToLog 'taskkill /F /FI "IMAGENAME eq openvpn-gui-*" /IM * /T'
+  Pop $R0 # return value/error/timeout
+!endif
+
 !ifdef USE_XGUI
   DetailPrint "Previous XML Service REMOVE (if exists)"
   nsExec::ExecToLog '"$INSTDIR\bin\${XGUI_XMLSERV}" -remove'
@@ -751,6 +758,13 @@
   nsExec::ExecToLog '"$INSTDIR\bin\${PRODUCT_UNIX_NAME}serv.exe" -remove'
   Pop $R0 # return value/error/timeout
 
+!ifdef USE_GUI
+  ; Stop OpenVPN GUI if currently running
+  DetailPrint "Stop running OpenVPN GUI (if exists) and child tasks"
+  nsExec::ExecToLog 'taskkill /F /FI "IMAGENAME eq openvpn-gui-*" /IM * /T'
+  Pop $R0 # return value/error/timeout
+!endif
+
   Sleep 3000
 
   DetailPrint "TAP REMOVE"
openvpn.nsi.startgui renamed from openvpn.nsi +136 -49

226 lines not on this page · raw message