Browse Source

Windows Bundle, Version 1

master
Claudio Luck 2 years ago
commit
7ba32b01a9
Signed by: claudio <claudio@pep.foundation> GPG Key ID: E8E60FD7D8D989BA
85 changed files with 7604 additions and 0 deletions
  1. BIN
      Windows/Enigmail+pEp_Bundle.exe
  2. +490
    -0
      Windows/Enigmail+pEp_Bundle.nsi
  3. +38
    -0
      Windows/NSIS/Contrib/ExecDos/ExecDos.sln
  4. +461
    -0
      Windows/NSIS/Contrib/ExecDos/ExecDos.vcxproj
  5. +44
    -0
      Windows/NSIS/Contrib/ExecDos/ExecDos.vcxproj.filters
  6. +83
    -0
      Windows/NSIS/Contrib/ExecDos/api.h
  7. +40
    -0
      Windows/NSIS/Contrib/ExecDos/consApp.cpp
  8. +91
    -0
      Windows/NSIS/Contrib/ExecDos/consApp.dsp
  9. +508
    -0
      Windows/NSIS/Contrib/ExecDos/execDos.c
  10. BIN
      Windows/NSIS/Contrib/ExecDos/execDos.rc
  11. +229
    -0
      Windows/NSIS/Contrib/ExecDos/nsis_tchar.h
  12. +294
    -0
      Windows/NSIS/Contrib/ExecDos/pluginapi.c
  13. +104
    -0
      Windows/NSIS/Contrib/ExecDos/pluginapi.h
  14. +14
    -0
      Windows/NSIS/Contrib/ExecDos/resource.h
  15. +2
    -0
      Windows/NSIS/Contrib/Inetc/afxres.h
  16. +83
    -0
      Windows/NSIS/Contrib/Inetc/api.h
  17. +105
    -0
      Windows/NSIS/Contrib/Inetc/crt.cpp
  18. +1731
    -0
      Windows/NSIS/Contrib/Inetc/inetc.cpp
  19. +199
    -0
      Windows/NSIS/Contrib/Inetc/inetc.rc
  20. +42
    -0
      Windows/NSIS/Contrib/Inetc/inetc.sln
  21. +441
    -0
      Windows/NSIS/Contrib/Inetc/inetc.vcxproj
  22. +52
    -0
      Windows/NSIS/Contrib/Inetc/inetc.vcxproj.filters
  23. +229
    -0
      Windows/NSIS/Contrib/Inetc/nsis_tchar.h
  24. +294
    -0
      Windows/NSIS/Contrib/Inetc/pluginapi.c
  25. +104
    -0
      Windows/NSIS/Contrib/Inetc/pluginapi.h
  26. +47
    -0
      Windows/NSIS/Contrib/Inetc/resource.h
  27. +58
    -0
      Windows/NSIS/Docs/ExecDos/Readme.txt
  28. +153
    -0
      Windows/NSIS/Docs/Inetc/Readme.htm
  29. +161
    -0
      Windows/NSIS/Docs/Inetc/wiki.txt
  30. +19
    -0
      Windows/NSIS/Examples/ExecDos/Batch.nsi
  31. +47
    -0
      Windows/NSIS/Examples/ExecDos/Detailed.nsi
  32. +78
    -0
      Windows/NSIS/Examples/ExecDos/Example.nsi
  33. +63
    -0
      Windows/NSIS/Examples/ExecDos/IsDone.nsi
  34. +25
    -0
      Windows/NSIS/Examples/ExecDos/Multi.nsi
  35. +55
    -0
      Windows/NSIS/Examples/ExecDos/ToFunc.nsi
  36. +61
    -0
      Windows/NSIS/Examples/ExecDos/ToStack.nsi
  37. +125
    -0
      Windows/NSIS/Examples/ExecDos/ToWindow.nsi
  38. BIN
      Windows/NSIS/Examples/ExecDos/consApp.exe
  39. +6
    -0
      Windows/NSIS/Examples/ExecDos/first.bat
  40. +11
    -0
      Windows/NSIS/Examples/ExecDos/listbox.ini
  41. +11
    -0
      Windows/NSIS/Examples/ExecDos/ml_edit.ini
  42. +3
    -0
      Windows/NSIS/Examples/ExecDos/second.bat
  43. +54
    -0
      Windows/NSIS/Examples/Inetc/Example.nsi
  44. +32
    -0
      Windows/NSIS/Examples/Inetc/auth_dlg.nsi
  45. +32
    -0
      Windows/NSIS/Examples/Inetc/ftp_auth.nsi
  46. +30
    -0
      Windows/NSIS/Examples/Inetc/head.nsi
  47. +32
    -0
      Windows/NSIS/Examples/Inetc/headers.nsi
  48. +7
    -0
      Windows/NSIS/Examples/Inetc/headers.php
  49. +27
    -0
      Windows/NSIS/Examples/Inetc/https.nsi
  50. +81
    -0
      Windows/NSIS/Examples/Inetc/inetc_local.nsi
  51. +31
    -0
      Windows/NSIS/Examples/Inetc/post.nsi
  52. +13
    -0
      Windows/NSIS/Examples/Inetc/post.php
  53. +31
    -0
      Windows/NSIS/Examples/Inetc/post_file.nsi
  54. +10
    -0
      Windows/NSIS/Examples/Inetc/post_file.php
  55. +18
    -0
      Windows/NSIS/Examples/Inetc/post_form.html
  56. +31
    -0
      Windows/NSIS/Examples/Inetc/put.nsi
  57. +19
    -0
      Windows/NSIS/Examples/Inetc/put.php
  58. +65
    -0
      Windows/NSIS/Examples/Inetc/recursive.nsi
  59. +31
    -0
      Windows/NSIS/Examples/Inetc/redirect.nsi
  60. +6
    -0
      Windows/NSIS/Examples/Inetc/redirect.php
  61. +32
    -0
      Windows/NSIS/Examples/Inetc/timeout.nsi
  62. +32
    -0
      Windows/NSIS/Examples/Inetc/tostack.nsi
  63. +33
    -0
      Windows/NSIS/Examples/Inetc/translate.nsi
  64. BIN
      Windows/NSIS/ExecDos.zip
  65. BIN
      Windows/NSIS/Inetc.zip
  66. BIN
      Windows/NSIS/Plugins/amd64-unicode/INetC.dll
  67. BIN
      Windows/NSIS/Plugins/x64-ansi/ExecDos.dll
  68. BIN
      Windows/NSIS/Plugins/x64-unicode/ExecDos.dll
  69. BIN
      Windows/NSIS/Plugins/x86-ansi/ExecDos.dll
  70. BIN
      Windows/NSIS/Plugins/x86-ansi/INetC.dll
  71. BIN
      Windows/NSIS/Plugins/x86-unicode/ExecDos.dll
  72. BIN
      Windows/NSIS/Plugins/x86-unicode/INetC.dll
  73. BIN
      Windows/enigmail-2.0.7.xpi
  74. +122
    -0
      Windows/getProfile.bat
  75. +1
    -0
      Windows/gpa-pep.conf
  76. +1
    -0
      Windows/gpg-agent-pep.conf
  77. +1
    -0
      Windows/gpg-pep.conf
  78. +19
    -0
      Windows/gpg4win.ini
  79. +2
    -0
      Windows/gpg4win_setup.bat
  80. BIN
      Windows/held.bmp
  81. BIN
      Windows/held.png
  82. BIN
      Windows/if_User_No-Frame_97832.ico
  83. +136
    -0
      Windows/install.bat
  84. +12
    -0
      Windows/installSettings.bat
  85. +62
    -0
      Windows/staged.json

BIN
Windows/Enigmail+pEp_Bundle.exe View File


+ 490
- 0
Windows/Enigmail+pEp_Bundle.nsi View File

