User Tools

Site Tools


wiki:development:build-howto-mswin:x2goclient

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:development:build-howto-mswin:x2goclient [2014/01/16 13:28]
mikedep333 Add PuTTY
wiki:development:build-howto-mswin:x2goclient [2023/05/08 22:20] (current)
orion [Copying the nxproxy binaries] Use nxproxy\src\.libs\nxproxy.exe
Line 1: Line 1:
 ====== Build X2GoClient and 3rd-party programs for MS Windows ====== ====== Build X2GoClient and 3rd-party programs for MS Windows ======
  
-This howto explains how to build the MS Windows version of X2Go Client. This howto explains how to build the 32-bit version of X2Go Client on MS Windows. If someone successfully attempts a 64-bit (which should work, but needs to be tested), please contribute to this wiki page.+This howto explains how to build the MS Windows version of X2Go Client.
  
 +
 +This howto explains how to build the 32-bit version of X2Go Client on MS Windows. If someone successfully attempts a 64-bit (which should work, but needs to be tested), please contribute to this wiki page.
 +
 +This howto is intended for 2 different audiences:
 +  - Those doing official X2Go Project builds.
 +  - Those doing informal builds, personal builds, or builds for use within their organization.
 +The former audience has extra steps to do. These steps will be noted.
  
 ===== Overview of third-party components ===== ===== Overview of third-party components =====
  
