aboutsummaryrefslogtreecommitdiffstats
path: root/packages/openvpn-client-export/source/openvpn-postinstall.nsi
diff options
context:
space:
mode:
authorMatthew Grooms <mgrooms@pfsense.org>2008-09-17 05:44:01 +0000
committerMatthew Grooms <mgrooms@pfsense.org>2008-09-17 05:44:01 +0000
commit68669f0ebca6c7412c5ca9d547d231d26be7568c (patch)
tree6f42ce1a8ca9882361c534864b9c3ad9bbd73e43 /packages/openvpn-client-export/source/openvpn-postinstall.nsi
parent889e05522e612ba736e5bef157130cf1273f72b6 (diff)
downloadpfsense-packages-68669f0ebca6c7412c5ca9d547d231d26be7568c.tar.gz
pfsense-packages-68669f0ebca6c7412c5ca9d547d231d26be7568c.tar.bz2
pfsense-packages-68669f0ebca6c7412c5ca9d547d231d26be7568c.zip
Add a new OpenVPN client configuration and installer export package. It
will create and export a config file or pre-configured windows installer based on the server configuration and user information.
Diffstat (limited to 'packages/openvpn-client-export/source/openvpn-postinstall.nsi')
-rwxr-xr-xpackages/openvpn-client-export/source/openvpn-postinstall.nsi112
1 files changed, 112 insertions, 0 deletions
diff --git a/packages/openvpn-client-export/source/openvpn-postinstall.nsi b/packages/openvpn-client-export/source/openvpn-postinstall.nsi
new file mode 100755
index 00000000..d23ecdb4
--- /dev/null
+++ b/packages/openvpn-client-export/source/openvpn-postinstall.nsi
@@ -0,0 +1,112 @@
+;--------------------------------
+; OpenVPN NSIS Post-Installer
+;--------------------------------
+
+;--------------------------------
+;Include Modern UI
+
+ !include "MUI.nsh"
+ !include "FileFunc.nsh"
+ !include "LogicLib.nsh"
+
+;--------------------------------
+; General
+;--------------------------------
+
+ Name "OpenVPN Configuration"
+ OutFile "openvpn-postinstall.exe"
+ SetCompressor /SOLID lzma
+
+ ShowInstDetails show
+
+;--------------------------------
+;Include Settings
+;--------------------------------
+
+ !define MUI_ICON "openvpn-postinstall.ico"
+ !define MUI_ABORTWARNING
+
+;--------------------------------
+;Pages
+;--------------------------------
+
+ !insertmacro MUI_PAGE_INSTFILES
+ !insertmacro Locate
+ !insertmacro GetParameters
+ !insertmacro GetOptions
+
+;--------------------------------
+;Languages
+;--------------------------------
+
+ !insertmacro MUI_LANGUAGE "English"
+
+;--------------------------------
+;Functions
+;--------------------------------
+
+Function .onInit
+
+ Var /GLOBAL CONFPATH
+ ReadRegStr $CONFPATH HKLM "Software\OpenVPN" "config_dir"
+
+FunctionEnd
+
+Function CopyConfFile
+
+ CopyFiles $R9 $CONFPATH\$R7
+ Push $0
+
+FunctionEnd
+
+Function ImportConfFile
+
+ ExecWait "rundll32.exe cryptext.dll,CryptExtAddPFX $R9"
+ Push $0
+
+FunctionEnd
+
+;--------------------------------
+;Installer Sections
+;--------------------------------
+
+Section "Imort Configuration" SectionImport
+
+ DetailPrint "Installing configuration files ..."
+ ${Locate} ".\config" "/L=F /M=*.ovpn" "CopyConfFile"
+
+ DetailPrint "Installing certificate and key files ..."
+ ${Locate} ".\config" "/L=F /M=*.crt" "CopyConfFile"
+ ${Locate} ".\config" "/L=F /M=*.key" "CopyConfFile"
+
+ ${GetParameters} $R0
+ ${GetOptions} $R0 "/Import" $R1
+ IfErrors p12_copy p12_import
+
+ p12_copy:
+ ${Locate} ".\config" "/L=F /M=*.p12" "CopyConfFile"
+ Goto p12_done
+
+ p12_import:
+ ${Locate} ".\config" "/L=F /M=*.p12" "ImportConfFile"
+ Goto p12_done
+
+ p12_done:
+
+SectionEnd
+
+;--------------------------------
+;Descriptions
+;--------------------------------
+
+ ;Language strings
+ LangString DESC_SectionImport ${LANG_ENGLISH} "Import OpenVPN Configurations and Key Files."
+
+ ;Assign language strings to sections
+ !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+ !insertmacro MUI_DESCRIPTION_TEXT ${SectionImport} $(DESC_SectionImport)
+ !insertmacro MUI_FUNCTION_DESCRIPTION_END
+
+;--------------------------------
+; END
+;--------------------------------