@@ -0,0 +1,490 @@
# Enigmail pEp Bundle
# Reference
# http://nsis.sourceforge.net/Docs/Modern%20UI/Readme.html
# http://nsis.sourceforge.net/Docs/nsDialogs/Readme.html
# http://nsis.sourceforge.net/%22Orange%22_Modern_UI_Theme
!addplugindir NSIS\Plugins\x86-ansi
!include "MUI2.nsh"
# deprecated !include InstallOptions.nsh
Outfile "Enigmail+pEp_Bundle.exe"
Name "pEp Thunderbird with Enigmail Bundle"
InstallDir $APPDATA\pEp\BundleInstaller
# InstallDirRegKey HKCU "Software\Modern UI Test" ""
BrandingText "pEp Foundation. Privacy by Default."
; Vista+ user|admin
# The only guy that refuses to self-elevate is, wonder wonder... Gpg4win
RequestExecutionLevel user
Var isAdmin
Var EnvComSpec
# Var WINDIR
Var TbProfileDir
Var TbProfileDirFound
Var TbExec
Var TbExecFound
# ReserveFile getProfile.bat
# ReserveFile ioFile.ini
!define MUI_ICON "if_User_No-Frame_97832.ico"
# !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall-nsis.ico"
!define MUI_UNICON ${MUI_ICON}
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "held.bmp"
# !define MUI_HEADERIMAGE_BITMAP_NOSTRETCH
!define MUI_HEADERIMAGE_UNBITMAP "held.bmp"
!define MUI_HEADERIMAGE_UNBITMAP_NOSTRETCH
!define MUI_HEADERIMAGE_RIGHT
# RRGGBBR
# !define MUI_BGCOLOR AAAAAA9
!define MUI_WELCOMEFINISHPAGE_BITMAP "held.bmp"
# !define MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "held.bmp"
# !define MUI_UNWELCOMEFINISHPAGE_BITMAP_NOSTRETCH
# !define MUI_WELCOMEFINISHPAGE_INI nsis-pep.ini
Icon ${MUI_ICON}
UninstallIcon ${MUI_UNICON}
;--------------------------------
;Interface Settings
# - bad UX
#!define MUI_ABORTWARNING
!define MUI_UNABORTWARNING
# FIXME TODO: only for debugging:
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
!define Trim "!insertmacro Trim"
!macro Trim ResultVar String
Push "${String}"
Call Trim
Pop "${ResultVar}"
!macroend
;--------------------------------
;Pages
!define MUI_WELCOMEPAGE_TITLE "Welcome-Title"
!define MUI_WELCOMEPAGE_TITLE_3LINES "Bla\nBla2\Bla3"
#!define MUI_WELCOMEPAGE_TEXT "Just text"
!insertmacro MUI_PAGE_WELCOME
# # Page custom CustomInstallers nsDialogsPageLeave
# !define MUI_PAGE_CUSTOMFUNCTION_POST DeselectBundleInstall
# !insertmacro MUI_PAGE_INSTFILES
#Function DeselectBundleInstall
# !insertmacro UnselectSection "Bundle Install"
#FunctionEnd
#!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt
!define MUI_PAGE_CUSTOMFUNCTION_PRE ComponentsPre
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE ComponentsLeave
!insertmacro MUI_PAGE_COMPONENTS
!define MUI_PAGE_CUSTOMFUNCTION_PRE ProfilePre
#!define MUI_PAGE_CUSTOMFUNCTION_LEAVE ProfileLeave
!define MUI_DIRECTORYPAGE_VARIABLE $TbProfileDir
!define MUI_PAGE_HEADER_TEXT "Thunderbird Profile"
!define MUI_PAGE_HEADER_SUBTEXT "Thunderbird Sub-Bla"
!insertmacro MUI_PAGE_DIRECTORY
# Second round
# Page custom CustomInstallers nsDialogsPageLeave
# !define MUI_PAGE_CUSTOMFUNCTION_PRE
!insertmacro MUI_PAGE_INSTFILES
# InstType "Privacy by Default"
# !define CIT_Special 1
# InstType "Online Update"
# http://nsis.sourceforge.net/Reference/Section
# We deliver the package with and without Thunderbird.
Var TbUrl
Var EnvWinDir
Var TbSetupReady
SectionGroup /e "Thunderbird" SECT_TB
Section "Download" INST_TB_DLOAD
#SectionIn 2
SetOutPath $PLUGINSDIR
Push 0
Pop $TbSetupReady
IfFileExists "$INSTDIR\Thunderbird_Setup.exe" TbDownloadOnDisk
StrCpy $TbUrl "https://download.mozilla.org/?product=thunderbird-latest&os=win&lang=en-US"
nsExec::ExecToLog '"$EnvWinDir\System32\bitsadmin.exe" /transfer "Thunderbird" /priority high "$TbUrl" "$INSTDIR\Thunderbird_Setup.exe"'
Pop $TbSetupReady
TbDownloadOnDisk:
SectionEnd
Section "Install" INST_TB
#SectionIn 1 2
MessageBox MB_OK "Install!$\n$0"
StrCmp $TbSetupReady 0 +1 NoTbSetupReady
nsExec::ExecToLog '"$INSTDIR\Thunderbird_Setup.exe" /S'
Pop $0
NoTbSetupReady:
SectionEnd
Section "New Profile" INST_TB_NEWPROF
# SectionIn 1 2
# Repeat
SectionEnd
Section "Select Profile" INST_TB_SELPROF
# SectionIn 1 2
# Repeat
SectionEnd
SectionGroupEnd
Section "Gpg4win" INST_GPGWIN
SectionIn RO
SetOutPath $INSTDIR\gpg4win
File gpg4win.ini
IfFileExists "$PROGRAMFILES32\GnuPG\bin\gpg.exe" Gpg4winInstalled
File gpg4win-3.1.1.exe
File gpg4win_setup.bat
# There are thousand ways gpg4win does NOT what it was asked,
# this way it works but the UAC prompt remains in background :(
nsExec::ExecToLog 'gpg4win_setup.bat gpg4win-3.1.1.exe'
Pop $0
Gpg4winInstalled:
CreateDirectory "$APPDATA\gnupg"
SetOutPath "$APPDATA\gnupg"
IfFileExists gpg.conf +2
File /oname=gpg.conf gpg-pep.conf
IfFileExists gpg-agent.conf +2
File /oname=gpg-agent.conf gpg-agent-pep.conf
IfFileExists gpa.conf +2
File /oname=gpa.conf gpa-pep.conf
SectionEnd
Section "Enigmail" INST_ENIGMAIL
#SectionIn 1 2 RO
SectionIn RO
CreateDirectory $TbProfileDir\extensions\staged
SetOutPath $TbProfileDir\extensions\staged
File "/oname={847b3a00-7ab1-11d4-8f02-006008948af5}.xpi" enigmail-2.0.7.xpi
File "/oname={847b3a00-7ab1-11d4-8f02-006008948af5}.json" staged.json
SectionEnd
Section "pEp Adapter" INST_MDA
#SectionIn 1 2 RO
SectionIn RO
# CreateDirectory
SetOutPath $TbProfileDir
File /a /r pepmda\
SectionEnd
Function ComponentsPre
# Set selected and readonly, deselecting in ComponentsPost
#IntOp $0 ${SF_SELECTED} | ${SF_RO}
#SectionSetFlags ${INST_BUNDLE} $0
# ----------------------------------------------
StrCmp $TbExecFound 0 FoundTb NotFoundTb
FoundTb:
IntOp $0 ${SF_RO} | 0
SectionSetFlags ${INST_TB_DLOAD} $0
# IntOp $0 ${SF_RO} | 0
IntOp $0 0 | 0
SectionSetFlags ${INST_TB} $0
Goto FoundTbEnd
NotFoundTb:
IntOp $0 ${SF_SELECTED} | ${SF_RO}
SectionSetFlags ${INST_TB_DLOAD} $0
IntOp $0 ${SF_SELECTED} | 0
SectionSetFlags ${INST_TB} $0
FoundTbEnd:
# ----------------------------------------------
StrCmp $TbProfileDirFound 0 FoundTbProf NotFoundTbProf
FoundTbProf:
IntOp $0 0 | ${SF_RO}
SectionSetFlags ${INST_TB_NEWPROF} $0
# We keep the Select Profile step always selectable
# but we don't activate it, as the automatic selection
# is OK for most users
IntOp $0 0 | 0
SectionSetFlags ${INST_TB_SELPROF} $0
Goto FoundTbProfEnd
NotFoundTbProf:
IntOp $0 ${SF_SELECTED} | ${SF_RO}
SectionSetFlags ${INST_TB_NEWPROF} $0
IntOp $0 0 | 0
SectionSetFlags ${INST_TB_SELPROF} $0
FoundTbProfEnd:
FunctionEnd
Function ComponentsLeave
#IntOp $0 0 | ${SF_RO}
#SectionSetFlags ${INST_BUNDLE} $0
FunctionEnd
Function ProfilePre
StrCpy $TbExec "TB_NOT_FOUND"
nsExec::ExecToStack '"$EnvComSpec" /C "$PLUGINSDIR\getProfile.bat" getexe'
Pop $TbExecFound
Pop $TbExec
${Trim} $TbExec $TbExec
nsExec::ExecToLog '"$TbExec" -silent -no-remote -createProfile default'
Pop $0
# TODO: Fail installation if this fails
#WaitForProfile:
# IfFileExists "$INSTDIR\Thunderbird_Setup.exe" TbDownloadOnDisk
StrCpy $TbProfileDir "NO_PROFILE_DIR"
nsExec::ExecToStack '"$EnvComSpec" /C "$PLUGINSDIR\getProfile.bat" getprofile'
Pop $TbProfileDirFound
Pop $TbProfileDir
${Trim} $TbProfileDir $TbProfileDir
# IfFileExists "$TbProfileDir" +1 WaitForProfile
# Skip the section if component not selected (using default from script)
SectionGetFlags ${INST_TB_SELPROF} $0
IntOp $0 $0 & ${SF_SELECTED}
StrCmp $0 ${SF_SELECTED} +2 +1
Abort
FunctionEnd
Function ProfileLeave
MessageBox MB_OK "On Leave '$0'"
FunctionEnd
!define MUI_FINISHPAGE_RUN $TbExec
!define MUI_FINISHPAGE_RUN_TEXT "Start Thunderbird"
!define MUI_FINISHPAGE_RUN_PARAMETERS
!define MUI_FINISHPAGE_RUN_NOTCHECKED
# !define MUI_FINISHPAGE_RUN_FUNCTION
!define MUI_FINISHPAGE_SHOWREADME https://pep.coop/cryptoparty/bundle-start.html
!define MUI_FINISHPAGE_SHOWREADME_TEXT "Continue with instructions online"
# !define MUI_FINISHPAGE_SHOWREADME_TEXT
# !define MUI_FINISHPAGE_SHOWREADME_FUNCTION fn
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
!define MUI_FINISHPAGE_LINK "Important: Join and support the pEp Cooperative today!"
!define MUI_FINISHPAGE_LINK_LOCATION https://software.pep.foundation/ping.html
!define MUI_FINISHPAGE_LINK_COLOR 03aa4b
!insertmacro MUI_PAGE_FINISH
# Uninstallers!
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Installer Sections
#### !insertmacro INSTALLOPTIONS_WRITE "ioFile.ini" "Field #" "Name" "Value"
Function .onInit
#!insertmacro INSTALLOPTIONS_EXTRACT "ioFile.ini"
# StrCpy $1 ${secBSPnew} ; Gotta remember which section we are at now...
# SectionGetFlags ${SecBSPnew} $0
# IntOp $0 $0 | ${SF_SELECTED}
# SectionSetFlags ${SecBSPnew} $0
ExpandEnvStrings $EnvComSpec %COMSPEC%
ExpandEnvStrings $EnvWinDir %WINDIR%
InitPluginsDir
File "/oname=$PLUGINSDIR\getProfile.bat" getProfile.bat
StrCpy $TbExec "TB_NOT_FOUND"
nsExec::ExecToStack '"$EnvComSpec" /C "$PLUGINSDIR\getProfile.bat" getexe'
Pop $TbExecFound
Pop $TbExec
${Trim} $TbExec $TbExec
nsExec::ExecToStack '"$EnvComSpec" /C "$PLUGINSDIR\getProfile.bat" getprofile'
Pop $TbProfileDirFound
Pop $TbProfileDir
${Trim} $TbProfileDir $TbProfileDir
nsExec::ExecToStack 'taskkill /F /IM pep-json-server.exe'
Pop $0
Pop $0
# File ioFile.ini
#File getProfile.bat
# File install.bat
# File installSettings.bat
# File staged.json
FunctionEnd
Function .onSelChange
#SectionGetFlags $1 $0
#IntOp $0 $0 & ${SECTION_OFF}
#SectionSetFlags $1 $0
FunctionEnd
Function Trim
Exch $R1 ; Original string
Push $R2
Loop:
StrCpy $R2 "$R1" 1
StrCmp "$R2" " " TrimLeft
StrCmp "$R2" "$\r" TrimLeft
StrCmp "$R2" "$\n" TrimLeft
StrCmp "$R2" "$\t" TrimLeft
GoTo Loop2
TrimLeft:
StrCpy $R1 "$R1" "" 1
Goto Loop
Loop2:
StrCpy $R2 "$R1" 1 -1
StrCmp "$R2" " " TrimRight
StrCmp "$R2" "$\r" TrimRight
StrCmp "$R2" "$\n" TrimRight
StrCmp "$R2" "$\t" TrimRight
GoTo Done
TrimRight:
StrCpy $R1 "$R1" -1
Goto Loop2
Done:
Pop $R2
Exch $R1
FunctionEnd
Section "Uninstall"
Delete $INSTDIR\UninstallInstaller.exe
# RMDir "$INSTDIR"
# DeleteRegKey /ifempty HKCU "Software\Modern UI Test"
SectionEnd