-X2Go Cltient for Windows needs several 3rd-party programmes for being able to run on MS Windows:+X2Go Client for Windows needs several 3rd-party programs for being able to run on MS Windows:
  
  
-  * [[wiki:development:build-howto-mswin:x2goclient/#nxproxy|nxproxy]]+  * [[wiki:development:build-howto-mswin:x2goclient/#building_nxproxy_openssh_optional|nxproxy]]
  
-  * [[wiki:development:build-howto-mswin:x2goclient/#open_ssh_server|Open SSH Server]] for file sharing (optional)+  * [[wiki:development:build-howto-mswin:x2goclient/#openssh_server|OpenSSH Server]] for file sharing (optional)
  
   * [[wiki:development:build-howto-mswin:x2goclient/#pulseaudio|PulseAudio]] for sound support (optional)   * [[wiki:development:build-howto-mswin:x2goclient/#pulseaudio|PulseAudio]] for sound support (optional)
  
-  * [[wiki:development:build-howto-mswin:x2goclient/#vcxsrv|X-Server]](VcXsrv)+  * [[wiki:development:build-howto-mswin:x2goclient/#vcxsrv_-_xp_compatible|X-Server]] (VcXsrv
 + 
 +  * [[wiki:development:build-howto-mswin:x2goclient/#x3270-fonts|x3270 fonts]] (optional)
  
   * [[wiki:development:build-howto-mswin:x2goclient/#putty|PuTTY]] for Kerberos 5 (GSSAPI) authentication   * [[wiki:development:build-howto-mswin:x2goclient/#putty|PuTTY]] for Kerberos 5 (GSSAPI) authentication
  
-All these programmes can be built from source, downloaded from our [[http://code.x2go.org/releases/binary-win32/3rd-party|server]] or from their project sites. You can also copy the 3rd-party components from X2Go Client installation (on MS Windows) directory.+All these programs, as well as many of the libraries, can now be downloaded from [[http://code.x2go.org/gitweb?p=x2goclient-contrib.git;a=tree;hb=HEAD|x2goclient-contrib.git]]. Older versions are available from our [[http://code.x2go.org/releases/binary-win32/3rd-party|server]] 
 + 
 +They can also be built from source, or downloaded from their project sites. However, this howto only explains how to build nxproxy and OpenSSH. 
 + 
 +You can also copy the 3rd-party components from X2Go Client installation (on MS Windows) directory.
  
 ===== Build Utilities ===== ===== Build Utilities =====
  
-For building X2Go Client, we highly recommend to install [[http://msysgit.github.io/|MSysGit]] and [[http://www.flos-freeware.ch/notepad2.html|Notepad2]].+For building X2Go Client, we highly recommend to install [[http://msysgit.github.io/|MSysGit]] and [[http://www.flos-freeware.ch/notepad2.html|Notepad2]]. Any other editor that is capable of handling both UNIX- and Windows-style line endings and UTF-8 will do as well.
  
 MSysGit provides a Unix-like shell (bash) environment, so that you can use Git easily from the command line. MSysGit provides a Unix-like shell (bash) environment, so that you can use Git easily from the command line.
 +
 +For official X2Go project updates to x2goclient-contrib, use Cygwin. It handles symlinks differently.
  
 Notepad2 is a freeware alternative to Notepad shipped with Microsoft Windows. Notepad2 understands UTF-8 text formats (and others) and can handle Unix-style line endings. In case you want to introspect a code file, this tool is very handy. Notepad2 is a freeware alternative to Notepad shipped with Microsoft Windows. Notepad2 understands UTF-8 text formats (and others) and can handle Unix-style line endings. In case you want to introspect a code file, this tool is very handy.
-===== Build X2Go Client ===== 
  
 +===== Setup Build Environment =====
  
 ==== Installing MinGW ==== ==== Installing MinGW ====
  
-MinGW is a gcc compiler for Windows. You need it to build X2Go Client. Qt-4.8 for Windows should be used with MinGw-4.4. Unfortunately, you can not download binaries for this version from MinGW project site any more. You can build it from source or download it from [[http://code.x2go.org/releases/binary-win32/tools/MinGW-gcc440_1.zip|X2Go Site ]]+MinGW includes the GCC compiler suite for Windows. You need it to build X2Go Client.
  
-Extract it to your disk (''D:\mingw'' in this example).+Since X2Go Client 4.0.3.0, X2Go Client uses Qt 4.8.6 specifically. Qt 4.8.6 uses MinGW 4.8.x. Qt 4.8.6 for Windows recommends this specific build of MinGW, so it is this specific build that you should use.
  
-Finally, you have to add these MinGW executable directories to your PATH environment variable: ''D:\mingw\bin'', ''D:\mingw\libexec\gcc\mingw32\4.4.0''.+http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/4.8.2/threads-posix/dwarf/i686-4.8.2-release-posix-dwarf-rt_v3-rev3.7z 
 + 
 +Extract it to your disk (''D:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32'' in this example). 
 + 
 +Finally, you have to add these MinGW executable directories to your PATH environment variable: ''D:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\bin'', ''D:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\libexec\gcc\i686-w64-mingw32\4.8.2''.
  
 ==== Installing Qt ==== ==== Installing Qt ====
  
-You need Qt to build X2Go Client from source. Qt-4.8 is tested and recommended for current version of X2Go Client.+You need Qt to build X2Go Client from source.
  
-Download and install a **MinGW** version of Qt-4.8 for Windows from [[http://qt-project.org/downloads|here]]+Qt-4.8.6 is tested and recommended for X2Go Client 4.0.3.0 and later.
  
-In this example D:\Qt will be chosen as installation directory+Download and install the **MinGW** version of Qt-4.8.6 for Windows from [[http://download.qt-project.org/archive/qt/4.8/4.8.6/|here]] 
 + 
 +In this example D:\Qt\4.8.6 will be chosen as installation directory
  
 ==== Configuring Qt ==== ==== Configuring Qt ====
Line 51: Line 72:
 === Providing OpenSSL support in Qt === === Providing OpenSSL support in Qt ===
  
-As X2Go Client needs Qt with SSL support you must install OpenSSL for MS Windows. OpenSSL depends on the [[http://www.microsoft.com/en-us/download/details.aspx?id=29|Microsoft Visual C++ 2008 Redistributables]]. Get that (32-bit version, x86) from the Microsoft site and install it prior to installing OpenSSL.+As X2Go Client needs Qt built with SSL support you must install OpenSSL for MS Windows. OpenSSL depends on the [[https://www.microsoft.com/en-us/download/details.aspx?id=40784|Microsoft Visual C++ 2013 Redistributables]]. Get that (32-bit version, x86) from the Microsoft site and install it prior to installing OpenSSL.
  
-The OpenSSL installer for Windows [[http://slproweb.com/download/Win32OpenSSL-1_0_1e.exe|here]] or from [[http://code.x2go.org/releases/binary-win32/3rd-party/Win32OpenSSL/|our site]]. Install it on your build system (for example to directory ''d:\OpenSSL-Win32'').+Download the OpenSSL installer for Windows by browsing [[http://slproweb.com/products/Win32OpenSSL.html|here]] and selecting "Win32 OpenSSL v1.0.1*" where "1.0.1*" s the current version. You can also download it from [[http://code.x2go.org/releases/binary-win32/3rd-party/Win32OpenSSL/|our site]], but only do so if we have the current version. Install it on your build system (for example to directory ''d:\OpenSSL-Win32'').
  
 After installation, copy OpenSSL header files into MinGW's include directory: After installation, copy OpenSSL header files into MinGW's include directory:
  
 +For MinGW 4.8:
 <code> <code>
-d:\OpenSSL-Win32\include\openssl -> d:\mingw\include\openssl+d:\OpenSSL-Win32\include\openssl -> d:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\i686-w64-mingw32\include\openssl
 </code> </code>
  
 === Static builds of Qt with SSL support === === Static builds of Qt with SSL support ===
  
-It is recommended to configure Qt to build statically linked applications. It will take some time to reconfigure Qt for static builds. You surely can skip this step, but in this case you must provide Qt libraries with your X2Go Client binary.+It is recommended to configure Qt to build statically linked applications. 
 + 
 +This is how official X2Go Client builds are done. 
 + 
 +It will take some time to reconfigure Qt for static builds. You surely can skip this step, but in this case you must provide Qt libraries with your X2Go Client binary
 + 
 +Open Qt Command Prompt and start configuration script.
  
-Open Qt Command Prompt and start configuration script+For Qt 4.8.6, the command needs extra args due to QTBUG-38706:
 <code> <code>
-$ configure -release -static -openssl+$ configure -release -static -openssl -qt-style-windowsxp -qt-style-windowsvista
 </code> </code>
  
-Rebuild Qt+Rebuild Qt:
 <code> <code>
-$ make sub-src+$ make -j3 sub-src
 </code> </code>
  
Line 79: Line 107:
 If you choose to build dynamically linked applications with Qt, you still have to rebuild Qt in order to get OpenSSL support into Qt. If you choose to build dynamically linked applications with Qt, you still have to rebuild Qt in order to get OpenSSL support into Qt.
  
-Open Qt Command Prompt and start configuration script+Open Qt Command Prompt and start configuration script
 + 
 +For Qt 4.8.6, the command needs extra args due to QTBUG-38706:
 <code> <code>
-$ configure -release -openssl+$ configure -release -openssl -qt-style-windowsxp -qt-style-windowsvista
 </code> </code>
  
-Rebuild Qt+Rebuild Qt:
 <code> <code>
-$ make sub-src+$ make -j3 sub-src
 </code> </code>
- 
  
 ==== Installing libssh ==== ==== Installing libssh ====
 You need libssh to build X2Go Client. You need libssh to build X2Go Client.
  
-Get libssh **library** package built with MinGW from  [[ftp://winkde.org/kde/ports/win32/releases/stable/latest/ |the KDE Windows project]] or from [[http://code.x2go.org/releases/binary-win32/3rd-party/libssh/|our site]]Extract files from archive+X2Go Client 4.1.2.2 and later use libssh 0.9.x with pageant support.
  
-Copy headers files in "include" directory of MinGW+=== Pre-built Binaries ===
  
-libssh\include\libssh -> d:\mingw\include\libssh+Get the **library** package built with MinGW 4.8.x (currently 4.8.2) from [[http://code.x2go.org/gitweb?p=x2goclient-contrib.git;a=tree;hb=HEAD | x2goclient-contrib.git]] 
 + 
 + 
 +Copy headers files in "include" directory of MinGW. 
 + 
 +For MinGW 4.8: 
 +<code> 
 +x2goclient-contrib\libssh\0.6.3-762055b-pageant-support-mingw482_bin\include\libssh -> d:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\i686-w64-mingw32\include\libssh 
 +</code>
  
 Copy library files in "lib" directory of MinGW Copy library files in "lib" directory of MinGW
  
-libssh\lib\*.* -> d:\mingw\lib\+For MinGW 4.8: 
 +<code> 
 +x2goclient-contrib\libssh\0.6.3-762055b-pageant-support-mingw482_bin\lib\*.* -> d:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\i686-w64-mingw32\lib\ 
 +</code>
  
 +=== Building From Source ===
 +
 +If you want to rebuild the library (e.g., to backport fixes) or update it as part of the release process, follow these steps.
 +
 +== Preparation ==
 +
 +Download the tarball from [[https://www.libssh.org/get-it/|the libssh website]].
 +
 +Unpack it as usually. The X2Go Project keeps libssh source code at ''D:\Build\libssh\''.
 +
 +Adapt any required patches so that they apply cleanup, build and work correctly.
 +
 +We currently patch libssh to include support for PuTTY's Pageant ssh agent.
 +
 +To rebase patches, the X2Go Project uses the private git repository at ''D:\Build\libssh\libssh-git'':
 +  * update the repository: <code>git fetch origin</code>
 +  * check out new release tag (or branch or whatever you intend to build later on): <code>git checkout ... (e.g., libssh-0.9.3)</code>
 +  * create new branch based on the tag/commit/branch/...: <code>git branch ...-win32 (e.g., libssh-0.9.3-win32)</code>
 +  * cherry-pick specific X2Go-related commits from older branches, one ''cherry-pick'' command per commit to be ported: <code>git cherry-pick ...-win32 (e.g., libssh-0.7.4-win32)</code>
 +  * fix any merge conflicts, pull in other upstream code etc.
 +  * update the commit message!
 +  * when done, create patch files: <code>git format-patch HEAD~ (for one patch, use ~~ for two patches etc.)</code>
 +
 +Move the patches to the respective source directory and apply them in order.
 +
 +If needed, install or update ''cmake'' on the build machine.
 +
 +== Configuration ==
 +
 +Open a terminal window. Crucially, this must **not** be a ''Cygwin'' instance.
 +
 +Make sure that the MinGW toolchain that was used to build Qt (and will be used to build X2Go CLient later on) is part of the %PATH% variable. On the X2Go Windows Builder, a session spawned via ''cmd.exe'' typically fulfills this requirement. Additionally, use the same ''zlib'' version for building both ''Qt'' and ''libssh''.
 +
 +Go to the unpacked source directory: <code>D:; cd Build\libssh\libssh-...</code>
 +
 +Create and switch to a build subdirectory: <code>mkdir build; cd build</code>
 +
 +The pre-built libssh versions in ''x2goclient-contrib'' contain a file called ''CMake-Show-My-Changes.txt''. Use this as a reference for building.
 +
 +Call ''cmake'' to configure the project, example (adapt to your system!): <code>"C:\Program Files\CMake\bin\cmake.exe" -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX:PATH="D:/Build/libssh/libssh-staging" -DCMAKE_C_COMPILER:FILEPATH="D:/i686-4.8.2-release-posix-dwarf-rt_v3-rev3/mingw32/bin/gcc.exe" -DCMAKE_LINKER:FILEPATH="D:/i686-4.8.2-release-posix-dwarf-rt_v3-rev3/mingw32/bin/ld.exe" -DZLIB_LIBRARY_RELEASE:FILEPATH="D:/x2goclient-contrib/zlib/1.2.8_bin/zlib1.dll" -DWITH_GSSAPI:BOOL="0" -DWITH_NACL:BOOL="0" -DCMAKE_BUILD_TYPE:STRING="Release" -DCMAKE_MAKE_PROGRAM:FILEPATH="D:/i686-4.8.2-release-posix-dwarf-rt_v3-rev3/mingw32/bin/mingw32-make.exe" -DWITH_EXAMPLES:BOOL="0" -DZLIB_INCLUDE_DIR:PATH="D:/Build/zlib/zlib-1.2.8/" -DLIB_EAY:FILEPATH="D:/OpenSSL-Win32/lib/MinGW/libeay32.a" -DSSL_EAY:FILEPATH="D:/OpenSSL-Win32/lib/MinGW/ssleay32.a" -DOPENSSL_INCLUDE_DIR:PATH="D:/OpenSSL-Win32/include" ..</code>
 +
 +== Build ==
 +
 +Build the software like any other, append ''-j'' and other flags as desired:
 +
 +<code>"D:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\bin\mingw32-make.exe"</code>
 +
 +== Install ==
 +
 +It's recommended to make sure that the install staging area is clean (fully deleted or at least empty) before installing/staging the built software.
 +
 +This ensures that old/removed files won't linger around and that changes will not remain undetected.
 +
 +<code>rm -rf "D:\Build\libssh\libssh-staging"
 +"D:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\bin\mingw32-make.exe" install</code>
 +
 +Afterwards, clean and install the newly built files into the MinGW prefix:
 +
 +Header files:
 +
 +<code>
 +rm -rf "D:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\i686-w64-mingw32\include\libssh"
 +cp -av "D:\Build\libssh\libssh-staging\include\libssh" "D:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\i686-w64-mingw32\include\libssh"
 +</code>
 +
 +<note>''(dll).a'' files can be static libraries that are being used as "DLL import libraries" on Windows. They do not actually contain the library contents but a mechanism for loading the shared DLL files at run time. This differs from the UNIX concept of the linker automatically generating (unresolved) symbols and ignoring them (if an eventual symbol scanning suceeds) that are automatically resolved at run time.
 +
 +As such, it is important to keep these static DLL import libraries around on Windows, even if library is supposed to be used in a dynamically-linked fashion.</note>
 +
 +
 +Library files:
 +
 +<code>
 +for /R "D:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\i686-w64-mingw32\lib\" %I in (libssh*) do rm -rf "%I"
 +D:
 +cd "D:\Build\libssh\libssh-staging\lib"
 +for %I in (libssh*) do cp -av "%I" "D:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\i686-w64-mingw32\lib\"
 +</code>
 +
 +Afterwards, optionally bundle the new libssh source and binaries in x2goclient-contrib. Explicitly document the command line invocation in a file named ''CMake-Show-My-Changes.txt''.
 +
 +===== Build X2Go Client =====
  
 ==== Build X2Go Client from source ==== ==== Build X2Go Client from source ====
Line 109: Line 231:
 <code> <code>
 $ git clone git://code.x2go.org/x2goclient.git $ git clone git://code.x2go.org/x2goclient.git
 +$ cd x2goclient
 </code> </code>
  
-Build X2Go Client+Generate the changelog, which x2goclient.exe --changelog will show: 
 +<code> 
 +$ copy debian\changelog txt\ 
 +$ git --no-pager log --since "2 years ago" --format="%ai %aN (%h) %n%n%x09*%w(68,0,10) %s%d%n" > ChangeLog.gitlog 
 +$ copy ChangeLog.gitlog txt\git-info 
 +</code> 
 + 
 +Build X2Go Client:
 <code> <code>
 $ cd x2goclient $ cd x2goclient
-$ PATH=%PATH%;D:\MinGW\libexec\gcc\mingw32\4.4.0\+$ PATH=%PATH%;D:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\bin\
 $ config_win.bat $ config_win.bat
 +$ cd client_build
 $ mingw32-make $ mingw32-make
 +$ cd ..
 +$ cd x2gohelper
 +$ mingw32-make
 +$ cd ..
 </code> </code>
  
-X2Go Client (x2goclient.exe) binary is in d:\build\x2goclient\release directory+X2Go Client binaries (x2goclient.exe & x2gohelper.exe) are in d:\build\x2goclient\releasedirectory.
  
-==== Pack/Compress X2Go Client ====+==== Build X2Go Client from source (debug build) ==== 
 +Repeat the instructions for "Build X2Go Client from source", except
  
-You may want to pack X2Go Client to reduce it sizeYou can do it with [[http://upx.sourceforge.net/|upx]], which is available for Windows, Linux and Cygwin.+  - Before running config_win.bat, edit x2goclient.pro so that "CONFIG += console" is uncommented 
 +  - Edit nsis\x2goclient.nsi so that the following lines:
  
-==== X2Go Client package folder ====+<code> 
 +  CreateShortCut "$INSTDIR\X2Go Client.lnk" "$INSTDIR\x2goclient.exe" 
 +  CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\X2Go Client.lnk" "$INSTDIR\x2goclient.exe" 
 +  CreateShortCut "$DESKTOP\X2Go Client.lnk" "$INSTDIR\x2goclient.exe" 
 +</code>
  
-To make X2Go Client usable on Windows, you must put X2Go Client binary and all libraries and components in one directory.+Are replaced with the following:
  
-All of the files referenced below (apart from x2goclient.exe) can be obtained from [[http://code.x2go.org/gitweb?p=x2goclient-contrib.git;a=summary|x2goclient-contrib.git]] on http://git.x2go.org+<code> 
 +  CreateShortCut "$INSTDIR\X2Go Client.lnk" "$INSTDIR\x2goclient.exe "--debug" 
 +  CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\X2Go Client.lnk" "$INSTDIR\x2goclient.exe" "--debug" 
 +  CreateShortCut "$DESKTOP\X2Go Client.lnk" "$INSTDIR\x2goclient.exe"  "--debug" 
 +</code>
  
 +==== Copy the X2Go Client binaries to the desired folder ====
  
-In the base directory of your X2Go Client source tree create a folder named ''dist/''. To this folder you have to add the following components:+The 2 binaries to copy are:
  
-  * X2Go Client with libraries +  - ''x2goclient.exe'' (from the ''client_build\release'' folder
-  * nxproxy with libraries +  - ''x2gohelper.exe'' (from the ''client_build\release'' folder)
-  * Open SSH Server with libraries (optional+
-  * VcXsrv +
-  * PulseAudio (optional)+
  
-=== Add X2Go Client with libraries to package folder ===+However, you must decide where you wish to copy them.
  
-  - Add x2goclient.exe (from the ''release/'' folder) to the ''dist/'' folder. +  - If you wish to run x2goclient from a folder without creating and running the NSIS installer, copy them to the ''dist'' folder. This is the folder where you will run them from. 
-  - Add MinGW libraries (copy from ''D:\MinGW\bin''+  - If you wish to create an x2goclient NSIS installercreate the ''nsis\x2goclient'' folder and copy them there.
-    * ''libgcc_s_dw2-1.dll'' +
-    * ''mingwm10.dll'' +
-  - Add OpenSSL library (copy from your OpenSSL installation directory) +
-    * ''libeay32.dll'' +
-  - libssh library (binaries originally from [[ftp://winkde.org/kde/ports/win32/releases/stable/latest/the KDE Windows project]] site +
-    * ''libssh.dll'' +
-  - libzip library (binaries originally from [[ftp://winkde.org/kde/ports/win32/releases/stable/latest/ | the KDE Windows project]] site +
-    * ''libzip.dll'' +
-  - zlib library (binaries originally from [[ftp://winkde.org/kde/ports/win32/releases/stable/latest/ | the KDE Windows project]] site +
-    * ''libz.dll'' +
-  - If you want to use X2Go Client on older versions of Windowsyou should put the "Microsoft Visual C\+\+ Redistributable 2008 Package"'s dll files into your X2Go Client package directory. (Originally downloaded from the [[http://www.microsoft.com/en-us/download/details.aspx?id=29|Microsoft download site]]). +
-    * ''Microsoft.VC90.CRT.manifest'+
-    * ''msvcm90.dll'' +
-    * ''msvcp90.dll'' +
-    * ''msvcr90.dll''+
  
 +==== Pack/Compress X2Go Client ====
  
-===== Build/Add nxproxy with libraries =====+You may want to pack X2Go Client to reduce it size. You can do it with [[https://upx.github.io/|upx]], which is available for Windows, Linux and Cygwin.
  
-You can download nxproxy, and its libraries [[http://code.x2go.org/releases/binary-win32/3rd-party/nxproxy|here]] or obtain them from [[http://code.x2go.org/gitweb?p=x2goclient-contrib.git;a=tree;f=nxproxy|x2goclient-contrib.git]] directly.+Official regular builds of X2Go Client are packedOfficial debug builds of X2Go Client are notThere is no difference between nightly and release versions - both pack the release binary, while not packing the debug binary.
  
-  - Copy the nxproxy binaries directly into the ''dist/'' folder (built from [[http://code.x2go.org/gitweb?p=nx-libs.git;a=summary|nx-libs.git]] on http://git.x2go.org)+It is available in [[http://code.x2go.org/gitweb?p=x2goclient-contrib.git;a=tree;hb=HEAD|x2goclient-contrib.git]]. The current version is located at
-    * ''cygXcomp.dll'' +<code> 
-    * ''cygjpeg-8.dll'' +x2goclient-contrib\upx\3.95_bin\upx.exe 
-    * ''cygstdc\+\+-6.dll'' +</code>
-    * ''cygz.dll'' +
-    * ''cyggcc_s-1.dll'' +
-    * ''cygpng-3.dll'' +
-    * ''cygwin1.dll'' +
-    * ''nxproxy.exe''+
  
-If you want to build nxproxy from source, you need install and configure Cygwin first.+The 2 files to pack are: 
 +  - ''x2goclient.exe'' 
 +  - ''x2gohelper.exe'' 
 + 
 +===== Building nxproxy & OpenSSH (Optional) ===== 
 + 
 +Building a new version nxproxy or OpenSSH is optional for non-official X2Go project builds. 
 + 
 +Official X2Go project builds usually rebuild nxproxy and OpenSSH if there are desired updates to those components, or if the cygwin libraries have been updated. 
 + 
 +Official X2Go project builds are kept under the x2goclient-contrib git repository under a folder like "cygwin\20160121-1_bin" (the latest cygwin libraries as of 2016-01-21) or "cygwin\20160121-2_bin" (the former, with selective updates). These are then copied over during the Jenkins build process.
  
 ==== Installing Cygwin ==== ==== Installing Cygwin ====
  
-Download and start the [[http://cygwin.com/setup.exe|Cygwin installer]]+Download and start the [[https://cygwin.com/setup-x86.exe|Cygwin 32-bit installer]].
  
-Choose your cygwin directory. For example c:\cygwin. Follow installer instructions.+Choose your Cygwin directory. For example C:\cygwin. Follow installer instructions.
  
-on installer page "Select Packages" you can select programs and libraries that should be installed in your cygwin environment. For building of nxproxy you will need:+For the X2Go-WinBuilder VM, install to D:\cygwin.YYYY-MM-DD instead. 
 + 
 +You can automate the entirety of the instructions below with this command, except for selecting the source packages to install: 
 + 
 +<code> 
 +$ setup-x86.exe -P "autoconf,automake,gcc-core,gcc-g++,git,libX11-devel,libjpeg-devel,libpng-devel,libmpfr4,make,zlib-devel,wget,libedit-devel,libncurses-devel,openssl-devel,patch,bashdb,bash-completion,chere,colorgcc,colordiff,diffutils,dos2unix,cygcheck-dep,cygutils-extra,indent,mc,renameutils,vim,git-completion,patchutils,openssh,xz,unzip,nano,bzip2,time,mkfontdir,mkfontscale" 
 +</code> 
 + 
 +on installer page "Select Packages" you can select programs and libraries that should be installed in your Cygwin environment. For building of nxproxy you will need:
   * ''autoconf''   * ''autoconf''
   * ''automake''   * ''automake''
-  * ''gcc4'' +  * ''gcc-core'' 
-  * ''gcc4-g++''+  * ''gcc-g%%++%%''
   * ''git''   * ''git''
 +  * ''imake''
   * ''libX11-devel''   * ''libX11-devel''
   * ''libjpeg-devel''   * ''libjpeg-devel''
 +  * ''libpng15-devel'' (X2Go Client 4.0.3.x)
 +  * ''libpng-devel'' (X2Go Client 4.0.4.x+)
   * ''libmpfr4''   * ''libmpfr4''
 +  * ''libtool'' (nx-libs 3.6)
   * ''make''   * ''make''
-  * ''mc'' 
   * ''zlib-devel''   * ''zlib-devel''
   * ''wget''   * ''wget''
  
-==== Installing libpng ====+<note tip>By installing the ''libjpeg-devel'' package, you are now installing [[https://cygwin.com/ml/cygwin-announce/2014-06/msg00004.html|libjpeg-turbo]] instead of IJG libjpeg. The same applies for the dependency ''libjpeg8'' package, which provides the cygjpeg-8.dll file that you will copy later.</note>
  
-You will need a libpng12 to build nxproxy. This version of libpng is not available on current version of cygwin. You should install it manually.+For building of OpenSSH Server, you will also need
 +  * ''libedit-devel'' 
 +  * ''libncurses-devel'' 
 +  * ''openssl-devel'' 
 +  * ''patch''
  
-  * Open a cygwin shell. Go to the src directory+For OpenSSH you should install both, binary and source packages. Toggle the "Src" checkbox beside the package name. Source package will be installed in ''/usr/src'' directory in your Cygwin installation. 
 + 
 +If you are updating the X2Go Windows build VM, X2Go-WinBuilder, install these packages too: 
 +  * ''bashdb'' 
 +  * ''bash-completion'' 
 +  * ''chere'' 
 +  * ''colorgcc'' 
 +  * ''colordiff'' 
 +  * ''diffutils'' 
 +  * ''dos2unix'' 
 +  * ''cygcheck-dep'' 
 +  * ''cygutils-extra'' 
 +  * ''indent'' 
 +  * ''mc'' 
 +  * ''renameutils'' 
 +  * ''vim'' 
 +  * ''git-completion'' 
 +  * ''patch'' 
 +  * ''patchutils'' 
 +  * ''openssh'' 
 +  * ''xz'' 
 +  * ''unzip'' 
 +  * ''nano'' 
 +  * ''bzip2'' 
 +  * ''time'' 
 +  * ''mkfontdir'' 
 +  * ''mkfontscale'' 
 + 
 +If you are doing official builds, install these **source** packages for both nxproxy and openssh: 
 +  * ''dash'' 
 +  * ''cygwin'' 
 +  * ''gcc'' (select source for: ''gcc-core''
 +  * ''libedit'' (select source for: ''libedit0''
 +  * ''libjpeg-turbo'' (select source for: ''libjpeg-devel''
 +  * ''libpng15'' (select source for: ''libpng-devel'') (X2Go Client 4.0.3.x) 
 +  * ''libpng'' (select source for: ''libpng-devel'') (X2Go Client 4.0.4.x+) 
 +  * ''ncurses'' (select source for: ''libncurses-devel''
 +  * ''openssh'' (source, but not binary) 
 +  * ''openssl'' 
 +  * ''zlib'' (select source for: ''zlib-devel''
 + 
 +==== Building nxproxy 3.5 ==== 
 + 
 +X2Go Client for Windows is currently built with nxproxy 3.5. 
 + 
 +  * Open a cygwin shell and change to your build directory. In this example ''D:\Build'' will be used
 <code> <code>
-$ cd /usr/src+$ cd /cygdrive/d/Build
 </code> </code>
-  * Get a libpng12 from project site+  * Download and extract the latest nx-libs-lite tarball from [[http://code.x2go.org/releases/source/nx-libs/]]. Regular nx-libs sources will also work. 
 + 
 +<note warning>Do not download and use the sources from git. Unlike the tarball, the git sources do not have the X2Go project's patches (debian/patches/) applied. (Technically, you could use the sources from git and apply the patches manually.)</note>
 <code> <code>
-$ wget http://downloads.sourceforge.net/project/libpng/libpng12/1.2.50/libpng-1.2.50.tar.gz +$ wget http://code.x2go.org/releases/source/nx-libs/nx-libs-3.5.0.27-lite.tar.gz 
-$ tar -xzvf libpng-1.2.50.tar.gz +$ tar -xvzf nx-libs-3.5.0.27-lite.tar.gz 
-$ cd libpng-1.2.50+$ cd nx-libs-3.5.0.27
 </code> </code>
-  * Build and install libpng+ 
 +Fix building with libpng15 (X2Go Client 4.0.3.x):
 <code> <code>
-./configure --prefix=/usr+diff --git a/Pgn.cpp.orig b/Pgn.cpp 
-$ make && make install +index cdcde84..1f56787 100644 
-</code>+--- a/nxcomp/Pgn.cpp.orig 
 ++++ b/nxcomp/Pgn.cpp 
 +@@ -28,7 +28,7 @@ 
 + #endif 
 + #include <unistd.h> 
 + #include <stdio.h> 
 +-#include <png.h> 
 ++#include <libpng15/png.h>
  
-==== Building nxproxy ====+ #include "Unpack.h" 
 + #include "Pgn.h"
  
-  * Open a cygwin shell and change to your build directory. In this example d:\Build will be used+</code>
 <code> <code>
-$ cd /cygdrive/d/Build+diff --git a/configure.in.orig b/configure.in 
 +index 6fa9757..b0699bb 100644 
 +--- a/nxcomp/configure.in.orig 
 ++++ b/nxcomp/configure.in 
 +@@ -385,7 +385,7 @@ AC_SUBST(ALL) 
 + 
 + if test "$CYGWIN32" = yes; then 
 +     ALL="\$(LIBCYGARCHIVE) \$(LIBCYGSHARED) \$(LIBARCHIVE)" 
 +-    LIBS="-lstdc++ -lpng -ljpeg -lz" 
 ++    LIBS="-lstdc++ -lpng15 -ljpeg -lz" 
 + else 
 +     ALL="\$(LIBFULL) \$(LIBLOAD) \$(LIBSHARED) \$(LIBARCHIVE)" 
 + fi 
 </code> </code>
-  * Get nx-libs sources from http://git.x2go.org 
 <code> <code>
-git clone git://code.x2go.org/nx-libs.git +diff --git a/nxproxy/configure.in.orig b/nxproxy/configure.in 
-cd nx-libs+index b86828d..5858b36 100644 
 +--- a/nxproxy/configure.in.orig 
 ++++ b/nxproxy/configure.in 
 +@@ -159,7 +159,7 @@ dnl GCC 3.3.x requires also the z, png and jpeg libraries. This is 
 + dnl not true anymore since GCC 3.4.x. 
 + 
 + if test "$CYGWIN32" = yes; then 
 +   LIBS="$LIBS -L../nxcomp -lXcomp -lstdc++ -Wl,-e,_mainCRTStartup -ljpeg -lpng -lz" 
 ++    LIBS="$LIBS -L../nxcomp -lXcomp -lstdc++ -Wl,-e,_mainCRTStartup -ljpeg -lpng15 -lz" 
 + else 
 +     LIBS="$LIBS -L../nxcomp -lXcomp" 
 + fi 
 </code> </code>
   * Build nxcomp   * Build nxcomp
Line 242: Line 471:
 $ ./configure $ ./configure
 $ make $ make
 +$ cp -p nxproxy.exe nxproxy.exe.unstripped
 $ strip nxproxy.exe $ strip nxproxy.exe
 $ cd .. $ cd ..
 </code> </code>
  
 +==== Building nxproxy 3.6 ====
  
-==== Copying the nxproxy binaries ====+<note tip>X2Go Client for Windows is currently shipped with nxproxy 3.5, not 3.6. However, it should be safe to use 3.6.</note> 
 +<note important>nxproxy 3.6 currently has one additional build dependency that 3.5 does not have. See the Cygwin installation instructions above.</note>
  
-Now the nxproxy binary (nxproxy.exe) is readyYou can copy it into the programme packaging folder (''dist/'') of X2Go ClientTo be able to run nxproxy you must also copy required libraries into the ''dist/'' folder:+  * Open a Cygwin shell and change to your build directory. In this example ''D:\Build'' will be used 
 +<code> 
 +$ cd /cygdrive/d/Build 
 +</code> 
 +  * Download [[nx-libs from Arctica on GitHub|https://github.com/ArcticaProject/nx-libs]] and checkout the 3.6.x branch. 
 +<code> 
 +git clone https://github.com/ArcticaProject/nx-libs.git 
 +cd nx-libs 
 +git checkout 3.6.x 
 +</code> 
 +  * Build nxcomp 
 +<code> 
 +$ cd nxcomp 
 +$ autoreconf -vfi 
 +$ ./configure 
 +$ make 
 +$ cd .. 
 +</code> 
 +  * Build nxproxy 
 +<code> 
 +$ cd nxproxy 
 +$ autreoconf -vfi 
 +./configure 
 +$ make 
 +$ cp -p src/nxproxy.exe src/nxproxy.exe.unstripped 
 +$ strip src/nxproxy.exe 
 +$ cd .. 
 +</code>
  
-  - From nxcomp directory (d:\Build\nx-libs\nxcomp) - ''cygXcomp.dll'' 
  
-  - From cygwin directory (c:\cygwin\bin):+==== Copying the nxproxy binaries ==== 
 + 
 +Now the nxproxy binary (nxproxy.exe) is ready. You can copy it into the program packaging folder (''dist/'' or ''nsis/x2goclient/'') of X2Go Client, or the x2goclient-contrib folder: 
 +  - nx-libs 3.5: From ''nxproxy'' directory (''D:\Build\nx-libs\nxproxy'') - ''nxproxy.exe'' 
 +  - nx-libs 3.5: From ''nxcomp'' directory (''D:\Build\nx-libs\nxcomp'') - ''cygXcomp.dll'' 
 +  - nx-libs 3.6: From ''nxproxy\src\.libs'' directory (''D:\Build\nx-libs\nxproxy\src\.libs'') - ''nxproxy.exe'' 
 +  - nx-libs 3.6: From ''nxcomp\src\.libs'' directory (''D:\Build\nx-libs\nxcomp\src\.libs'') - ''cygXcomp-3.dll'' 
 + 
 +You must also copy required libraries into that folder. 
 +  - From cygwin directory (''C:\cygwin\bin''):
     * ''cyggcc_s-1.dll''     * ''cyggcc_s-1.dll''
     * ''cygjpeg-8.dll''     * ''cygjpeg-8.dll''
-    * ''cygpng-3.dll'' +    * ''cygpng15-15.dll'' (x2goclient 4.0.3.x) 
-    * ''cygstdc\+\+-6.dll''+    * ''cygpng16-16.dll'' (x2goclient 4.0.4.x+) 
 +    * ''cygstdc%%++%%-6.dll''
     * ''cygwin1.dll''     * ''cygwin1.dll''
     * ''cygz.dll''     * ''cygz.dll''
  
-===== Open SSH Server ===== 
  
-X2Go Client for Windows using modified Cygwin Open SSH Server for file sharingYou can download it [[http://code.x2go.org/releases/binary-win32/3rd-party/openssh-server|here]]+If you wish to facilitate debugging, or if you are updating x2goclient-contrib, you should copy these files over also: 
 +  - nx-libs 3.5From ''nxproxy'' directory (''D:\Build\nx-libs\nxproxy'') - ''nxproxy.exe.unstripped'' 
 +  nx-libs 3.5: From ''nxcomp'' directory (''D:\Build\nx-libs\nxcomp''): 
 +    * ''libXcomp.dll.a'' 
 +    * ''libXcomp.a'' 
 +  - nx-libs 3.6: From ''nxproxy\src'' directory (''D:\Build\nx-libs\nxproxy\src'') - ''nxproxy.exe.unstripped'' 
 +  - nx-libs 3.6: From ''nxcomp\src\.libs'' directory (''D:\Build\nx-libs\nxcomp\src\.libs''): 
 +    * ''libXcomp.dll.a'' 
 +    * ''libXcomp.a''
  
-If you want to build it from source, you should [[wiki:development:build-howto-mswin:x2goclient/#installing_cygwin|install Cygwin]] first. 
  
-After that run Cygwin installer (setup.exe), navigate to "Select Packages" page and install additional packages, you need to build Open SSH Server+==== Building OpenSSH Server ====
-  *libedit +
-  *libedit-devel +
-  *libkrb5-devel +
-  *libncurses-devel +
-  *openssl-devel +
-  *libwrap-devel +
-  *patch+
  
-For openssh you should install both, binary and source packages (toggle "Src" checkbox beside of package name). Source package will be installed in /usr/src directory in your Cygwin installation.+Copy the source folder (downloaded and extracted from a tarball by Cygwinto your build directoryIn this example ''D:\Build'' will be used 
 +<code> 
 +$ cp -pr /usr/src/openssh-6.1.1p1-3-src /cygdrive/d/Build/ 
 +</code>
  
-Copy openssh tarball to your build directory. In this example d:\Build will be used+''cd'' to the openssh source directory, extract the upstream (openssh.com) tarball within, and ''cd'' to the lower-level source directory
 <code> <code>
-$cp /usr/src/openssh-6.1p1.tar.gz /cygdrive/d/Build/+cd /cygdrive/d/Build/openssh-6.6.1p1-3 
 +$ tar -xzvf openssh-6.6p1.tar.gz 
 +$ cd openssh-6.6p1
 </code> </code>
  
-Extract sources and change to openssh source directory+Apply any patches that Cygwin provides. For example, with 6.6p1-3:
 <code> <code>
-$cd /cygdrive/d/Build/ +patch < ../curve25519-sha256.patch
-$tar -xzvf openssh-6.1p1.tar.gz +
-$cd openssh-6.1p1+
 </code> </code>
  
-Get and apply patch, which allow use Open SSH Server with X2Go Client+Get and apply the X2Go patch, which enables use of the Open SSH Server with X2Go Client
 <code> <code>
-$wget http://code.x2go.org/releases/source/openssh-cygwin/openssh-6.0p1-2.x2go.patch +$ wget http://code.x2go.org/releases/source/openssh-cygwin/openssh-6.6p1-1.x2go.patch ../ 
-$patch.exe < openssh-6.0p1-2.x2go.patch+$ patch.exe < ../openssh-6.6p1-1.x2go.patch
 </code> </code>
  
 Build Open SSH Server Build Open SSH Server
 <code> <code>
-$./configure --libexecdir=/usr/sbin --with-kerberos5=/usr --with-tcp-wrappers --with-libedit --with-xauth=/usr/bin/xauth --build=mingw32 +$ ./configure --libexecdir=/usr/sbin --with-libedit --with-xauth=/usr/bin/xauth --build=mingw32 
-$make +$ make 
-$strip *.exe+$ strip *.exe
 </code> </code>
  
-Open SSH Server binaries are ready. Now you can copy them in to the installation directory of x2goclient:+<note>If doing an official X2Go Client for Windows build, copy over the text from the "configure" output beginning with "OpenSSH has been configured with the following options:" to "openssh build options.txt." Then, put that .txt file in the same folder with the OpenSSH binaries later on.</note>
  
-  *sftp.exe +<note>If doing an official X2Go Client for Windows build, create a file "openssh version.txt" with contents like "6.6p1-3-x2go1", where "6.6p1-3" is the version string from Cygwin, and "x2go1" denotes that this is the 1st version off of it modified by X2Go.</note>
-  *sftp-server.exe +
-  *ssh-keygen.exe +
-  *sshd.exe+
  
 +<note>The command above is based on the command that Cygwin uses for their official builds, but with certain changes in order to eliminate unnecessary dependencies. Eliminating unnecessary dependencies decreases how frequently X2Go Client for Windows needs to be rebuilt in order to include security patches for those dependencies.</note>
  
-To be able to run Open SSH Server you should also copy needed programs and libraries from cygwin directory (c:\cygwin\bin): 
-  *sh.exe 
-  *cygasn1-8.dll 
-  *cygcom_err-2.dll 
-  *cygcrypt-0.dll 
-  *cygcrypto-1.0.0.dll 
-  *cygedit-0.dll 
-  *cyggcc_s-1.dll 
-  *cyggssapi-3.dll 
-  *cygheimbase-1.dll 
-  *cygheimntlm-0.dll 
-  *cyghx509-5.dll 
-  *cygiconv-2.dll 
-  *cygintl-8.dll 
-  *cygkafs-0.dll 
-  *cygkrb5-26.dll 
-  *cygncursesw-10.dll 
-  *cygreadline7.dll 
-  *cygroken-18.dll 
-  *cygsqlite3-0.dll 
-  *cygssp-0.dll 
-  *cygwin1.dll 
-  *cygwind-0.dll 
-  *cygwrap-0.dll 
-  *cygz.dll 
  
-Some of this libraries are also used by nxproxy. Open SSH Server and nxproxy should be built using same version of Cygwin.+==== Copying OpenSSH Server binaries ====
  
-===== PulseAudio =====+Open SSH Server binaries are ready. You can copy it into the program packaging folder (''dist/'' or ''nsis/x2goclient/'') of X2Go Client, or the x2goclient-contrib folder: 
 +  * ''sftp.exe'' 
 +  * ''sftp-server.exe'' 
 +  * ''ssh-keygen.exe'' 
 +  * ''sshd.exe''
  
-you can download PulseAudio for Windows [[http://code.x2go.org/releases/binary-win32/3rd-party/pulse|here]] or from [[http://www.freedesktop.org/wiki/Software/PulseAudio/Ports/Windows/Support|project site]]. Building PulseAudio from source is not the part of this Howto+For example: 
 +<code
 +$ cp --preserve=time sftp.exe sftp-server.exe ssh-keygen.exe sshd.exe /cygdrive/d/x2goclient-contrib/cygwin/20160121-1_bin/ 
 +</code>
  
-===== VcXsrv =====+To be able to run Open SSH Server you should also copy needed programs and libraries from the Cygwin directory (c:\cygwin\bin).
  
-you can download VcXsrv for Windows [[http://code.x2go.org/releases/binary-win32/3rd-party/vcxsrv|here]] or from [[http://sourceforge.net/projects/vcxsrv/|project site]]Building VcXsrv from source is not the part of this Howto+First, copy these files over without changing their filenames. 
 +  * ''cygcrypto-1.0.0.dll'' 
 +  * ''cygedit-0.dll'' 
 +  * ''cyggcc_s-1.dll'' 
 +  * ''cygncursesw-10.dll'' 
 +  * ''cygssp-0.dll'' 
 +  * ''cygwin1.dll'' 
 +  * ''cygz.dll''
  
-===== PuTTY =====+For example: 
 +<code> 
 +$ cd /bin 
 +$ cp --preserve=time cygcrypto-1.0.0.dll cygedit-0.dll cyggcc_s-1.dll cygncursesw-10.dll cygssp-0.dll cygwin1.dll cygz.dll /cygdrive/d/x2goclient-contrib/cygwin/20160121-1_bin/ 
 +</code>
  
-you can download PuTTY for Windows from [[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html|project site]]. Building PuTTY from source is not the part of this Howto+Then, copy the dash executable over and rename it: 
 +<code> 
 +ash.exe -> sh.exe 
 +</code>
  
-These are the only binaries you need from PuTTYCopy them directly into the ''dist/'' folder.+For example: 
 +<code> 
 +$ cp --preserve=time ash.exe /cygdrive/d/x2goclient-contrib/cygwin/20160121-1_bin/sh.exe 
 +</code>
  
-  *plink.exe +Some of these libraries are also used by nxproxy. Open SSH Server and nxproxy should be built using same version of Cygwin. 
-  *pscp.exe+ 
 +<note>This section needs to be updated for the .csv file that lists Cygwin packages and versions, and for the zip files on http://code.x2go.org/releases/ that contain pre-built binaries.</note> 
 + 
 +===== Copying 3rd-party libraries and components ===== 
 + 
 +==== Overview ==== 
 + 
 +To make X2Go Client usable on Windows, all libraries and components must be in the some directory as where the 2 binaries are. 
 + 
 +All of the files referenced below (except for the OpenSSL-Win32 library, which you installed previously) can be obtained from [[http://code.x2go.org/gitweb?p=x2goclient-contrib.git;a=summary|x2goclient-contrib.git]] on http://code.x2go.org 
 + 
 +In the previous step, you chose either the ''dist'' or ''nsis/x2goclient'' folder. To this folder you have to add the following components: 
 + 
 +  * libraries 
 +  * nxproxy with libraries 
 +  * Open SSH Server with libraries (optional) 
 +  * PuTTY 
 +  * VcXsrv 
 +  * PulseAudio (optional) 
 + 
 +==== Scripted Copying ==== 
 + 
 +You can then install all of them by using the ''copy-deps-win32.bat'' script in the x2goclient source folder. 
 + 
 +First, clone [[http://code.x2go.org/gitweb?p=x2goclient-contrib.git;a=summary|x2goclient-contrib.git]] on http://code.x2go.org if you haven't already done so. 
 + 
 +Now run the script with the following arguments. In this example: 
 +  * ''..\x2goclient-contrib'' is the path to the x2goclient-contrib git repo 
 +  * ''D:\OpenSSL-Win32\'' is the path to OpenSSL-Win32's installation folder (not the exact folder with the DLL's) 
 +  * ''dist'' is the subfolder you wish to run x2goclient from 
 +<code> 
 +$ cd x2goclient 
 +$ copy-deps-win32.bat ..\x2goclient-contrib D:\OpenSSL-Win32 dist 
 +</code> 
 +or to the ''nsis/x2goclient'' folder 
 +<code> 
 +$ cd x2goclient 
 +$ copy-deps-win32.bat nsis\x2goclient 
 +</code> 
 + 
 +==== Scripted Copying (debug builds) ==== 
 + 
 +Follow the instructions for Scripted Copying. 
 + 
 +However, at the end: 
 + 
 +  - View the ''copy-deps-win32.bat'' file to determine the location of the Cygwin bundle. 
 +  - From the Cygwin bundle, ''copy nxproxy.exe.unstripped'' to the ''dist'' or ''release/x2goclient'' folder. 
 +  - Replace nxproxy.exe with nxproxy.exe.unstripped 
 + 
 +==== Manual Copying ==== 
 + 
 +=== Libraries === 
 + 
 +  - Add MinGW 4.8's libraries (copy from ''D:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\bin''). 
 +    * ''libgcc_s_dw2-1.dll'' 
 +    * ''libstdc%%++%%-6.dll'' 
 +    * ''libwinpthread-1.dll'' 
 +  - Add OpenSSL libraries (copy from your OpenSSL installation directory) 
 +    * ''libeay32.dll'' 
 +    * ''ssleay32.dll'' 
 +  - libssh library ([[wiki:development:build-howto-mswin:x2goclient#installing_libssh|see above section for download link]]) 
 +    * ''libssh.dll'' 
 +  - zlib library for libssh (available [[http://code.x2go.org/releases/binary-win32/3rd-party/zlib/|here on our site]]) (binaries originally from [[http://www.zlib.net/ | the zlib project]] site) 
 +    * ''zlib1.dll'' 
 +  - If you want to use X2Go Client on older versions of Windows, you should put the "Microsoft Visual C%%++%% Redistributable 2013 Package"'s dll files into your X2Go Client package directory. (Originally downloaded from the [[http://www.microsoft.com/en-us/download/details.aspx?id=29|Microsoft download site]]). 
 +    * ''msvcp120.dll'' 
 +    * ''msvcr120.dll.dll'' 
 +    * ''vccorlib120.dll'' 
 + 
 + 
 +=== nxproxy === 
 + 
 +The latest version is available in [[http://code.x2go.org/gitweb?p=x2goclient-contrib.git;a=tree;hb=HEAD|x2goclient-contrib.git]] under the ''cygwin'' folder. This includes its libraries. 
 + 
 +You can download older versions, including their libraries, from here [[http://code.x2go.org/releases/binary-win32/3rd-party/nxproxy|here]]. 
 + 
 +=== nxproxy (debug builds)=== 
 + 
 +Follow the instructions above for nxproxy. 
 + 
 +Except at the end, replace nxproxy.exe with nxproxy.exe.unstripped. 
 + 
 +Older builds do not have nxproxy.exe.unstripped; that is a limitation of X2Go's old build process. 
 + 
 +=== OpenSSH Server === 
 + 
 +X2Go Client for Windows uses a modified Cygwin OpenSSH Server for file sharing. 
 + 
 +The latest version is available in [[http://code.x2go.org/gitweb?p=x2goclient-contrib.git;a=tree;hb=HEAD|x2goclient-contrib.git]] under the ''cygwin'' folder. 
 + 
 +You can download older versions from [[http://code.x2go.org/releases/binary-win32/3rd-party/openssh-server|here]]. 
 + 
 +=== PulseAudio === 
 + 
 +PulseAudio for Windows 6.0 is used by X2Go Client 4.0.4.x and it is available in [[http://code.x2go.org/gitweb?p=x2goclient-contrib.git;a=tree;hb=HEAD|x2goclient-contrib.git]] under the pulse folder. 
 + 
 +PulseAudio for Windows 5.0 is used by X2Go Client 4.0.3.x and it is available in [[http://code.x2go.org/gitweb?p=x2goclient-contrib.git;a=tree;hb=HEAD|x2goclient-contrib.git]] under the pulse folder. 
 + 
 +You can download older Windows builds here [[http://code.x2go.org/releases/binary-win32/3rd-party/pulse|here]]. 
 + 
 +Note that the files must be installed to the ''pulse'' subfolder of ''dist'' or ''nsis/x2goclient''
 + 
 +Even older Windows builds are available from [[http://www.freedesktop.org/wiki/Software/PulseAudio/Ports/Windows/Support|the PulseAudio project site]] and the above link. 
 + 
 +=== VcXsrv - XP Compatible === 
 + 
 +The latest version is available in [[http://code.x2go.org/gitweb?p=x2goclient-contrib.git;a=tree;hb=HEAD|x2goclient-contrib.git]] under the VcXsrv folder. 
 + 
 +You can download older versions, modified by the X2Go project, (VcXsrv - XP Compatible), here: [[http://code.x2go.org/releases/binary-win32/3rd-party/vcxsrv-modified-by-x2go-project/]]. 
 + 
 +Note that the files must be installed to the ''VcXsrv'' subfolder of ''dist'' or ''nsis/x2goclient''
 + 
 +Building VcXsrv from source is not the part of this howto. However, it is documented in the [[https://sourceforge.net/u/mikedep333/vcxsrv/ci/xp-latestmsvc2013-x2gochanges/tree/|source repo]]. 
 + 
 +All official X2Go Project builds use the 32-bit builds of VcXsrv. 64-bit builds are probably compatible with the 32-bit X2Go Client, but have not been tested. Furthermore, the XP compatible builds are only offered in 32-bit. 
 + 
 +If you do install VcXsrv via the setup installer, and you are building X2Go Client 4.0.3.x or later, select to install the fonts. They will be an optional component of X2Go Client for Windows in its installer. 
 + 
 +If you do install VcXsrv via the setup installer, and you are building X2Go Client 4.0.2.1, deselect to install the fonts. They would more than double the size of the X2Go NSIS installer. Some legacy apps do need them, and users can install them if they'd like. 
 + 
 +Also, if you are doing an official X2Go Project build, remove these files that X2Go Client does not need and would take up extra space: 
 +  * ''iconv.dll'' 
 +  * ''libiconv-2.dll'' 
 +  * ''libgcc-s-sjlj-1.dll'' 
 +  * ''libwinpthread-1.dll'' 
 +  * ''libxml2.dll'' 
 +  * ''libxml2-2.dll'' 
 +  ''plink.exe'' 
 +  * ''uninstall.exe'' 
 +  * ''xauth.exe'' 
 +  * ''XCalc'' 
 +  * ''xcalc.exe'' 
 +  * ''XCalc-color'' 
 +  * ''XClock'' 
 +  * ''xclock.exe'' 
 +  * ''XClock-color'' 
 +  * ''xhost.exe'' 
 +  * ''xlaunch.exe'' 
 +  * ''xrdb.exe'' 
 +  * ''xwininfo.exe'' 
 + 
 +Also, if you are doing an official X2Go Project build, before importing it into x2goclient-contrib, remove the timestamps from the ''.gz'' files. 
 +Using Debian's strip-nondeterminism (a perl script that calls a perl library, both of which can be extracted from their deb's & run fine under Cygwin): 
 +<code> 
 +$ cd /cygdrive/c/x2gobuilds/x2goclient-contrib/VcXsrv/1.20.1.4_bin/fonts 
 +$ find . -iname '*.gz' -exec strip-nondeterminism '{}' ';' 
 +</code> 
 +If you are doing an official X2Go Project build, create this file in the VcXsrv folder: 
 +  * ''vcxsrv-version.txt'' 
 +And specify the version string of VcXsrv in it. The version string should be the only content of that file. For example: 
 + 
 +1.15.2.3+xp-vc2013+x2go1 
 + 
 +If you are doing an official X2Go Project build, copy the project's [[https://sourceforge.net/p/vcxsrv/code/ci/master/tree/COPYING|COPYING]] file as: 
 +  * ''COPYING.txt'' 
 + 
 +=== x3270-fonts ==== 
 + 
 +For IBM x3270 compatibility, a special set of fonts is necessary. Official builds use the version shipped in the ''x3270-fonts'' subdirectory of x2goclient-contrib. 
 + 
 +Note that versions prior to 3.6 are classified non-free by major distributions due to their custom, restrictive license. Do **not** use and (re-)distribute older versions than 3.6 with X2Go Client. 
 + 
 +==== Updating x3270 Fonts Package ==== 
 + 
 +  * Check the current licensing situation. Do **not** update the package if it becomes non-free again. 
 +  * Build the x3270 package, download a complete precompiled one or just fetch a binary fonts package. Debian conveniently offers one named [[https://packages.debian.org/sid/xfonts-x3270-misc|xfonts-x3270-misc]]. 
 +  * Create a new versioned subdirectory in the ''x3270-fonts'' directory. 
 +  * Extract the binary fonts. 
 +  * Make sure that all binary font files are located in one single directory called ''misc''
 +  * Get copyright and licensing information and place them into a file called ''copyright-x3270-fonts''. Debian's copyright file is very well suited for this, but please remove content that is not relevant to the fonts themselves. 
 +  * Use Debian's ''strip-nondeterminism'' script: 
 +<code> 
 +$ find misc -iname '*.gz' -exec strip-nondeterminism '{}' ';' 
 +</code> 
 +  * For official builds, create timestamps script: 
 +<code> 
 +$ cd .. 
 +$ ../generate-timestamps-on-folder.sh <new-versions-directory> 
 +</code> 
 +  * For official builds, call the timestamps script in x2goclient-contrib's top-directory script called ''current-timestamp-scripts.sh''
 +  * For official builds, update the [[https://code.x2go.org/gitweb?p=x2goclient.git;a=blob;f=copy-deps-win32.bat;hb=HEAD|copy-deps-win32.bat in x2goclient.git]] copying step to use the new directory. 
 + 
 +=== PuTTY === 
 + 
 +You can download PuTTY for Windows from [[https://www.chiark.greenend.org.uk/~sgtatham/putty/download.html|project site]]. Building PuTTY from source is not the part of this howto. 
 + 
 +These are the only binaries you need from PuTTY. Copy them directly into the ''dist/'' or ''nsis/x2goclient'' folder. 
 + 
 +  * ''plink.exe'' 
 +  * ''pscp.exe'' 
 + 
 +Out of courtesy, we also ship the following additional, not strictly needed binaries: 
 + 
 +  * ''pageant.exe'' 
 +  * ''puttygen.exe'' 
 + 
 + 
 +===== Creating an NSIS Installer ===== 
 + 
 +Install NSIS (currently, 3.05): https://nsis.sourceforge.io 
 + 
 +Previously, we used NSIS Unicode, but this project is stale and NSIS 3.x nowadays supports Unicode. 
 + 
 +Then, edit ''nsis/x2goclient.nsi'' and replace all instances of ''X2GOCLIENT_VERSION'' with the actual version, and any string at the end. For example, if you were doing a test build of fixing bug 123 on top of 4.0.3.2, use ''4.0.3.2-bug123'' as the version string. 
 + 
 +Then, open ''nsis\x2goclient.nsi'' with NSIS. It will build an installer (''*-setup.exe'') and put it into the same directory. 
 + 
 +If you wish to build via the command-line, run: 
 +<code> 
 +$ "C:\Program Files (x86)\NSIS\makensis.exe" x2goclient.nsi 
 +</code> 
 +(Adjust path if on 32-bit Windows.)
wiki/development/build-howto-mswin/x2goclient.1389878911.txt.gz · Last modified: 2014/01/16 13:28 by mikedep333