WindowsTesting

Differences between revisions 1 and 14 (spanning 13 versions)
Revision 1 as of 2010-07-23 14:05:12
Size: 13221
Editor: 223
Comment: Added documentation of how to start the windows installer testing.
Revision 14 as of 2011-07-01 19:43:04
Size: 9994
Editor: host135
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= UbuntuOne Windows Testing = ## page was renamed from UbuntuOne/WindowsTesting
## page was renamed from UbuntuOne/Tutorials/WindowsTesting
The following details what's needed to test the Ubuntu One file sync client under windows.
Line 3: Line 5:
The following details what's needed to test the window UbuntuOne installer and builds under windows. = Dependencies =
Line 5: Line 7:
== Dependencies == A Windows machine or VM is needed. For now, we support Windows 7 and XP.
Line 7: Line 9:
 * A Windows machine or VM
 * Download and install VS Express 2008 C# from http://www.microsoft.com/express/Downloads/#2008-Visual-CS
 * The Ubuntu One Windows Installer code from [[https://edge.launchpad.net/ubuntuone-windows-installer|Launchpad]]
== Bazaar ==
Line 11: Line 11:
== Building == Download and install bazaar from: http://wiki.bazaar.canonical.com/WindowsDownloads. Choose the "standalone" installer.
Line 13: Line 13:
In order to simplify the build process of the project and automate it as much as possible Nant has been used to create the build script. The fact that Nant is used adds a number of features that make the automation easier: === SSH key (not needed if only branching stuff) ===
Line 15: Line 15:
=== Tasks === If you need to setup your ssh key (only if you need to submit branches from this platform), there is a nice wiki page from launchpad that explains how to set up bzr on windows as well as the ssh keys in order to easily work with launchdpad. The wiki can be found [[https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair|here]].
Line 17: Line 17:
Tasks in Nant can be seen as ''operations'' that can be performed with Nant using the projects contents. Each tasks performs an operation on the source code and can depend on other tasks that have been defined in the build script. === Bazaar UIs ===
Line 19: Line 19:
The following is a list of the different tasks that are currently defined in the project and a small description. Tortoisebzr can be used so that the different status icons are shown in the you code files during development but there is an important fact to know. Those icons, known as IconOverlays, are limited on Windows. That is, only 15 different icons can be installed in your system. If you have any other tortoise software you might have reached that limit which means that those icons wont be shown. To know which IconOverlays have been installed in your system you can open regedit and look at '''HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers''' which contains a list of the overlays already installed in you system.
Line 21: Line 21:
 * '''bootstrapper''': Creates a bootstrapper that will allow to install in the users machine the Ubuntu One solution plus a number of useful applications (Tomboy + !GtkSharp)
 * '''build''': Compiles the different projects that are part of the solution. This task depends on '''clean''' and '''build_protos'''.
 * '''clean''': Removes the different results from the last compilation/task .
 * '''generate_protos''': Generates part of the C# code of the solution that depends on the protobuffer definitions found in the proto dir.
 * '''installer''': Compiles the application using the '''build''' task, runs the unit tests usint the '''tests''' task and creates a msi installer that can be used to install Ubuntu One in the users machine (do not confuse with the bootstrapper, it only installes Ubuntu One)
 * '''tests''': Compiles the solution using the '''build''' task and runs the different unit tests. The output of the tests can be found in the test-results dir.
== VisualStudio 2008 ==
Line 28: Line 23:
Nant provides a way to list all the available tasks in a project by executing the following: Some of the python packages that are required (pykeyring is one of them) required your system to have VS2008 installed. It is very important that you install this specific version of VS and no later since the setup.py of the packages will be looking for that version and no other.
Line 30: Line 25:
{{{
tools\Nant\bin\nant.exe -projecthelp
There is no need to install the payed version of VS2008, you can use the express C++ version from [[http://www.microsoft.com/express/Downloads/#2008-Visual-CS|here]] (look at the far right tab).
Line 33: Line 27:
NAnt 0.90 (Build 0.90.3780.0; release; 08/05/2010)
Copyright (C) 2001-2010 Gerry Shaw
http://nant.sourceforge.net
=== Important note ===
Line 37: Line 29:
After installing VS2008 Express, to make sure that all environment variables are set, either reboot or use the command prompt found here: "Start Menu\Programs\Microsoft Visual C++ 2008 Express Edition\Visual Studio Tools\Visual Studio 2008 Command Prompt" as your regular command prompt.
Line 38: Line 31:
Default Target: == Python ==
Line 40: Line 33:
installer Compiles the solution and create a merge installer that allows to install the solution and other related apps. The Windows port at the moment is targeting Python 2.7. You can find the a correct version of python for your system in the python [[http://python.org/download/|download page]].
Line 42: Line 35:
Main Targets: Be sure to have your python.exe in your PATH environment variable.
Line 44: Line 37:
bootstrapper Creates a bootstrapper that will allow to install Ubuntu One, Tomboy and Gtk Sharp in the users machine.
build Compiles all the different projects that form part of the solution.
clean Removes all the different results of the last comilation if
they exist
generate_protos Generates the code that is used to talk with the python process using protobuffer.
installer Compiles the solution and create a merge installer that allows to install the solution and other related apps.
tests Runs the unit tests of the project.
To make the rest of the dependency installation easier, please do install setuptools from [[http://pypi.python.org/pypi/setuptools|here]]. While easy_install will be able to install most of the needed packages, some of them won't and an explanation of how to install them will be provided.

=== 32 or 64 bits? ===

At the moment there is no preference between using python for x86 or x64 machines since tests should pass on both runtimes. Nevertheless some of the dependencies that the project has have to be installed using an msi that has been generated in a x86 machine. If you are using the x64 version of python you might find that a number of msi state that the installation of python could not be found. There reason for this is that because the installer was compiled in a x32 machine and your os is a x64 version the msi will be looking for the python data in the WoW64 (Windows 32-bit On Windows 64-bit) subsystem which has its information stored in the '''HKEY_LOCAL_MACHINE\Software\Wow6432Node''' in the path which is the equivalent to '''HKEY_LOCAL_MACHINE\Software''' in a x86 machine. In order to work around this issue you simple have to copy the exact same information that python added to your registry to the WoW64 registry path so that when the msi looks for it it will find it.

== pywin32 ==

Download from [[http://sourceforge.net/projects/pywin32/files/pywin32/Build216/|here]]. Be sure to always choose python 2.7.

At the time of this writing, there is a [[https://sourceforge.net/tracker/index.php?func=detail&aid=3323058&group_id=78018&atid=551954#)|bug]] in the pywin32 package where the non-utf8 functions GetFileSecurity and SetFileSecurity are used. This bug has been reported to upstream. If this bug is not fixed in upstream by the time you read this, you will need to patch pywin32, otherwise the operations that are performed on utf-8 paths will raise the winerror "23".

You can patch your installation by either downloading this [[http://ubuntuone.com/p/10qw/|zip]] and overwriting the contents of the win32 folder (inside site-packages from your Python installation), or applying the patch located at the bottom of this wiki page and recompile pywin32.

== Twisted ==

Download the .msi from [[http://twistedmatrix.com/trac/wiki/Downloads|here]] and install.

== qt4reactor ==

Download the compressed tarball from [[https://github.com/ghtdak/qtreactor/tarball/master|here]], decompress and drop the resulting directory into your python's site-packages renaming it to ''qtreactor''.

== python-distutils-extra ==

Branch lp:python-distutils-extra and run "python setup.py install" inside it.

== ubuntuone-dev-tools ==

 * Install the following dependencies (TODO, add download links):
   * coverage (for ubuntuone-dev-tools)
   * pylint (for ubuntuone-dev-tools)
   * pep8 (for ubuntuone-dev-tools)
 * Branch lp:ubuntuone-dev-tool and run "python setup.py install" inside it.

== xdg ==

Branch lp:~mandel/+junk/xdg and run "python setup.py install" inside it.

== Ubuntu SSO Client ==

 * Install the following dependencies:
   * [[http://www.voidspace.org.uk/python/modules.shtml#pycrypto|pycrypto]]
   * [[http://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/py2exe-0.6.9.win32-py2.7.exe/download|py2exe]]
   * [[http://www.riverbankcomputing.co.uk/static/Downloads/PyQt4/PyQt-Py2.7-x86-gpl-4.8.4-1.exe|PyQt4]]
   * Using C:\python27\scripts\easy_install
     * lazr.restfulclient
     * python-mocker
     * pyOpenSSL
     * keyring
     * simplejson
     * PIL
 * Branch lp:ubuntu-sso-client, and run "python setup.py build" inside it. To test if the project works properly, let's get you some Ubuntu One credentials into the system. To do so, perform the following steps.

=== Run the ubuntu-sso-client service ===

 * open a command line (cmd.exe) and navigate to the ubuntu-sso-client branch. Then, run:
   * set PYTHONPATH=.
   * set DEBUG=True
   * python bin\windows-ubuntu-sso-login

=== Run the UI testing script ===

 * open a command line (cmd.exe) and navigate to the ubuntu-sso-client branch. Then, run:
   * set PYTHONPATH=.
   * set DEBUG=True
   * python ubuntu_sso\qt\tests\show_gui.py

You should get a QT UI where you're asked to either sign in or register. Login with your SSO username and password. If you're eventually presented with a message of "Success", then you're good to go to further steps. If not, please seek assistance.

==== Important notes ====

 * If you get a "ImportError: PIL", you need to go to the python's site-packages folder and rename the 'pil' folder to PIL, or if you don't have a folder but an egg (something like pil<version>.egg), you should change it to be PIL.egg.

 * If you get a SSLHandshakeError failure when the Sign in dialog appears, you're running a httplib2 version that has some issues with https. Please use httplib2 version lower than 0.7.0.

== Ubuntu One Storage Protocol ==

 * Install protobuf: download from [[http://code.google.com/p/protobuf/downloads/list|here]] and install.
 * Branch lp:ubuntuone-storage-protocol and run "python setup.py install" inside it.

== Ubuntuone Client ==

 * Install configglue: branch lp:configglue and run "python setup.py install" inside it.
 * Branch lp:ubuntuone-client and enter that directory.
 * Download [[http://ubuntuone.com/p/110a/|this file]] and save it as {{{logging.conf}}} inside the {{{data/}}} directory.
 * Download [[http://ubuntuone.com/p/110Z/|this file]] and save it as {{{clientdefs.py}}} inside the {{{ubuntuone/}}} directory.

=== Run the ubuntuone-syncdaemon service ===

 * Run the ubuntu-sso-client service by as per the instructions above under "Run the ubuntu-sso-client service".
 * open a command line (cmd.exe) and navigate to the ubuntuone-client branch. Then, run:
   * set PYTHONPATH=..\ubuntu-sso-client;.
   * python bin\ubuntuone-syncdaemon --debug

== Misc information ==

=== Editors/IDEs ===

You can use your preferred windows editor, but make sure that the new lines used by it are the Unix ones, no crazy new lines from windows allowed in the code. If you do not have an editor of choice you can use one of the following:

 * Notepad++
 * KomodoEdit
 * JEdit

== Patch for pywin32 ==

{{{#!highlight diff
diff -r 7dce71d174a9 win32/src/win32security.i
--- a/win32/src/win32security.i Sat Jun 18 10:16:06 2011 -0400
+++ b/win32/src/win32security.i Mon Jun 20 14:15:27 2011 +0200
@@ -2108,7 +2108,7 @@
  if (!PyWinObject_AsTCHAR(obFname, &fname))
   goto done;

- if (GetFileSecurity(fname, info, psd, dwSize, &dwSize)) {
+ if (GetFileSecurityW(fname, info, psd, dwSize, &dwSize)) {
   PyErr_SetString(PyExc_RuntimeError, "Can't query for SECURITY_DESCRIPTOR size info?");
   goto done;
  }
@@ -2117,7 +2117,7 @@
   PyErr_SetString(PyExc_MemoryError, "allocating SECURITY_DESCRIPTOR");
   goto done;
  }
- if (!GetFileSecurity(fname, info, psd, dwSize, &dwSize)) {
+ if (!GetFileSecurityW(fname, info, psd, dwSize, &dwSize)) {
   PyWin_SetAPIError("GetFileSecurity");
   goto done;
  }
@@ -2153,7 +2153,7 @@
  PSECURITY_DESCRIPTOR psd;
  if (!PyWinObject_AsSECURITY_DESCRIPTOR(obsd, &psd))
   goto done;
- if (!SetFileSecurity(fname, info, psd)) {
+ if (!SetFileSecurityW(fname, info, psd)) {
   PyWin_SetAPIError("SetFileSecurity");
   goto done;
  }
Line 52: Line 175:


=== Parameters ===

Nant allows to pass enviroment variables that can be used to configure the different tasks, the normal way to pass a property is the following:

{{{

tools\Nant\bin\nant.exe -D:enviroment="debug"

}}}

Currently the build script supports the following configuration parameters:

 * '''enviroment''': The environment use for the compilation, the available values are:
   * debug
   * release

=== Building and Testing: ===

These are the commands to run to build and run the tests.

 * {{{tools\Nant\bin\nant.exe clean}}}
 * {{{tools\Nant\bin\nant.exe build}}}
 * {{{tools\Nant\bin\nant.exe tests}}}

This error happens if you run the tests from a network drive (e.g: Virtualbox share):
{{{
   [mkdir] Creating directory 'Z:\mandel\fix_tomboy_installer\test-results'.
     [echo] Executing Canonical.UbuntuOne.Common.Tests
     [exec] Z:\mandel\fix_tomboy_installer\main.build(147,4): Attribute 'userunt
imeengine' for <exec ... /> is deprecated. Use the managed attribute and Manage
d property instead.
     [exec]
     [exec] Unhandled Exception: System.TypeInitializationException: The type in
itializer for 'NUnit.ConsoleRunner.Runner' threw an exception. ---> System.Secur
ity.SecurityException: That assembly does not allow partially trusted callers.
     [exec] at NUnit.ConsoleRunner.Runner..cctor()
     [exec] The action that failed was:
     [exec] LinkDemand
     [exec] The assembly or AppDomain that failed was:
     [exec] nunit-console-runner, Version=2.5.5.10112, Culture=neutral, PublicKe
yToken=96d09a1eb7f44a77
     [exec] The method that caused the failure was:
     [exec] NUnit.Core.Logger GetLogger(System.Type)
     [exec] The Zone of the assembly that failed was:
     [exec] Internet
     [exec] The Url of the assembly that failed was:
     [exec] file:///Z:/mandel/fix_tomboy_installer/tools/NUnit/lib/nunit-console
-runner.DLL
     [exec] --- End of inner exception stack trace ---
     [exec] at NUnit.ConsoleRunner.Runner.Main(String[] args)
     [exec] at NUnit.ConsoleRunner.Class1.Main(String[] args)

BUILD FAILED - 0 non-fatal error(s), 22 warning(s)

Z:\mandel\fix_tomboy_installer\main.build(147,4):
External Program Failed: Z:\mandel\fix_tomboy_installer\tools\NUnit\nunit-consol
e.exe (return code was -532459699)

Total time: 152.4 seconds.
}}}

Fix is to move the code to a local drive.

=== Build the msi ===

{{{ tools\Nant\bin\nant.exe installer}}}

If you get this:

{{{
     [get] Retrieving 'http://download.gnome.org/binaries/win32/tomboy/1.2/Tomb
oy-1.2.2.msi' to 'C:\Documents and Settings\Stuart Colville\Desktop\fix_tomboy_i
nstaller\tomboy.msi'.
     [exec] C:\Documents and Settings\Stuart Colville\Desktop\fix_tomboy_install
er\main.build(121,5): Attribute 'useruntimeengine' for <exec ... /> is deprecate
d. Use the managed attribute and Managed property instead.

BUILD FAILED - 0 non-fatal error(s), 6 warning(s)

C:\Documents and Settings\Stuart Colville\Desktop\fix_tomboy_installer\main.buil
d(121,5):
'C:\Program Files\Windows Installer XML v3\bin\dark.exe' failed to start.
    The system cannot find the path specified

Total time: 24.5 seconds.}}}

Wix is present in the src tree under the tools directory, this means that the build script will be able to create an .msi without the need of having Wix installed in the VM.

Re-run the installer command and you should find !UbuntuOne.msi in the install directory.

=== Build the bootstrapper ===

Due to the nature of the windows installer only a single msi can be executed at a time. The project contains a boostrapper generation that will create a setup.exe program that will concatenate the installation of the following:

 * Ubuntu One on Windows
 * Gtk-Sharp
 * Tomboy

In order to create the bootstrapper the following command has to be executed:

{{{ tools\Nant\bin\nant.exe bootstrapper }}}

The output should be similar to the following:

{{{
Target framework: Microsoft .NET Framework 3.5
Target(s) specified: bootstrapper


bootstrapper:

     [exec] InstallerLinker: dotNetInstaller Packager (1.9.5931.0)
     [exec]

BUILD SUCCEEDED

Total time: 1 seconds.

}}}

Once this command has been ran you should find setup.exe in the install directory.

== Installing ==

The windows installer solution has different components that are installed by the msi. In certain cases it is interesting to install the different components independently to simplfy the testing.

=== Installing the windows service ===

!InstallUtil is the command line that can be used to install and uninstall a windows service. In order to install a windows service we first have to add '''C:\Windows\Microsoft.NET\Framework\v2.0.50727''' in your shell path (edit environment variables). Once !InstallUtil is in you path you can execute in the command line:

{{{
InstallUtil Canonical.UbuntuOne.ProcessDispatcher.exe
}}}

If the installation is successful a message similar to the following will be given:
{{{

Affected parameters are:
   logtoconsole =
   assemblypath = C:\Users\Mandel\Documents\Projects\UbuntuOne\net\install_servi
ce_wix\install\build_results\Daemon\Canonical.UbuntuOne.ProcessDispatcher.exe
   logfile = C:\Users\Mandel\Documents\Projects\UbuntuOne\net\install_service_wi
x\install\build_results\Daemon\Canonical.UbuntuOne.ProcessDispatcher.InstallLog
Installing service UbuntuOne SyncDaemon...
Service UbuntuOne SyncDaemon has been successfully installed.
Creating EventLog source UbuntuOne SyncDaemon in log Application...

The Install phase completed successfully, and the Commit phase is beginning.
See the contents of the log file for the C:\Users\Mandel\Documents\Projects\Ubun
tuOne\net\install_service_wix\install\build_results\Daemon\Canonical.UbuntuOne.P
rocessDispatcher.exe assembly's progress.
The file is located at C:\Users\Mandel\Documents\Projects\UbuntuOne\net\install_
service_wix\install\build_results\Daemon\Canonical.UbuntuOne.ProcessDispatcher.I
nstallLog.
Committing assembly 'C:\Users\Mandel\Documents\Projects\UbuntuOne\net\install_se
rvice_wix\install\build_results\Daemon\Canonical.UbuntuOne.ProcessDispatcher.exe
'.
Affected parameters are:
   logtoconsole =
   assemblypath = C:\Users\Mandel\Documents\Projects\UbuntuOne\net\install_servi
ce_wix\install\build_results\Daemon\Canonical.UbuntuOne.ProcessDispatcher.exe
   logfile = C:\Users\Mandel\Documents\Projects\UbuntuOne\net\install_service_wi
x\install\build_results\Daemon\Canonical.UbuntuOne.ProcessDispatcher.InstallLog

The Commit phase completed successfully.

The transacted install has completed.
}}}

If there are any errors the installation will be rolled back and a message like the following will be given:
{{{
Installing service UbuntuOne SyncDaemon...
Creating EventLog source UbuntuOne SyncDaemon in log Application...

An exception occurred during the Install phase.
System.ComponentModel.Win32Exception: The specified service has been marked for
deletion

The Rollback phase of the installation is beginning.
See the contents of the log file for the C:\Users\Mandel\Documents\Projects\Ubun
tuOne\net\install_service_wix\install\build_results\Daemon\Canonical.UbuntuOne.P
rocessDispatcher.exe assembly's progress.
The file is located at C:\Users\Mandel\Documents\Projects\UbuntuOne\net\install_
service_wix\install\build_results\Daemon\Canonical.UbuntuOne.ProcessDispatcher.I
nstallLog.
Rolling back assembly 'C:\Users\Mandel\Documents\Projects\UbuntuOne\net\install_
service_wix\install\build_results\Daemon\Canonical.UbuntuOne.ProcessDispatcher.e
xe'.
Affected parameters are:
   logtoconsole =
   assemblypath = C:\Users\Mandel\Documents\Projects\UbuntuOne\net\install_servi
ce_wix\install\build_results\Daemon\Canonical.UbuntuOne.ProcessDispatcher.exe
   logfile = C:\Users\Mandel\Documents\Projects\UbuntuOne\net\install_service_wi
x\install\build_results\Daemon\Canonical.UbuntuOne.ProcessDispatcher.InstallLog
Restoring event log to previous state for source UbuntuOne SyncDaemon.

The Rollback phase completed successfully.

The transacted install has completed.
The installation failed, and the rollback has been performed.
}}}

Once the service has been installed you can manage it with mmc.exe. Once you have finished the different tests the service can be uninstalled with:

{{{
InstallUtil /u Canonical.UbuntuOne.ProcessDispatcher.exe
}}}

== Testing ==

There are a number of different ways/path to test the solution.

=== Unit Testing ===

Unit testing is executed in an automated manner by the build script everytime a new deploymnet package (msi) is build. The results of the unit testing can be found in the test-results dir. A tool like [[http://nunit2report.sourceforge.net/|Nunit2report]] can be used to view the results in a more human readable manner.

=== Test the msi ===

Testing the full result of an msi installation is a hard task due to the huge amount of possible actions that a msi can perform (install features, add short-cuts, add registry values...). Nevertheless there is a certain part of the msi testing that can be automated which is msi custom actions.

Custom actions are wix extensions that have been added in the project to perform special operations that wix is not able to do. The tool to be used to test this custom actions is [[http://wix.sourceforge.net/manual-wix3/lux.htm|Lux]].


To be able to execute the Lux test the following command should be executed when installing the msi:

{{{

msiexec /l lux.log /i install\UbuntuOne.msi

}}}

Once the installation has been completed search the log for '''!WixRunImmediateUnitTests''' to see test results. If issues exist with the installer please provide the output of '''lux.log''' (from the above command) to the bug report.

==== UI testing ====

A UI testing tool can be used to test the msi and add extra logic to ensure that the different operations to place. Read the UI testing for more information.

=== UI testing ===

'''TODO: Complete when ever a tool has been decided.'''

The following details what's needed to test the Ubuntu One file sync client under windows.

Dependencies

A Windows machine or VM is needed. For now, we support Windows 7 and XP.

Bazaar

Download and install bazaar from: http://wiki.bazaar.canonical.com/WindowsDownloads. Choose the "standalone" installer.

SSH key (not needed if only branching stuff)

If you need to setup your ssh key (only if you need to submit branches from this platform), there is a nice wiki page from launchpad that explains how to set up bzr on windows as well as the ssh keys in order to easily work with launchdpad. The wiki can be found here.

Bazaar UIs

Tortoisebzr can be used so that the different status icons are shown in the you code files during development but there is an important fact to know. Those icons, known as IconOverlays, are limited on Windows. That is, only 15 different icons can be installed in your system. If you have any other tortoise software you might have reached that limit which means that those icons wont be shown. To know which IconOverlays have been installed in your system you can open regedit and look at HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers which contains a list of the overlays already installed in you system.

VisualStudio 2008

Some of the python packages that are required (pykeyring is one of them) required your system to have VS2008 installed. It is very important that you install this specific version of VS and no later since the setup.py of the packages will be looking for that version and no other.

There is no need to install the payed version of VS2008, you can use the express C++ version from here (look at the far right tab).

Important note

After installing VS2008 Express, to make sure that all environment variables are set, either reboot or use the command prompt found here: "Start Menu\Programs\Microsoft Visual C++ 2008 Express Edition\Visual Studio Tools\Visual Studio 2008 Command Prompt" as your regular command prompt.

Python

The Windows port at the moment is targeting Python 2.7. You can find the a correct version of python for your system in the python download page.

Be sure to have your python.exe in your PATH environment variable.

To make the rest of the dependency installation easier, please do install setuptools from here. While easy_install will be able to install most of the needed packages, some of them won't and an explanation of how to install them will be provided.

32 or 64 bits?

At the moment there is no preference between using python for x86 or x64 machines since tests should pass on both runtimes. Nevertheless some of the dependencies that the project has have to be installed using an msi that has been generated in a x86 machine. If you are using the x64 version of python you might find that a number of msi state that the installation of python could not be found. There reason for this is that because the installer was compiled in a x32 machine and your os is a x64 version the msi will be looking for the python data in the WoW64 (Windows 32-bit On Windows 64-bit) subsystem which has its information stored in the HKEY_LOCAL_MACHINE\Software\Wow6432Node in the path which is the equivalent to HKEY_LOCAL_MACHINE\Software in a x86 machine. In order to work around this issue you simple have to copy the exact same information that python added to your registry to the WoW64 registry path so that when the msi looks for it it will find it.

pywin32

Download from here. Be sure to always choose python 2.7.

At the time of this writing, there is a bug in the pywin32 package where the non-utf8 functions GetFileSecurity and SetFileSecurity are used. This bug has been reported to upstream. If this bug is not fixed in upstream by the time you read this, you will need to patch pywin32, otherwise the operations that are performed on utf-8 paths will raise the winerror "23".

You can patch your installation by either downloading this zip and overwriting the contents of the win32 folder (inside site-packages from your Python installation), or applying the patch located at the bottom of this wiki page and recompile pywin32.

Twisted

Download the .msi from here and install.

qt4reactor

Download the compressed tarball from here, decompress and drop the resulting directory into your python's site-packages renaming it to qtreactor.

python-distutils-extra

Branch lp:python-distutils-extra and run "python setup.py install" inside it.

ubuntuone-dev-tools

  • Install the following dependencies (TODO, add download links):
    • coverage (for ubuntuone-dev-tools)
    • pylint (for ubuntuone-dev-tools)
    • pep8 (for ubuntuone-dev-tools)
  • Branch lp:ubuntuone-dev-tool and run "python setup.py install" inside it.

xdg

Branch lp:~mandel/+junk/xdg and run "python setup.py install" inside it.

Ubuntu SSO Client

  • Install the following dependencies:
    • pycrypto

    • py2exe

    • PyQt4

    • Using C:\python27\scripts\easy_install
      • lazr.restfulclient
      • python-mocker
      • pyOpenSSL
      • keyring
      • simplejson
      • PIL
  • Branch lp:ubuntu-sso-client, and run "python setup.py build" inside it. To test if the project works properly, let's get you some Ubuntu One credentials into the system. To do so, perform the following steps.

Run the ubuntu-sso-client service

  • open a command line (cmd.exe) and navigate to the ubuntu-sso-client branch. Then, run:
    • set PYTHONPATH=.
    • set DEBUG=True
    • python bin\windows-ubuntu-sso-login

Run the UI testing script

  • open a command line (cmd.exe) and navigate to the ubuntu-sso-client branch. Then, run:
    • set PYTHONPATH=.
    • set DEBUG=True
    • python ubuntu_sso\qt\tests\show_gui.py

You should get a QT UI where you're asked to either sign in or register. Login with your SSO username and password. If you're eventually presented with a message of "Success", then you're good to go to further steps. If not, please seek assistance.

Important notes

  • If you get a "ImportError: PIL", you need to go to the python's site-packages folder and rename the 'pil' folder to PIL, or if you don't have a folder but an egg (something like pil<version>.egg), you should change it to be PIL.egg.

  • If you get a SSLHandshakeError failure when the Sign in dialog appears, you're running a httplib2 version that has some issues with https. Please use httplib2 version lower than 0.7.0.

Ubuntu One Storage Protocol

  • Install protobuf: download from here and install.

  • Branch lp:ubuntuone-storage-protocol and run "python setup.py install" inside it.

Ubuntuone Client

  • Install configglue: branch lp:configglue and run "python setup.py install" inside it.
  • Branch lp:ubuntuone-client and enter that directory.
  • Download this file and save it as logging.conf inside the data/ directory.

  • Download this file and save it as clientdefs.py inside the ubuntuone/ directory.

Run the ubuntuone-syncdaemon service

  • Run the ubuntu-sso-client service by as per the instructions above under "Run the ubuntu-sso-client service".
  • open a command line (cmd.exe) and navigate to the ubuntuone-client branch. Then, run:
    • set PYTHONPATH=..\ubuntu-sso-client;.
    • python bin\ubuntuone-syncdaemon --debug

Misc information

Editors/IDEs

You can use your preferred windows editor, but make sure that the new lines used by it are the Unix ones, no crazy new lines from windows allowed in the code. If you do not have an editor of choice you can use one of the following:

Patch for pywin32

   1 diff -r 7dce71d174a9 win32/src/win32security.i
   2 --- a/win32/src/win32security.i Sat Jun 18 10:16:06 2011 -0400
   3 +++ b/win32/src/win32security.i Mon Jun 20 14:15:27 2011 +0200
   4 @@ -2108,7 +2108,7 @@
   5   if (!PyWinObject_AsTCHAR(obFname, &fname))
   6    goto done;
   7 
   8 -       if (GetFileSecurity(fname, info, psd, dwSize, &dwSize)) {
   9 +       if (GetFileSecurityW(fname, info, psd, dwSize, &dwSize)) {
  10    PyErr_SetString(PyExc_RuntimeError, "Can't query for SECURITY_DESCRIPTOR size info?");
  11    goto done;
  12   }
  13 @@ -2117,7 +2117,7 @@
  14    PyErr_SetString(PyExc_MemoryError, "allocating SECURITY_DESCRIPTOR");
  15    goto done;
  16   }
  17 - if (!GetFileSecurity(fname, info, psd, dwSize, &dwSize)) {
  18 + if (!GetFileSecurityW(fname, info, psd, dwSize, &dwSize)) {
  19    PyWin_SetAPIError("GetFileSecurity");
  20    goto done;
  21   }
  22 @@ -2153,7 +2153,7 @@
  23   PSECURITY_DESCRIPTOR psd;
  24   if (!PyWinObject_AsSECURITY_DESCRIPTOR(obsd, &psd))
  25    goto done;
  26 -       if (!SetFileSecurity(fname, info, psd)) {
  27 +       if (!SetFileSecurityW(fname, info, psd)) {
  28    PyWin_SetAPIError("SetFileSecurity");
  29    goto done;
  30   }

UbuntuOne/Contribute/WindowsTesting (last edited 2012-01-20 19:37:27 by 30-36-17-190)