+ 38
- 0
Windows/NSIS/Contrib/ExecDos/ExecDos.sln View File

@@ -0,0 +1,38 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExecDos", "ExecDos.vcxproj", "{1A16311F-F8AB-96EA-1ACE-57B17A915730}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug Unicode|Win32 = Debug Unicode|Win32
Debug Unicode|x64 = Debug Unicode|x64
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release Unicode|Win32 = Release Unicode|Win32
Release Unicode|x64 = Release Unicode|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32
{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32
{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64
{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Debug Unicode|x64.Build.0 = Debug Unicode|x64
{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Debug|Win32.ActiveCfg = Debug|Win32
{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Debug|Win32.Build.0 = Debug|Win32
{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Debug|x64.ActiveCfg = Debug|x64
{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Debug|x64.Build.0 = Debug|x64
{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32
{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Release Unicode|Win32.Build.0 = Release Unicode|Win32
{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Release Unicode|x64.ActiveCfg = Release Unicode|x64
{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Release Unicode|x64.Build.0 = Release Unicode|x64
{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Release|Win32.ActiveCfg = Release|Win32
{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Release|Win32.Build.0 = Release|Win32
{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Release|x64.ActiveCfg = Release|x64
{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

+ 461
- 0
Windows/NSIS/Contrib/ExecDos/ExecDos.vcxproj View File

@@ -0,0 +1,461 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug Unicode|Win32">
<Configuration>Debug Unicode</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug Unicode|x64">
<Configuration>Debug Unicode</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release Unicode|Win32">
<Configuration>Release Unicode</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release Unicode|x64">
<Configuration>Release Unicode</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<SccProjectName />
<SccLocalPath />
<ProjectGuid>{1A16311F-F8AB-96EA-1ACE-57B17A915730}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<GenerateManifest>false</GenerateManifest>
<OutDir>$(SolutionDir)..\..\Plugins\x86-ansi</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<GenerateManifest>false</GenerateManifest>
<OutDir>$(SolutionDir)..\..\Plugins\x64-ansi</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">
<LinkIncremental>false</LinkIncremental>
<GenerateManifest>false</GenerateManifest>
<OutDir>$(SolutionDir)..\..\Plugins\x86-unicode</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">
<LinkIncremental>false</LinkIncremental>
<GenerateManifest>false</GenerateManifest>
<OutDir>$(SolutionDir)..\..\Plugins\x64-unicode</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>false</LinkIncremental>
<GenerateManifest>false</GenerateManifest>
<OutDir>$(SolutionDir)..\..\Plugins\x86-ansi</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>false</LinkIncremental>
<GenerateManifest>false</GenerateManifest>
<OutDir>$(SolutionDir)..\..\Plugins\x64-ansi</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">
<LinkIncremental>false</LinkIncremental>
<GenerateManifest>false</GenerateManifest>
<OutDir>$(SolutionDir)..\..\Plugins\x86-unicode</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">
<LinkIncremental>false</LinkIncremental>
<GenerateManifest>false</GenerateManifest>
<OutDir>$(SolutionDir)..\..\Plugins\x64-unicode</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<StringPooling>true</StringPooling>
<Optimization>MinSpace</Optimization>
<SuppressStartupBanner>true</SuppressStartupBanner>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;ExecDos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FunctionLevelLinking>true</FunctionLevelLinking>
</ClCompile>
<Midl>
<SuppressStartupBanner>true</SuppressStartupBanner>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<TypeLibraryName>.\../debug\ExecDos.tlb</TypeLibraryName>
<MkTypLibCompatible>true</MkTypLibCompatible>
<TargetEnvironment>Win32</TargetEnvironment>
</Midl>
<ResourceCompile>
<Culture>0x0409</Culture>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\../debug\ExecDos.bsc</OutputFile>
</Bscmake>
<Link>
<SuppressStartupBanner>true</SuppressStartupBanner>
<LinkDLL>true</LinkDLL>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<AdditionalDependencies>kernel32.lib;user32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<EntryPointSymbol>DllMain</EntryPointSymbol>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<StringPooling>true</StringPooling>
<Optimization>MinSpace</Optimization>
<SuppressStartupBanner>true</SuppressStartupBanner>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;ExecDos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FunctionLevelLinking>true</FunctionLevelLinking>
</ClCompile>
<Midl>
<SuppressStartupBanner>true</SuppressStartupBanner>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<TypeLibraryName>.\../debug\ExecDos.tlb</TypeLibraryName>
<MkTypLibCompatible>true</MkTypLibCompatible>
</Midl>
<ResourceCompile>
<Culture>0x0409</Culture>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\../debug\ExecDos.bsc</OutputFile>
</Bscmake>
<Link>
<SuppressStartupBanner>true</SuppressStartupBanner>
<LinkDLL>true</LinkDLL>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<AdditionalDependencies>kernel32.lib;user32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<EntryPointSymbol>DllMain</EntryPointSymbol>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">
<ClCompile>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<StringPooling>true</StringPooling>
<Optimization>MinSpace</Optimization>
<SuppressStartupBanner>true</SuppressStartupBanner>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;ExecDos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FunctionLevelLinking>true</FunctionLevelLinking>
</ClCompile>
<Midl>
<SuppressStartupBanner>true</SuppressStartupBanner>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<TypeLibraryName>.\../debug\ExecDos.tlb</TypeLibraryName>
<MkTypLibCompatible>true</MkTypLibCompatible>
<TargetEnvironment>Win32</TargetEnvironment>
</Midl>
<ResourceCompile>
<Culture>0x0409</Culture>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\../debug\ExecDos.bsc</OutputFile>
</Bscmake>
<Link>
<SuppressStartupBanner>true</SuppressStartupBanner>
<LinkDLL>true</LinkDLL>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<AdditionalDependencies>kernel32.lib;user32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<EntryPointSymbol>DllMain</EntryPointSymbol>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">
<ClCompile>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<StringPooling>true</StringPooling>
<Optimization>MinSpace</Optimization>
<SuppressStartupBanner>true</SuppressStartupBanner>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;ExecDos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FunctionLevelLinking>true</FunctionLevelLinking>
</ClCompile>
<Midl>
<SuppressStartupBanner>true</SuppressStartupBanner>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<TypeLibraryName>.\../debug\ExecDos.tlb</TypeLibraryName>
<MkTypLibCompatible>true</MkTypLibCompatible>
</Midl>
<ResourceCompile>
<Culture>0x0409</Culture>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\../debug\ExecDos.bsc</OutputFile>
</Bscmake>
<Link>
<SuppressStartupBanner>true</SuppressStartupBanner>
<LinkDLL>true</LinkDLL>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<AdditionalDependencies>kernel32.lib;user32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<EntryPointSymbol>DllMain</EntryPointSymbol>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
<FunctionLevelLinking>false</FunctionLevelLinking>
<Optimization>Disabled</Optimization>
<SuppressStartupBanner>true</SuppressStartupBanner>
<WarningLevel>Level3</WarningLevel>
<MinimalRebuild>true</MinimalRebuild>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;ExecDos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<BufferSecurityCheck>true</BufferSecurityCheck>
</ClCompile>
<Midl>
<SuppressStartupBanner>true</SuppressStartupBanner>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<TypeLibraryName>.\../Debug\ExecDos.tlb</TypeLibraryName>
<MkTypLibCompatible>true</MkTypLibCompatible>
<TargetEnvironment>Win32</TargetEnvironment>
</Midl>
<ResourceCompile>
<Culture>0x0409</Culture>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\../Debug\ExecDos.bsc</OutputFile>
</Bscmake>
<Link>
<SuppressStartupBanner>true</SuppressStartupBanner>
<LinkDLL>true</LinkDLL>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
<FunctionLevelLinking>false</FunctionLevelLinking>
<Optimization>Disabled</Optimization>
<SuppressStartupBanner>true</SuppressStartupBanner>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;ExecDos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<BufferSecurityCheck>true</BufferSecurityCheck>
</ClCompile>
<Midl>
<SuppressStartupBanner>true</SuppressStartupBanner>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<TypeLibraryName>.\../Debug\ExecDos.tlb</TypeLibraryName>
<MkTypLibCompatible>true</MkTypLibCompatible>
</Midl>
<ResourceCompile>
<Culture>0x0409</Culture>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\../Debug\ExecDos.bsc</OutputFile>
</Bscmake>
<Link>
<SuppressStartupBanner>true</SuppressStartupBanner>
<LinkDLL>true</LinkDLL>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<AdditionalDependencies>nsis_ansi\pluginapi.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">
<ClCompile>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
<FunctionLevelLinking>false</FunctionLevelLinking>
<Optimization>Disabled</Optimization>
<SuppressStartupBanner>true</SuppressStartupBanner>
<WarningLevel>Level3</WarningLevel>
<MinimalRebuild>true</MinimalRebuild>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;ExecDos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<BufferSecurityCheck>true</BufferSecurityCheck>
</ClCompile>
<Midl>
<SuppressStartupBanner>true</SuppressStartupBanner>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<TypeLibraryName>.\../Debug\ExecDos.tlb</TypeLibraryName>
<MkTypLibCompatible>true</MkTypLibCompatible>
<TargetEnvironment>Win32</TargetEnvironment>
</Midl>
<ResourceCompile>
<Culture>0x0409</Culture>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\../Debug\ExecDos.bsc</OutputFile>
</Bscmake>
<Link>
<SuppressStartupBanner>true</SuppressStartupBanner>
<LinkDLL>true</LinkDLL>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">
<ClCompile>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
<FunctionLevelLinking>false</FunctionLevelLinking>
<Optimization>Disabled</Optimization>
<SuppressStartupBanner>true</SuppressStartupBanner>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;ExecDos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<BufferSecurityCheck>true</BufferSecurityCheck>
</ClCompile>
<Midl>
<SuppressStartupBanner>true</SuppressStartupBanner>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<TypeLibraryName>.\../Debug\ExecDos.tlb</TypeLibraryName>
<MkTypLibCompatible>true</MkTypLibCompatible>
</Midl>
<ResourceCompile>
<Culture>0x0409</Culture>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\../Debug\ExecDos.bsc</OutputFile>
</Bscmake>
<Link>
<SuppressStartupBanner>true</SuppressStartupBanner>
<LinkDLL>true</LinkDLL>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<AdditionalDependencies>nsis_unicode\pluginapi.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="execDos.c" />
<ClCompile Include="pluginapi.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="api.h" />
<ClInclude Include="nsis_tchar.h" />
<ClInclude Include="pluginapi.h" />
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="execDos.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

+ 44
- 0
Windows/NSIS/Contrib/ExecDos/ExecDos.vcxproj.filters View File

@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{e6ac57b0-521c-4d5a-b4e8-d04324cd751f}</UniqueIdentifier>
<Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{affd3ad4-c2c0-4025-80fc-5b2b7b4c6ffc}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{cee8647c-748e-4045-9a4c-08eb637ef52c}</UniqueIdentifier>
<Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="execDos.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pluginapi.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="api.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="pluginapi.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="nsis_tchar.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="resource.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="execDos.rc">
<Filter>Source Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

+ 83
- 0
Windows/NSIS/Contrib/ExecDos/api.h View File

@@ -0,0 +1,83 @@
/*
* apih
*
* This file is a part of NSIS.
*
* Copyright (C) 1999-2013 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
*
* Licence details can be found in the file COPYING.
*
* This software is provided 'as-is', without any express or implied
* warranty.
*/
#ifndef _NSIS_EXEHEAD_API_H_
#define _NSIS_EXEHEAD_API_H_
// Starting with NSIS 2.42, you can check the version of the plugin API in exec_flags->plugin_api_version
// The format is 0xXXXXYYYY where X is the major version and Y is the minor version (MAKELONG(y,x))
// When doing version checks, always remember to use >=, ex: if (pX->exec_flags->plugin_api_version >= NSISPIAPIVER_1_0) {}
#define NSISPIAPIVER_1_0 0x00010000
#define NSISPIAPIVER_CURR NSISPIAPIVER_1_0
// NSIS Plug-In Callback Messages
enum NSPIM
{
NSPIM_UNLOAD, // This is the last message a plugin gets, do final cleanup
NSPIM_GUIUNLOAD, // Called after .onGUIEnd
};
// Prototype for callbacks registered with extra_parameters->RegisterPluginCallback()
// Return NULL for unknown messages
// Should always be __cdecl for future expansion possibilities
typedef UINT_PTR (*NSISPLUGINCALLBACK)(enum NSPIM);
// extra_parameters data structures containing other interesting stuff
// but the stack, variables and HWND passed on to plug-ins.
typedef struct
{
int autoclose;
int all_user_var;
int exec_error;
int abort;
int exec_reboot; // NSIS_SUPPORT_REBOOT
int reboot_called; // NSIS_SUPPORT_REBOOT
int XXX_cur_insttype; // depreacted
int plugin_api_version; // see NSISPIAPIVER_CURR
// used to be XXX_insttype_changed
int silent; // NSIS_CONFIG_SILENT_SUPPORT
int instdir_error;
int rtl;
int errlvl;
int alter_reg_view;
int status_update;
} exec_flags_t;
#ifndef NSISCALL
# define NSISCALL __stdcall
#endif
typedef struct {
exec_flags_t *exec_flags;
int (NSISCALL *ExecuteCodeSegment)(int, HWND);
void (NSISCALL *validate_filename)(TCHAR *);
int (NSISCALL *RegisterPluginCallback)(HMODULE, NSISPLUGINCALLBACK); // returns 0 on success, 1 if already registered and < 0 on errors
} extra_parameters;
// Definitions for page showing plug-ins
// See Ui.c to understand better how they're used
// sent to the outer window to tell it to go to the next inner window
#define WM_NOTIFY_OUTER_NEXT (WM_USER+0x8)
// custom pages should send this message to let NSIS know they're ready
#define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd)
// sent as wParam with WM_NOTIFY_OUTER_NEXT when user cancels - heed its warning
#define NOTIFY_BYE_BYE 'x'
#endif /* _PLUGIN_H_ */

+ 40
- 0
Windows/NSIS/Contrib/ExecDos/consApp.cpp View File

@@ -0,0 +1,40 @@
#include <windows.h>
#include <stdio.h>
#pragma comment(linker,"/MERGE:.rdata=.text")
#pragma comment(linker,"/FILEALIGN:512 /SECTION:.text,EWRX /IGNORE:4078")
#pragma comment(linker,"/ENTRY:main")
#pragma comment(linker,"/NODEFAULTLIB")
int main( int argc, char **argv)
{
char b[1024] = "";
printf("This is test console application for execDos plugin\n");
printf("Written by Takhir Bedertdinov\n\n");
fflush(NULL);
Sleep(500);
printf("Login: ");
fflush(NULL);
Sleep(500);
// fgets(b, sizeof(b), stdin);// generates error in msvcrt
gets(b);
printf("%s\n", b);
/*MessageBox(NULL, "Login received", b, 0);*/
fflush(NULL);
Sleep(500);
printf("Passowrd: ");
fflush(NULL);
Sleep(500);
*b = 0;
// fgets(b, sizeof(b), stdin);
gets(b);
printf("%s\n", b);
fflush(NULL);
Sleep(500);
/*MessageBox(NULL, "Password received", b, 0);*/
printf("\nThanks\nBla-bla-bla\nBye\n");
fflush(NULL);
Sleep(500);
return 5;
}

+ 91
- 0
Windows/NSIS/Contrib/ExecDos/consApp.dsp View File

@@ -0,0 +1,91 @@
# Microsoft Developer Studio Project File - Name="consApp" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=consApp - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "consApp.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "consApp.mak" CFG="consApp - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "consApp - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "consApp - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "consApp - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O1 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x419 /d "NDEBUG"
# ADD RSC /l 0x419 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib msvcrt.lib /nologo /subsystem:console /machine:I386 /opt:nowin98 /OPT:REF /OPT:ICF
# SUBTRACT LINK32 /pdb:none /nodefaultlib
!ELSEIF "$(CFG)" == "consApp - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x419 /d "_DEBUG"
# ADD RSC /l 0x419 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "consApp - Win32 Release"
# Name "consApp - Win32 Debug"
# Begin Source File
SOURCE=.\consApp.cpp
# End Source File
# End Target
# End Project

+ 508
- 0
Windows/NSIS/Contrib/ExecDos/execDos.c View File

@@ -0,0 +1,508 @@
/***************************************************
* FILE NAME: execDos.c
*
* PURPOSE:
* NSIS plugin for DOS (console) applications.
* Creates child process with redirected I/O.
* Catches application's output and can put it to the
* log file. Returns process exit code or error code.
*
* CHANGE HISTORY
*
* $LOG$
*
* Author Version Date Modifications
* Takhir Bedertdinov May 31 2004 Original
* --//-- Oct 31 2004 Log output
* --//-- Feb 10 2005 /TIMEOUT option
* --//-- Jul 23 2005 /ASYNC option
* --//-- Jul 25 2005 multithreading
* --//-- Mar 10 2006 perf. improved
* --//-- Jul 25 2006 to stack option
* --//-- Dec 12 2006 detailed option
* Stuart Welch Jul 27 2007 func options
* --//-- isdone func
* Takhir Bedertdinov Jul 28 2007 to window option
* Stuart Welch Jan 18 2011 Unicode build
* --//-- NSIS plugin API update (no /NOUNLOAD)
* --//-- /DISABLEFSR option for WOW64
* --//-- 1.0.1.2 Apr 13 2014 x64 build
* --//-- version info resource
* --//-- 1.0.1.3 Dec 11 2014 incorrect Unicode GlobalAlloc size
* STDIN Unicode ANSI conversion
*
* Takhir Bedertdinov, Moscow, Russia, ineum@narod.ru
* Stuart 'Afrow UK' Welch, afrowuk@afrowsoft.co.uk
**************************************************/
#include <windows.h>
#include <fcntl.h>
#include <stdio.h>
#include <io.h>
#include <sys\stat.h>
#include "COMMCTRL.H"
#include "pluginapi.h"
#define NSISFUNC(name) void __declspec(dllexport) name(HWND hWndParent, int string_size, TCHAR* variables, stack_t** stacktop, extra_parameters* extra)
enum ERROR_CODES {
ERR_DUPHANDLE = -16,
ERR_CREATEPIPE,
ERR_CREATEPROC,
ERR_CLOSEHANDLE,
ERR_WRITEPIPE,
ERR_GETEXITCODE,
ERR_LOGOPEN,
ERR_LOGWRITE,
ERR_TERMINATED,
ERR_CREATETHREAD
};
enum OUT_OPTIONS {
OUT_FILE,
OUT_STACK,
OUT_WINDOW,
OUT_FUNCTION
};
#define SLEEP_MS 10
#define T_O TEXT("/TIMEOUT")
#define N_W TEXT("/ASYNC")
#define TOSTACK TEXT("/TOSTACK")
#define DETAILED TEXT("/DETAILED")
#define TOWINDOW TEXT("/TOWINDOW")
#define TOFUNC TEXT("/TOFUNC")
#define DISABLEFSR TEXT("/DISABLEFSR")
#define ENDFUNC TEXT("/ENDFUNC")
typedef struct _threadParams {
TCHAR *dosExec;
TCHAR *pipeWrite;
DWORD target;
BOOL disableFsR;
TCHAR *logFile;
DWORD timeout;
HWND hOut;
LONG lFuncAddress;
LONG lEndFuncAddress;
} threadParams, *pthreadParams;
typedef BOOL (WINAPI* PWow64EnableWow64FsRedirection)(BOOL);
extra_parameters* ep;
HANDLE g_hInstance;
/*****************************************************
* FUNCTION NAME: my_strchr()
* PURPOSE:
* libc/msvcrt replacements
*****************************************************/
TCHAR *my_strchr(TCHAR *s, TCHAR c)
{
while(*s != 0)
{
if(*s == c)
return s;
s++;
}
return NULL;
}
/*****************************************************
* FUNCTION NAME: redirect()
* PURPOSE:
* Creates child process with redirected IO
* SPECIAL CONSIDERATIONS:
*
*****************************************************/
DWORD __stdcall redirect(void *pp)
{
HANDLE hOutputReadTmp,hOutputRead,hOutputWrite;
HANDLE hInputWriteTmp,hInputRead,hInputWrite;
HANDLE hErrorWrite;
PROCESS_INFORMATION pi;
STARTUPINFO *psi = (STARTUPINFO*)GlobalAlloc(GPTR, sizeof(STARTUPINFO));
SECURITY_ATTRIBUTES sa;
HANDLE f = INVALID_HANDLE_VALUE;
DWORD rslt = 0,
waitTime = 0,
dwRead = 0;
char b[256];
TCHAR *szStack = NULL;
unsigned int iStack = 0, iPipeWrite;
pthreadParams ptp = (pthreadParams)pp;
LVITEM lvItem;
lvItem.mask = LVIF_TEXT;
lvItem.iItem = 0;
lvItem.iSubItem = 0;
lvItem.pszText = NULL;
lvItem.cchTextMax = 0;
iPipeWrite = lstrlen(ptp->pipeWrite);
/* creates child process with redirected IO */
sa.nLength= sizeof(SECURITY_ATTRIBUTES);
sa.lpSecurityDescriptor = NULL;
sa.bInheritHandle = TRUE;
if(ptp->target != OUT_FILE)
{
szStack = (TCHAR*)GlobalAlloc(GPTR, sizeof(TCHAR) * (g_stringsize + 2));
lvItem.pszText = szStack;
}
/* disable WOW64 file system redirection */
if (ptp->disableFsR)
{
HINSTANCE hDll = GetModuleHandle(TEXT("kernel32.dll"));
PWow64EnableWow64FsRedirection Wow64EnableWow64FsRedirection = (PWow64EnableWow64FsRedirection)GetProcAddress(hDll, "Wow64EnableWow64FsRedirection");
if (Wow64EnableWow64FsRedirection != NULL)
Wow64EnableWow64FsRedirection(FALSE);
}
while(1)
{
/* creating pipes for child process with redirected IO */
if(!CreatePipe(&hOutputReadTmp,&hOutputWrite,&sa,0) ||
!CreatePipe(&hInputRead,&hInputWriteTmp,&sa,0))
{ rslt = ERR_CREATEPIPE; break; }
if(!DuplicateHandle(GetCurrentProcess(), hOutputWrite, GetCurrentProcess(),
/* duplicates handles and makes them inheritable */
&hErrorWrite, 0, TRUE, DUPLICATE_SAME_ACCESS) ||
!DuplicateHandle(GetCurrentProcess(), hOutputReadTmp, GetCurrentProcess(),
&hOutputRead, 0, FALSE, DUPLICATE_SAME_ACCESS) ||
!DuplicateHandle(GetCurrentProcess(), hInputWriteTmp, GetCurrentProcess(),
&hInputWrite, 0, FALSE, DUPLICATE_SAME_ACCESS))
{ rslt = ERR_DUPHANDLE; break; }
/* run process and close unnecessary handles */
psi->cb = sizeof(STARTUPINFO);
psi->dwFlags = STARTF_USESTDHANDLES|STARTF_USESHOWWINDOW;
psi->hStdOutput = hOutputWrite;
psi->hStdInput = hInputRead;
psi->hStdError = hErrorWrite;
psi->wShowWindow = SW_HIDE; /* SW_NORMAL - for tests */
if(!CreateProcess(NULL, ptp->dosExec, NULL, NULL, TRUE, 0, NULL, NULL, psi, &pi))
{ rslt = ERR_CREATEPROC; break; }
/* closes temporary and unnesessery handles */
if(!CloseHandle(hOutputReadTmp) ||
!CloseHandle(hInputWriteTmp) ||
!CloseHandle(pi.hThread) ||
!CloseHandle(hOutputWrite) ||
!CloseHandle(hInputRead ) ||
!CloseHandle(hErrorWrite))
{ rslt = ERR_CLOSEHANDLE; break; }
/* write all to pipe - on tests it caches input strings correctly */
if(iPipeWrite > 0)
{
#ifdef UNICODE
int cbConverted = WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, ptp->pipeWrite, iPipeWrite, NULL, 0, NULL, NULL);
rslt = -1;
if (cbConverted > 0)
{
PCHAR pszConverted = (PCHAR)GlobalAlloc(GPTR, cbConverted + 1);
if (pszConverted)
{
if (WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, ptp->pipeWrite, iPipeWrite, pszConverted, cbConverted, NULL, NULL) > 0)
WriteFile(hInputWrite, pszConverted, cbConverted, &rslt, NULL);
GlobalFree(pszConverted);
}
}
if(
#else
if(WriteFile(hInputWrite, ptp->pipeWrite, iPipeWrite, &rslt, NULL) == 0 ||
#endif
rslt != (unsigned)iPipeWrite)
{ rslt = ERR_WRITEPIPE; break; }
FlushFileBuffers(hInputWrite);
}
/* open log file if name is correct */
if(ptp->target == OUT_FILE &&
*(ptp->logFile) != 0 &&
(f = CreateFile(ptp->logFile, GENERIC_WRITE, FILE_SHARE_READ, NULL,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE)
{ rslt = ERR_LOGOPEN; break; }
/* OK, this is main execution loop */
while(waitTime <= ptp->timeout &&
rslt != ERR_LOGWRITE &&
PeekNamedPipe(hOutputRead, 0, 0, 0, &dwRead, NULL) &&
GetExitCodeProcess(pi.hProcess, &rslt))
{
if(dwRead > 0)
{
if(ReadFile(hOutputRead, b, dwRead > sizeof(b) ? sizeof(b) : dwRead, &rslt, NULL) &&
rslt > 0)
{
if(ptp->target == OUT_FILE)
{
if(f != INVALID_HANDLE_VALUE &&
(WriteFile(f, b, rslt, &dwRead, NULL) == 0 || dwRead != rslt))
{
rslt = ERR_LOGWRITE;
break;
}
}
else
{
dwRead = 0;
while(dwRead < rslt)
{
if(b[dwRead] == TEXT('\n'))
{
/* supress empty lines */
if(iStack > 0)
{
szStack[iStack] = 0;
if(ptp->target == OUT_STACK)
pushstring(szStack);
else if(ptp->target == OUT_FUNCTION)
{
pushstring(szStack);
ep->ExecuteCodeSegment(ptp->lFuncAddress-1, 0);
}
else if(lstrcmpi(ptp->logFile, TEXT("SysListView32")) == 0)
{
lvItem.iItem = (int)SendMessage(ptp->hOut, LVM_GETITEMCOUNT, 0, 0);
lvItem.iItem = (int)SendMessage(ptp->hOut, LVM_INSERTITEM, 0, (LPARAM)&lvItem);
SendMessage(ptp->hOut, LVM_ENSUREVISIBLE, lvItem.iItem, 0);
}
else if(lstrcmpi(ptp->logFile, TEXT("Edit")) == 0 || lstrcmpi(ptp->logFile, TEXT("RichEdit20A")) == 0)
{
lstrcat(szStack, TEXT("\r\n"));
lvItem.iItem = (int)SendMessage(ptp->hOut, WM_GETTEXTLENGTH, 0, 0);
SendMessage(ptp->hOut, EM_SETSEL, lvItem.iItem, lvItem.iItem);
SendMessage(ptp->hOut, EM_REPLACESEL, 0, (LPARAM)szStack);
}
else if(lstrcmpi(ptp->logFile, TEXT("ListBox")) == 0)
{
lvItem.iItem = (int)SendMessage(ptp->hOut, LB_GETCOUNT, 0, 0);
lvItem.iItem = (int)SendMessage(ptp->hOut, LB_INSERTSTRING, lvItem.iItem, (LPARAM)szStack);
//SendMessage(ptp->hOut, LVM_ENSUREVISIBLE, lvItem.iItem, 0);
}
iStack = 0;
}
}
else if(b[dwRead] != TEXT('\r') && iStack < (g_stringsize-1))
{
szStack[iStack++] = b[dwRead];
}
dwRead++;
}
}
}
if(f != INVALID_HANDLE_VALUE)
FlushFileBuffers(f);
}
else if(rslt == STILL_ACTIVE)
{
Sleep(SLEEP_MS);
waitTime += SLEEP_MS;
}
else break;
}
if(iStack > 0)
{
szStack[iStack] = 0;
pushstring(szStack);
}
if(f != INVALID_HANDLE_VALUE) CloseHandle(f);
if(GetExitCodeProcess(pi.hProcess, &rslt))
{
if(rslt == STILL_ACTIVE)
{
TerminateProcess(pi.hProcess, -1);
rslt = ERR_TERMINATED;
}
}
else rslt = ERR_GETEXITCODE;
CloseHandle(pi.hProcess);
CloseHandle(hOutputRead);
CloseHandle(hInputWrite);
break;
}
GlobalFree(psi);
GlobalFree(ptp->dosExec);
GlobalFree(ptp->pipeWrite);
GlobalFree(ptp->logFile);
GlobalFree(ptp);
if(szStack) GlobalFree(szStack);
if (ptp->lEndFuncAddress != -1)
ep->ExecuteCodeSegment(ptp->lEndFuncAddress - 1, 0);
return (DWORD)rslt;
}
/*****************************************************
* FUNCTION NAME: PluginCallback()
* PURPOSE:
* for NSIS plugin API
*****************************************************/
static UINT_PTR PluginCallback(enum NSPIM msg)
{
return 0;
}
/*****************************************************
* FUNCTION NAME: wait()
* PURPOSE:
* waits for thread exit and closes handle
* SPECIAL CONSIDERATIONS:
* tested with my consApp.exe
*****************************************************/
NSISFUNC(wait)
{
DWORD rslt = ERR_CREATETHREAD;
TCHAR exitCode[16];
HANDLE hThread;
popstring(exitCode);
hThread = (HANDLE)myatou(exitCode);
/* push to stack application' exit code or -1 or "still_running" */
if(hThread != NULL)
{
WaitForSingleObject(hThread, INFINITE);
GetExitCodeThread(hThread, &rslt);
CloseHandle(hThread);
hThread = NULL;
}
wsprintf(exitCode, TEXT("%d"), rslt);
pushstring(exitCode);
}
/*****************************************************
* FUNCTION NAME: isdone()
* PURPOSE:
* checks if the thread has completed
* SPECIAL CONSIDERATIONS:
*
*****************************************************/
NSISFUNC(isdone)
{
TCHAR s[16];
HANDLE hThread;
// get thread handle from stack
popstring(s);
hThread = (HANDLE)myatou(s);
// is it running? 1 == yes, 0 == exited, -1 == error
if(hThread != NULL)
pushstring(WaitForSingleObject(hThread, 0) == WAIT_TIMEOUT ? TEXT("0") : TEXT("1"));
else
pushstring(TEXT("-1"));
}
/*****************************************************
* FUNCTION NAME: exec()
* PURPOSE:
* C dll entry point for hidden DOS process execution
* SPECIAL CONSIDERATIONS:
*
*****************************************************/
NSISFUNC(exec)
{
DWORD dwThreadId;
HANDLE hThread;
BOOL fWait = TRUE;
pthreadParams ptp = (pthreadParams)GlobalAlloc(GPTR, sizeof(threadParams));
TCHAR s[16];
TCHAR *p;
HWND childwnd;
ep = extra;
EXDLL_INIT();
ptp->dosExec = (TCHAR*)GlobalAlloc(GPTR, string_size * sizeof(TCHAR));
ptp->pipeWrite = (TCHAR*)GlobalAlloc(GPTR, string_size * sizeof(TCHAR));
ptp->logFile = (TCHAR*)GlobalAlloc(GPTR, string_size * sizeof(TCHAR));
ptp->timeout = 0xffffff;
ptp->lEndFuncAddress = -1;
ptp->disableFsR = FALSE;
while(!popstring(ptp->dosExec) && *(ptp->dosExec) == TEXT('/'))
{
if(lstrcmpi(ptp->dosExec, N_W) == 0)
{
fWait = FALSE;
}
else if(lstrcmpi(ptp->dosExec, DISABLEFSR) == 0)
{
ptp->disableFsR = TRUE;
}
else if(lstrcmpi(ptp->dosExec, TOSTACK) == 0)
{
ptp->target = OUT_STACK;
}
else if(lstrcmpi(ptp->dosExec, TOWINDOW) == 0)
{
ptp->target = OUT_WINDOW;
}
else if(lstrcmpi(ptp->dosExec, TOFUNC) == 0)
{
ptp->target = OUT_FUNCTION;
}
else if(lstrcmpi(ptp->dosExec, DETAILED) == 0)
{
// convert 'detailed' to 'window' option
ptp->target = OUT_WINDOW;
if(hWndParent &&
(childwnd = FindWindowEx(hWndParent, NULL, TEXT("#32770"), NULL)) != NULL)
wsprintf(ptp->logFile, TEXT("%d"), (int)GetDlgItem(childwnd, 0x3f8));
}
else if((p = my_strchr(ptp->dosExec, TEXT('='))) != NULL)
{
*p++ = 0;
if(lstrcmpi(ptp->dosExec, T_O) == 0)
ptp->timeout = myatou(p);
else if(lstrcmpi(ptp->dosExec, ENDFUNC) == 0)
ptp->lEndFuncAddress = myatou(p);
}
*(ptp->dosExec) = 0;
}
// if stack is not empty and no /tostack or /detailed output option
if(popstring(ptp->pipeWrite) == 0 &&
*ptp->logFile == 0 && // may be in use by DETAILED window
ptp->target != OUT_STACK) // 2 param suposed only
popstring(ptp->logFile);
// output window was kept in string. Let's handle it once
if(ptp->target == OUT_WINDOW)
{
ptp->hOut = (HWND)myatou(ptp->logFile);
GetClassName(ptp->hOut, ptp->logFile, string_size);
}
if(ptp->target == OUT_FUNCTION)
{
ptp->lFuncAddress = (LONG)myatou(ptp->logFile);
}
hThread = CreateThread(NULL, 0, redirect, ptp, 0, &dwThreadId);
wsprintf(s, TEXT("%u"), hThread);
pushstring(s);
if(fWait)
wait(hWndParent, string_size, variables, stacktop, extra);
else
extra->RegisterPluginCallback((HMODULE)g_hInstance, PluginCallback);
}
/*****************************************************
* FUNCTION NAME: DllMain()
* PURPOSE:
* Dll main entry point
* SPECIAL CONSIDERATIONS:
*
*****************************************************/
BOOL WINAPI DllMain(HANDLE hInst,
ULONG ul_reason_for_call,
LPVOID lpReserved)
{
g_hInstance = hInst;
return TRUE;
}

BIN
Windows/NSIS/Contrib/ExecDos/execDos.rc View File


+ 229
- 0
Windows/NSIS/Contrib/ExecDos/nsis_tchar.h View File

@@ -0,0 +1,229 @@
/*
* nsis_tchar.h
*
* This file is a part of NSIS.
*
* Copyright (C) 1999-2013 Nullsoft and Contributors
*
* This software is provided 'as-is', without any express or implied
* warranty.
*
* For Unicode support by Jim Park -- 08/30/2007
*/
// Jim Park: Only those we use are listed here.
#pragma once
#ifdef _UNICODE
#ifndef _T
#define __T(x) L ## x
#define _T(x) __T(x)
#define _TEXT(x) __T(x)
#endif
#ifndef _TCHAR_DEFINED
#define _TCHAR_DEFINED
#if !defined(_NATIVE_WCHAR_T_DEFINED) && !defined(_WCHAR_T_DEFINED)
typedef unsigned short TCHAR;
#else
typedef wchar_t TCHAR;
#endif
#endif
// program
#define _tenviron _wenviron
#define __targv __wargv
// printfs
#define _ftprintf fwprintf
#define _sntprintf _snwprintf
#if (defined(_MSC_VER) && (_MSC_VER<=1310)) || defined(__MINGW32__)
# define _stprintf swprintf
#else
# define _stprintf _swprintf
#endif
#define _tprintf wprintf
#define _vftprintf vfwprintf
#define _vsntprintf _vsnwprintf
#if defined(_MSC_VER) && (_MSC_VER<=1310)
# define _vstprintf vswprintf
#else
# define _vstprintf _vswprintf
#endif
// scanfs
#define _tscanf wscanf
#define _stscanf swscanf
// string manipulations
#define _tcscat wcscat
#define _tcschr wcschr
#define _tcsclen wcslen
#define _tcscpy wcscpy
#define _tcsdup _wcsdup
#define _tcslen wcslen
#define _tcsnccpy wcsncpy
#define _tcsncpy wcsncpy
#define _tcsrchr wcsrchr
#define _tcsstr wcsstr
#define _tcstok wcstok
// string comparisons
#define _tcscmp wcscmp
#define _tcsicmp _wcsicmp
#define _tcsncicmp _wcsnicmp
#define _tcsncmp wcsncmp
#define _tcsnicmp _wcsnicmp
// upper / lower
#define _tcslwr _wcslwr
#define _tcsupr _wcsupr
#define _totlower towlower
#define _totupper towupper
// conversions to numbers
#define _tcstoi64 _wcstoi64
#define _tcstol wcstol
#define _tcstoul wcstoul
#define _tstof _wtof
#define _tstoi _wtoi
#define _tstoi64 _wtoi64
#define _ttoi _wtoi
#define _ttoi64 _wtoi64
#define _ttol _wtol
// conversion from numbers to strings
#define _itot _itow
#define _ltot _ltow
#define _i64tot _i64tow
#define _ui64tot _ui64tow
// file manipulations
#define _tfopen _wfopen
#define _topen _wopen
#define _tremove _wremove
#define _tunlink _wunlink
// reading and writing to i/o
#define _fgettc fgetwc
#define _fgetts fgetws
#define _fputts fputws
#define _gettchar getwchar
// directory
#define _tchdir _wchdir
// environment
#define _tgetenv _wgetenv
#define _tsystem _wsystem
// time
#define _tcsftime wcsftime
#else // ANSI
#ifndef _T
#define _T(x) x
#define _TEXT(x) x
#endif
#ifndef _TCHAR_DEFINED
#define _TCHAR_DEFINED
typedef char TCHAR;
#endif
// program
#define _tenviron environ
#define __targv __argv
// printfs
#define _ftprintf fprintf
#define _sntprintf _snprintf
#define _stprintf sprintf
#define _tprintf printf
#define _vftprintf vfprintf
#define _vsntprintf _vsnprintf
#define _vstprintf vsprintf
// scanfs
#define _tscanf scanf
#define _stscanf sscanf
// string manipulations
#define _tcscat strcat
#define _tcschr strchr
#define _tcsclen strlen
#define _tcscnlen strnlen
#define _tcscpy strcpy
#define _tcsdup _strdup
#define _tcslen strlen
#define _tcsnccpy strncpy
#define _tcsrchr strrchr
#define _tcsstr strstr
#define _tcstok strtok
// string comparisons
#define _tcscmp strcmp
#define _tcsicmp _stricmp
#define _tcsncmp strncmp
#define _tcsncicmp _strnicmp
#define _tcsnicmp _strnicmp
// upper / lower
#define _tcslwr _strlwr
#define _tcsupr _strupr
#define _totupper toupper
#define _totlower tolower
// conversions to numbers
#define _tcstol strtol
#define _tcstoul strtoul
#define _tstof atof
#define _tstoi atoi
#define _tstoi64 _atoi64
#define _tstoi64 _atoi64
#define _ttoi atoi
#define _ttoi64 _atoi64
#define _ttol atol
// conversion from numbers to strings
#define _i64tot _i64toa
#define _itot _itoa
#define _ltot _ltoa
#define _ui64tot _ui64toa
// file manipulations
#define _tfopen fopen
#define _topen _open
#define _tremove remove
#define _tunlink _unlink
// reading and writing to i/o
#define _fgettc fgetc
#define _fgetts fgets
#define _fputts fputs
#define _gettchar getchar
// directory
#define _tchdir _chdir
// environment
#define _tgetenv getenv
#define _tsystem system
// time
#define _tcsftime strftime
#endif
// is functions (the same in Unicode / ANSI)
#define _istgraph isgraph
#define _istascii __isascii
#define __TFILE__ _T(__FILE__)
#define __TDATE__ _T(__DATE__)
#define __TTIME__ _T(__TIME__)

+ 294
- 0
Windows/NSIS/Contrib/ExecDos/pluginapi.c View File

@@ -0,0 +1,294 @@
#include <windows.h>
#include "pluginapi.h"
#ifdef _countof
#define COUNTOF _countof
#else
#define COUNTOF(a) (sizeof(a)/sizeof(a[0]))
#endif
unsigned int g_stringsize;
stack_t **g_stacktop;
TCHAR *g_variables;
// utility functions (not required but often useful)
int NSISCALL popstring(TCHAR *str)
{
stack_t *th;
if (!g_stacktop || !*g_stacktop) return 1;
th=(*g_stacktop);
if (str) lstrcpy(str,th->text);
*g_stacktop = th->next;
GlobalFree((HGLOBAL)th);
return 0;
}
int NSISCALL popstringn(TCHAR *str, int maxlen)
{
stack_t *th;
if (!g_stacktop || !*g_stacktop) return 1;
th=(*g_stacktop);
if (str) lstrcpyn(str,th->text,maxlen?maxlen:g_stringsize);
*g_stacktop = th->next;
GlobalFree((HGLOBAL)th);
return 0;
}
void NSISCALL pushstring(const TCHAR *str)
{
stack_t *th;
if (!g_stacktop) return;
th=(stack_t*)GlobalAlloc(GPTR,(sizeof(stack_t)+(g_stringsize)*sizeof(TCHAR)));
lstrcpyn(th->text,str,g_stringsize);
th->next=*g_stacktop;
*g_stacktop=th;
}
TCHAR* NSISCALL getuservariable(const int varnum)
{
if (varnum < 0 || varnum >= __INST_LAST) return NULL;
return g_variables+varnum*g_stringsize;
}
void NSISCALL setuservariable(const int varnum, const TCHAR *var)
{
if (var != NULL && varnum >= 0 && varnum < __INST_LAST)
lstrcpy(g_variables + varnum*g_stringsize, var);
}
#ifdef _UNICODE
int NSISCALL PopStringA(char* ansiStr)
{
wchar_t* wideStr = (wchar_t*) GlobalAlloc(GPTR, g_stringsize*sizeof(wchar_t));
int rval = popstring(wideStr);
WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, g_stringsize, NULL, NULL);
GlobalFree((HGLOBAL)wideStr);
return rval;
}
int NSISCALL PopStringNA(char* ansiStr, int maxlen)
{
int realLen = maxlen ? maxlen : g_stringsize;
wchar_t* wideStr = (wchar_t*) GlobalAlloc(GPTR, realLen*sizeof(wchar_t));
int rval = popstringn(wideStr, realLen);
WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, realLen, NULL, NULL);