Merge lp:~ralsina/ubuntuone-windows-installer/fix_809873 into lp:ubuntuone-windows-installer

Proposed by Roberto Alsina on 2011-07-13
Status: Merged
Approved by: Roberto Alsina on 2012-01-09
Approved revision: 96
Merged at revision: 102
Proposed branch: lp:~ralsina/ubuntuone-windows-installer/fix_809873
Merge into: lp:ubuntuone-windows-installer
Prerequisite: lp:~ralsina/ubuntuone-windows-installer/fix-810053
Diff against target: 949 lines (+899/-2)
8 files modified
scripts/README (+71/-0)
scripts/README_nonelevated.txt (+21/-0)
scripts/conf.py (+41/-0)
scripts/customlang/ubuntuone_en.lng (+1/-0)
scripts/setup.py (+360/-0)
scripts/ubuntuone.xml (+396/-0)
scripts/ubuntuone_autoupdate.xml (+9/-0)
ubuntuone_installer/gui/qt/sync_now_or_later.py (+0/-2)
To merge this branch: bzr merge lp:~ralsina/ubuntuone-windows-installer/fix_809873
Reviewer Review Type Date Requested Status
Manuel de la Peña (community) Approve on 2012-01-09
Diego Sarmentero (community) Approve on 2012-01-06
Shane Fagan (community) irl test 2011-07-13 Approve on 2011-07-15
Review via email: mp+67911@code.launchpad.net

Commit Message

Add a scripts folder containing the bundle-making script and the bitrock installer project

Description of the Change

Add a scripts folder containing the bundle-making script and the bitrock installer project

To post a comment you must log in.
24. By Roberto Alsina on 2011-07-14

Run wizard in background

25. By Roberto Alsina on 2011-07-14

tweak

26. By Roberto Alsina on 2011-07-14

instructions

27. By Roberto Alsina on 2011-07-14

modular commands

28. By Roberto Alsina on 2011-07-14

style fixes

29. By Roberto Alsina on 2011-07-14

use the same version number

30. By Roberto Alsina on 2011-07-14

Take conf files from sources instead of keepinga copy

Shane Fagan (shanepatrickfagan) wrote :

Made the exes then tested on a clean XP install and its working perfect +1

review: Approve (irl test)
31. By Roberto Alsina on 2011-07-22

manually copy ubuntu_sso

32. By Roberto Alsina on 2011-07-22

make it work from trunk, style fixes

33. By Roberto Alsina on 2011-07-31

Add fix for win32com usage

34. By Roberto Alsina on 2011-08-02

add icon for setup (just for testing purposes)

35. By Roberto Alsina on 2011-08-03

no more embedded_sso

36. By Roberto Alsina on 2011-08-04

Copy config files to the right place, set registry keys accordingly.

37. By Roberto Alsina on 2011-08-09

Ignore DLLs that break XP, embed vcredist in the installer.

38. By Roberto Alsina on 2011-08-09

More vcredist support, copy pem files

39. By Roberto Alsina on 2011-08-09

typo

40. By Roberto Alsina on 2011-08-10

Don't use cmd windows

41. By Roberto Alsina on 2011-08-10

only upgrade/install vc_redist if needed

42. By Roberto Alsina on 2011-08-10

fail quietly if vc_redist is installed

43. By Roberto Alsina on 2011-08-16

pep8 fixes

44. By Roberto Alsina on 2011-08-18

Only provide access to the wizard, which will start u1cp if needed

45. By Roberto Alsina on 2011-08-18

start uninstaller with UI from the menu

46. By Roberto Alsina on 2011-08-23

add wizard to the menu temporarily

47. By Roberto Alsina on 2011-08-24

Add missing configglue bits

48. By Roberto Alsina on 2011-08-29

Provide revnos in the installer

49. By Roberto Alsina on 2011-08-30

Keep install.log

50. By Roberto Alsina on 2011-08-31

Fix cparrino's handoff bug

51. By Roberto Alsina on 2011-09-02

Fix for bug 839906 (icon on taskbar was not correct)

52. By Roberto Alsina on 2011-09-07

Changed title in the bitrock window

53. By Roberto Alsina on 2011-09-08

installer tuning

54. By Roberto Alsina on 2011-09-08

delete the temp files reported on bug 840178

55. By Roberto Alsina on 2011-09-09

don't ship get_credentials

56. By Roberto Alsina on 2011-09-12

Added Ubuntu One folder to the start menu

57. By Roberto Alsina on 2011-09-13

use --mode win32 on uninstaller

58. By Roberto Alsina on 2011-09-15

Fix metadata

59. By Roberto Alsina on 2011-09-15

Fix metadata

60. By Roberto Alsina on 2011-09-16

merged mandel's autoupdate branch

61. By Roberto Alsina on 2011-09-16

merged trunk

62. By Roberto Alsina on 2011-09-16

new release

63. By Roberto Alsina on 2011-09-20

updated instructions

64. By Roberto Alsina on 2011-09-21

add --installer argument

65. By Roberto Alsina on 2011-09-21

setting version numbers for new release

66. By Roberto Alsina on 2011-09-26

Don't start u1cp on upgrades

67. By Roberto Alsina on 2011-09-26

build 200, version 2.0

68. By Roberto Alsina on 2011-10-07

version 2.0.1 build 201

69. By Roberto Alsina on 2011-11-15

Only set upgrade mode when uninstall.exe exists

70. By Roberto Alsina on 2011-11-18

Use the new name of the SSO binary

71. By Roberto Alsina on 2011-11-18

This is version 2.0.2 build 202

72. By Roberto Alsina on 2011-11-18

Use the new name of the SSO binary

73. By Roberto Alsina on 2011-11-18

Version 2.0.2, build 202

74. By Roberto Alsina on 2011-12-06

Fix for vista autoupdate

75. By Roberto Alsina on 2011-12-08

Don't step on platform, offer windows/console builds

76. By Roberto Alsina on 2011-12-09

Only copy bin files in prepare step, add binary for u1sdtool

77. By Roberto Alsina on 2011-12-14

Start windows-installer without privilege escalation

78. By Roberto Alsina on 2011-12-14

typo

79. By Roberto Alsina on 2011-12-14

bump to 2.0.3

80. By Roberto Alsina on 2011-12-28

Fix for LP:883675 [you may need to reboot]

81. By Roberto Alsina on 2012-01-02

make this configurable

82. By Roberto Alsina on 2012-01-02

merge the config'd branches

83. By Roberto Alsina on 2012-01-02

updated instructions

84. By Roberto Alsina on 2012-01-02

merged trunk

85. By Roberto Alsina on 2012-01-02

no glob, pep8 fixes

86. By Roberto Alsina on 2012-01-02

oops

87. By Roberto Alsina on 2012-01-02

typo

Manuel de la Peña (mandel) wrote :

Cool, We need to get this to lang, here are some comments:

* It looks to me that glob is not longer used, shall we remove the import.
* Regarding: os.system("bzr branch %s %s" % (urls[0], folder_name)) could we use Popen for that and find the location of the .exe via 'from distutils.spawn import find_executable'. That will also ensure that we can test if the system has bzr, if not we can give a meaningful error.
* In:
325 + # Remove "installed" copy
326 + try:
327 + shutil.rmtree(os.path.join("installed", "Lib"))
328 + except OSError:
329 + pass

Why do we ignore the exception?
* Within the source tree of ubuntuone-client there is a windows folder that contains an example loging.conf maybe we can simply copy it rather than doing:
401 + with open(logging_path, "rb") as f:
402 + data = f.read()
403 + data = data.replace("@LOG_LEVEL@", LOG_LEVEL)
404 + data = data.replace("@LOG_FILE_SIZE@", LOG_FILE_SIZE)
405 + with open(os.path.join("data", "logging.conf"), "wb") as f:
406 + f.write(data)
* Shall we put a poor mans name for:
449 + author='',
450 + author_email='',

review: Needs Fixing
Roberto Alsina (ralsina) wrote :

> Cool, We need to get this to lang, here are some comments:
>
> * It looks to me that glob is not longer used, shall we remove the import.

Agreed, removed.

> * Regarding: os.system("bzr branch %s %s" % (urls[0], folder_name)) could we
> use Popen for that and find the location of the .exe via 'from distutils.spawn
> import find_executable'. That will also ensure that we can test if the system
> has bzr, if not we can give a meaningful error.

Right now, if you don't have bzr, it fails with "'bzr' is not recognized as an internal or external command, operable program or batch file." which should be meaningful enough ;-)

I added error checking and made it abort on bzr errors now.

> * In:
> 325 + # Remove "installed" copy
> 326 + try:
> 327 + shutil.rmtree(os.path.join("installed", "Lib"))
> 328 + except OSError:
> 329 + pass
>
> Why do we ignore the exception?

Just in case it's not there.

> * Within the source tree of ubuntuone-client there is a windows folder that
> contains an example loging.conf maybe we can simply copy it rather than doing:
> 401 + with open(logging_path, "rb") as f:
> 402 + data = f.read()
> 403 + data = data.replace("@LOG_LEVEL@", LOG_LEVEL)
> 404 + data = data.replace("@LOG_FILE_SIZE@", LOG_FILE_SIZE)
> 405 + with open(os.path.join("data", "logging.conf"), "wb") as f:
> 406 + f.write(data)
> * Shall we put a poor mans name for:
> 449 + author='',
> 450 + author_email='',

This mimics the linux build's behaviour, to make those configurable.

88. By Roberto Alsina on 2012-01-04

remove traces of glob

89. By Roberto Alsina on 2012-01-04

handle bzr errors

90. By Roberto Alsina on 2012-01-05

unique app is merged in trunk

91. By Roberto Alsina on 2012-01-05

avoid system()

Diego Sarmentero (diegosarmentero) wrote :

Shouldn't this line be removed?:
139 + "lp:~ralsina/ubuntuone-windows-installer/register_plus_login"

Except for that, the rest looks ok!

review: Needs Information
Roberto Alsina (ralsina) wrote :

> Shouldn't this line be removed?:
> 139 + "lp:~ralsina/ubuntuone-windows-installer/register_plus_login"
>
>

Not yet! Without that hack, we don't produce a working release (the wizard will register users and leave them with invalid credentials)

Diego Sarmentero (diegosarmentero) wrote :

+1

review: Approve
Manuel de la Peña (mandel) wrote :

We do the following a number of times: os.path.join("..", "..", "installed", "Lib", "site-packages", .. ) can we merge the common path and store it in a var?

review: Needs Fixing
Roberto Alsina (ralsina) wrote :

> We do the following a number of times: os.path.join("..", "..", "installed",
> "Lib", "site-packages", .. ) can we merge the common path and store it in a
> var?

Done!

92. By Roberto Alsina on 2012-01-09

remove redundancy

93. By Roberto Alsina on 2012-01-09

pep8 fix

94. By Roberto Alsina on 2012-01-09

lint fixes

95. By Roberto Alsina on 2012-01-09

lint

96. By Roberto Alsina on 2012-01-09

linux lint

Manuel de la Peña (mandel) wrote :

Code looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'scripts'
2=== added file 'scripts/README'
3--- scripts/README 1970-01-01 00:00:00 +0000
4+++ scripts/README 2012-01-09 14:40:29 +0000
5@@ -0,0 +1,71 @@
6+HOW TO BUILD A BUNDLE
7+---------------------
8+
9+To build a bundle, assuming you have a windows developer setup, is as
10+simple as:
11+
12+python setup.py fetch prepare py2exe
13+
14+The commands do the following:
15+
16+fetch
17+
18+ Use bzr to get trunk of ubuntu-sso-client, ubuntuone-client,
19+ ubuntuone-control-panel and ubuntuone-windows-installer.
20+
21+ If you want to try building bundles with a branch that's not
22+ merged to trunk yet, after you do "fetch" you can go to
23+ sources\package-name and merge it there.
24+
25+prepare
26+
27+ Copies the "bins" out of the packages, does tweaks to the
28+ source code, compiles .ui and .qrc files, and then
29+ "installs" everything into the "installed" folder.
30+
31+py2exe
32+
33+ creates a dist folder with self-contained .exe files
34+ using py2exe
35+
36+After you do this, you will have a fully self-contained set of binaries
37+in the dist/ folder, which you can use for testing.
38+
39+HOW TO BUILD AN INSTALLER
40+-------------------------
41+
42+Update the release numbers in setup.py ubuntuone_autoupdate.xml and
43+ubuntuone.xml. Remember that you have both a build (ex: 203)
44+and a release (ex: 2.0.3)
45+
46+Get the VS2008 runtime "vcredist_x86.exe" and put it in the
47+scripts folder.
48+
49+Get the VistaLib32.dll and VistaLib64.dll and put them in dist. Those
50+DLLs are for allowing the wizard to run non-elevated, and came originally
51+from here: http://www.codeproject.com/KB/vista-security/RunNonElevated.aspx
52+
53+According to their license, README_nonelevated.txt has to be distributed too.
54+
55+In order to build de installer you have to follow this stesp:
56+
57+ 1. Customize the auto-updater:
58+
59+ The auto-updater is generated by the InstallBuilder product
60+ in order to create a customized version (contains product name,
61+ author etc...) please execute the following:
62+
63+ {$bitrock_installation$}\autoupdate\bin\customize.exe" build ubuntuone_autoupdate.xml windows
64+
65+ This command will create the updater which you have to copy to the scripts
66+ folder in order to be able to create the installer.
67+
68+ It will probably be in ~\Documents\AutoUpdate\output (depends on the windows version)
69+
70+ 2. Create the package:
71+
72+
73+ {$bitrock_installation$}\bin\builder-cli.exe" build ubuntuone.xml
74+
75+ The resulting installer will be in ~\Documents\InstallBuilder\output
76+ (depends on the windows version)
77
78=== added file 'scripts/README_nonelevated.txt'
79--- scripts/README_nonelevated.txt 1970-01-01 00:00:00 +0000
80+++ scripts/README_nonelevated.txt 2012-01-09 14:40:29 +0000
81@@ -0,0 +1,21 @@
82+THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
83+ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
84+TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
85+PARTICULAR PURPOSE.
86+
87+Copyright (C) 2007. WinAbility Software Corporation. All rights reserved.
88+
89+Author: Andrei Belogortseff [ http://www.winability.com ]
90+
91+TERMS OF USE: You are free to use this code in any way you like,
92+for both the commercial and non-commercial purposes, royalty-free,
93+AS LONG AS you agree with the warranty disclaimer above,
94+EXCEPT that you may not remove or modify this or any of the
95+preceeding paragraphs.
96+
97+If you use this code in your own project, an acknowledgement will be appreciated,
98+although it's not required.
99+
100+See the following article for the details:
101+
102+http://www.codeproject.com/useritems/RunNonElevated.asp
103
104=== added file 'scripts/conf.py'
105--- scripts/conf.py 1970-01-01 00:00:00 +0000
106+++ scripts/conf.py 2012-01-09 14:40:29 +0000
107@@ -0,0 +1,41 @@
108+# conf.py - Configuration for Ubuntu One Client package windows build
109+#
110+# Copyright 2012 Canonical Ltd.
111+#
112+# This program is free software: you can redistribute it and/or modify it
113+# under the terms of the GNU General Public License version 3, as published
114+# by the Free Software Foundation.
115+#
116+# This program is distributed in the hope that it will be useful, but
117+# WITHOUT ANY WARRANTY; without even the implied warranties of
118+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
119+# PURPOSE. See the GNU General Public License for more details.
120+#
121+# You should have received a copy of the GNU General Public License along
122+# with this program. If not, see <http://www.gnu.org/licenses/>.
123+"""Configure what branches make the release."""
124+
125+# You can add branches that are to be merged into the release by
126+# adding them to the adequate list.
127+
128+U1_CLIENT_BRANCHES = (
129+ "lp:ubuntuone-client",
130+)
131+U1_CONTROL_PANEL_BRANCHES = (
132+ "lp:ubuntuone-control-panel",
133+)
134+UBUNTU_SSO_BRANCHES = (
135+ "lp:ubuntu-sso-client",
136+)
137+U1_WINDOWS_INSTALLER_BRANCHES = (
138+ "lp:ubuntuone-windows-installer",
139+ "lp:~ralsina/ubuntuone-windows-installer/register_plus_login"
140+)
141+U1_STORAGE_PROTOCOL_BRANCHES = (
142+ "lp:ubuntuone-storage-protocol",
143+)
144+
145+# If show_cmd is set to True, then the binaries will have cmd windows where
146+# you can see stderr.
147+
148+SHOW_CMD = False
149
150=== added directory 'scripts/customlang'
151=== added file 'scripts/customlang/ubuntuone_en.lng'
152--- scripts/customlang/ubuntuone_en.lng 1970-01-01 00:00:00 +0000
153+++ scripts/customlang/ubuntuone_en.lng 2012-01-09 14:40:29 +0000
154@@ -0,0 +1,1 @@
155+Installer.Setup.Title=Installing Ubuntu One
156
157=== added directory 'scripts/data'
158=== added file 'scripts/setup.py'
159--- scripts/setup.py 1970-01-01 00:00:00 +0000
160+++ scripts/setup.py 2012-01-09 14:40:29 +0000
161@@ -0,0 +1,360 @@
162+#!/usr/bin/env python
163+# setup-windows.py - Build system for Ubuntu One Client package
164+#
165+# Copyright 2010-2012 Canonical Ltd.
166+#
167+# This program is free software: you can redistribute it and/or modify it
168+# under the terms of the GNU General Public License version 3, as published
169+# by the Free Software Foundation.
170+#
171+# This program is distributed in the hope that it will be useful, but
172+# WITHOUT ANY WARRANTY; without even the implied warranties of
173+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
174+# PURPOSE. See the GNU General Public License for more details.
175+#
176+# You should have received a copy of the GNU General Public License along
177+# with this program. If not, see <http://www.gnu.org/licenses/>.
178+"""setup-windows.py"""
179+
180+import os
181+import shutil
182+import subprocess
183+import sys
184+
185+from distutils import log
186+from distutils.cmd import Command
187+from distutils.core import setup
188+
189+import conf
190+
191+LOG_LEVEL = "DEBUG"
192+LOG_FILE_SIZE = "1000000"
193+
194+
195+# pylint is giving spurious reimport errors
196+# pylint: disable=W0404
197+# pylint is complaining about parent classes having too many methods
198+# pylint: disable=R0904
199+# pylint says "too many branches"
200+# pylint: disable=R0912
201+def get_py2exe_extension():
202+ """Return an extension class of py2exe."""
203+ # pylint: disable=F0401
204+ from py2exe.build_exe import py2exe as build_exe
205+ # pylint: enable=F0401
206+
207+ # pylint: disable=E1101
208+ # pylint: disable=W0231
209+ class MediaCollector(build_exe):
210+ """Extension that copies lazr missing data."""
211+
212+ def __init__(self, *args, **kwargs):
213+ """Create a new instance."""
214+ build_exe.__init__(self, *args, **kwargs)
215+
216+ def _add_module_data(self, module_name):
217+ """Add the data from a given path."""
218+ # Create the media subdir where the
219+ # Python files are collected.
220+ media = module_name.replace('.', os.path.sep)
221+ full = os.path.join(self.collect_dir, media)
222+ if not os.path.exists(full):
223+ self.mkpath(full)
224+
225+ # Copy the media files to the collection dir.
226+ # Also add the copied file to the list of compiled
227+ # files so it will be included in zipfile.
228+ module = __import__(module_name, None, None, [''])
229+ for path in module.__path__:
230+ for file_name in os.listdir(path):
231+ file_name = os.path.join(path, file_name)
232+ log.info('Copying file %s', file_name)
233+ name = os.path.basename(file_name)
234+ if not os.path.isdir(file_name):
235+ self.copy_file(file_name, os.path.join(full, name))
236+ self.compiled_files.append(os.path.join(media, name))
237+ else:
238+ self.copy_tree(file_name, os.path.join(full, name))
239+
240+ def copy_extensions(self, extensions):
241+ """Copy the missing extensions."""
242+ build_exe.copy_extensions(self, extensions)
243+ for module in [
244+ 'lazr.uri',
245+ 'lazr.restfulclient',
246+ 'lazr.authentication',
247+ 'wadllib',
248+ 'ubuntuone.storageprotocol',
249+ ]:
250+ self._add_module_data(module)
251+
252+ # ModuleFinder can't handle runtime changes to __path__,
253+ # but win32com uses them
254+ try:
255+ # py2exe 0.6.4 introduced a replacement modulefinder.
256+ # This means we have to add package paths there, not to the built-in
257+ # one. If this new modulefinder gets integrated into Python, then
258+ # we might be able to revert this some day.
259+ # if this doesn't work, try import modulefinder
260+ # pylint: disable=F0401
261+ try:
262+ import py2exe.mf as modulefinder
263+ except ImportError:
264+ import modulefinder
265+ import win32com
266+ # pylint: enable=F0401
267+ for path in win32com.__path__[1:]:
268+ modulefinder.AddPackagePath("win32com", path)
269+ for extra in ["win32com.shell"]: # ,"win32com.mapi"
270+ __import__(extra)
271+ modules = sys.modules[extra]
272+ for path in modules.__path__[1:]:
273+ modulefinder.AddPackagePath(extra, path)
274+ except ImportError:
275+ # no build path setup, no worries.
276+ pass
277+ # pylint: enable=E1101
278+ return MediaCollector
279+# pylint: enable=W0404
280+# pylint: enable=R0904
281+# pylint: enable=R0912
282+
283+
284+def branch_and_merge(urls):
285+ """Branch and merge all requested branches."""
286+ project_name = urls[0].split(":")[1]
287+ print "Getting sources for:", project_name
288+ folder_name = os.path.join("sources", project_name)
289+ current_folder = os.getcwd()
290+ if os.path.isdir(folder_name): # Folder exists
291+ shutil.rmtree(folder_name)
292+ subprocess.check_call(["bzr", "branch", urls[0], folder_name])
293+ os.chdir(folder_name)
294+ for url in urls[1:]:
295+ print "Merging:", url
296+ subprocess.check_call(["bzr", "merge", url])
297+ subprocess.check_call(["bzr", "commit", "-m", '"merged %s"' % url])
298+ os.chdir(current_folder)
299+
300+
301+# pylint is complaining about parent classes having too many methods
302+# pylint: disable=R0904
303+class FetchSources(Command):
304+
305+ """Branch or pull the sources from all packages."""
306+
307+ user_options = []
308+
309+ def initialize_options(self):
310+ pass
311+
312+ def finalize_options(self):
313+ pass
314+
315+ def run(self):
316+ """Perform the command."""
317+ # Checkout sources
318+ for folder in ["sources", "bin", "installed", "data"]:
319+ if not os.path.isdir(folder):
320+ os.mkdir(folder)
321+ branch_and_merge(conf.U1_CLIENT_BRANCHES)
322+ branch_and_merge(conf.U1_CONTROL_PANEL_BRANCHES)
323+ branch_and_merge(conf.UBUNTU_SSO_BRANCHES)
324+ branch_and_merge(conf.U1_WINDOWS_INSTALLER_BRANCHES)
325+ branch_and_merge(conf.U1_STORAGE_PROTOCOL_BRANCHES)
326+# pylint: enable=R0904
327+
328+
329+# pylint is complaining about parent classes having too many methods
330+# pylint: disable=R0904
331+class PrepareSources(Command):
332+
333+ """Manipulate the sources look as if they were installed."""
334+
335+ user_options = []
336+
337+ def initialize_options(self):
338+ pass
339+
340+ def finalize_options(self):
341+ pass
342+
343+ def run(self):
344+ """Perform the command."""
345+ # Take binaries
346+ shutil.copyfile(os.path.join(
347+ "sources", "ubuntuone-client", "bin", "ubuntuone-syncdaemon"),
348+ os.path.join("bin", "ubuntuone-syncdaemon"))
349+ shutil.copyfile(os.path.join(
350+ "sources", "ubuntuone-client", "bin", "u1sdtool"),
351+ os.path.join("bin", "u1sdtool"))
352+ shutil.copyfile(os.path.join("sources", "ubuntu-sso-client",
353+ "bin", "ubuntu-sso-login"),
354+ os.path.join("bin", "ubuntu-sso-login"))
355+ shutil.copyfile(os.path.join("sources",
356+ "ubuntuone-control-panel", "bin",
357+ "ubuntuone-control-panel-qt"),
358+ os.path.join("bin", "ubuntuone-control-panel-qt"))
359+ shutil.copyfile(os.path.join("sources", "ubuntuone-windows-installer",
360+ "bin", "ubuntuone-installer-qt"),
361+ os.path.join("bin", "ubuntuone-installer-qt"))
362+
363+ # Remove "installed" copy
364+ try:
365+ shutil.rmtree(os.path.join("installed", "Lib"))
366+ except OSError:
367+ pass
368+
369+ # Build UI files, copy packages.
370+ dest_dir = os.path.join(
371+ "..", "..", "installed", "Lib", "site-packages", "ubuntu_sso")
372+ start_dir = os.getcwd()
373+ os.chdir(os.path.join("sources", "ubuntu-sso-client"))
374+ os.system("python setup.py build")
375+ os.system("python setup.py install --prefix=%s" %
376+ os.path.join("..", "..", "installed"))
377+ shutil.copytree("ubuntu_sso", dest_dir)
378+ sso_revno = subprocess.Popen(
379+ ["bzr", "revno", "."],
380+ stdout=subprocess.PIPE).communicate()[0]
381+ os.chdir(start_dir)
382+
383+ os.chdir(os.path.join("sources", "ubuntuone-client"))
384+ shutil.copy(os.path.join("windows", "clientdefs.py"),
385+ os.path.join("ubuntuone", "clientdefs.py"))
386+ shutil.copytree("ubuntuone", dest_dir)
387+ u1client_revno = subprocess.Popen(
388+ ["bzr", "revno", "."],
389+ stdout=subprocess.PIPE).communicate()[0]
390+ os.chdir(start_dir)
391+
392+ os.chdir(os.path.join("sources", "ubuntuone-control-panel"))
393+ os.system("python setup.py build")
394+ # Copying by hand because the install is borked
395+ shutil.copytree(os.path.join("ubuntuone", "controlpanel"),
396+ dest_dir)
397+ u1cp_revno = subprocess.Popen(
398+ ["bzr", "revno", "."],
399+ stdout=subprocess.PIPE).communicate()[0]
400+ os.chdir(start_dir)
401+
402+ os.chdir(os.path.join("sources", "ubuntuone-windows-installer"))
403+ os.system("python setup.py build")
404+ # Copying by hand because the install is borked
405+ shutil.copytree("ubuntuone_installer", dest_dir)
406+ u1inst_revno = subprocess.Popen(
407+ ["bzr", "revno", "."],
408+ stdout=subprocess.PIPE).communicate()[0]
409+ os.chdir(start_dir)
410+
411+ # Create revno file
412+ with open(os.path.join("data", "revnos.txt"), "w+") as revnos:
413+ revnos.write("ubuntu-sso-client: %s"
414+ "ubuntuone-client: %s"
415+ "ubuntuone-control-panel: %s"
416+ "ubuntuonw-windows-installer: %s" %
417+ (sso_revno, u1client_revno, u1cp_revno, u1inst_revno))
418+
419+ # Copy storage-protocol's pem files
420+ shutil.copyfile(os.path.join("sources",
421+ "ubuntuone-storage-protocol", "data",
422+ "UbuntuOne-Go_Daddy_CA.pem"),
423+ os.path.join("data", "UbuntuOne-Go_Daddy_CA.pem"))
424+ shutil.copyfile(os.path.join("sources",
425+ "ubuntuone-storage-protocol", "data",
426+ "UbuntuOne-Go_Daddy_Class_2_CA.pem"),
427+ os.path.join("data", "UbuntuOne-Go_Daddy_Class_2_CA.pem"))
428+
429+ # Copy syncdaemon config data
430+ shutil.copyfile(os.path.join("sources",
431+ "ubuntuone-client", "data",
432+ "syncdaemon.conf"),
433+ os.path.join("data", "syncdaemon.conf"))
434+ logging_path = os.path.join("sources",
435+ "ubuntuone-client", "data",
436+ "logging.conf.in")
437+ with open(logging_path, "rb") as logconf:
438+ data = logconf.read()
439+ data = data.replace("@LOG_LEVEL@", LOG_LEVEL)
440+ data = data.replace("@LOG_FILE_SIZE@", LOG_FILE_SIZE)
441+ with open(os.path.join("data", "logging.conf"), "wb") as logconf:
442+ logconf.write(data)
443+# pylint: enable=R0904
444+
445+
446+if __name__ == "__main__":
447+
448+ # pylint: disable=C0103
449+ # Add the installed copy to the PYTHONPATH
450+ sys.path.insert(0, os.path.join("installed", "Lib", "site-packages"))
451+
452+ console = [
453+ {
454+ 'script': 'bin/u1sdtool',
455+ },
456+ ]
457+
458+ windows = [
459+ {
460+ 'script': 'bin/ubuntuone-syncdaemon',
461+ 'icon_resources': [(0, 'ubuntu_one.ico')]
462+ },
463+ {
464+ 'script': 'bin/ubuntuone-control-panel-qt',
465+ 'icon_resources': [(0, 'ubuntu_one.ico')]
466+ },
467+ {
468+ 'script': 'bin/ubuntu-sso-login',
469+ 'icon_resources': [(0, 'ubuntu_one.ico')]
470+ },
471+ {
472+ 'script': 'bin/ubuntuone-installer-qt',
473+ 'icon_resources': [(0, 'ubuntu_one.ico')]
474+ },
475+ ]
476+
477+ if conf.SHOW_CMD == True:
478+ console.extend(windows)
479+ windows = []
480+
481+ # Build bundles
482+ setup(
483+ name='ubuntuone',
484+ version='2.0.3',
485+ license='GPL v3',
486+ author='',
487+ author_email='',
488+ description='Ubuntu One',
489+ url='https://one.ubuntu.com',
490+ cmdclass={
491+ 'py2exe': get_py2exe_extension(),
492+ 'fetch': FetchSources,
493+ 'prepare': PrepareSources,
494+ },
495+ console=console,
496+ windows=windows,
497+ options={
498+ 'py2exe': {
499+ 'includes': ['google.protobuf.descriptor',
500+ 'sip',
501+ 'twisted.web.resource',
502+ 'ubuntu_sso.qt',
503+ 'ubuntu_sso.qt.gui',
504+ 'PyQt4.QtNetwork',
505+ 'oauth',
506+ 'ubuntuone_installer',
507+ 'configglue',
508+ 'configglue.app',
509+ 'configglue.inischema',
510+ 'configglue.pyschema.glue',
511+ 'configglue.inischema.glue',
512+ 'configglue.inischema.parsers',
513+ ],
514+ 'excludes': ['fsm'],
515+ "dll_excludes": [
516+ "MSVCP90.dll",
517+ "MSWSOCK.dll",
518+ "mswsock.dll",
519+ "powrprof.dll",
520+ ],
521+ }})
522
523=== added file 'scripts/ubuntu_one.ico'
524Binary files scripts/ubuntu_one.ico 1970-01-01 00:00:00 +0000 and scripts/ubuntu_one.ico 2012-01-09 14:40:29 +0000 differ
525=== added file 'scripts/ubuntuone.xml'
526--- scripts/ubuntuone.xml 1970-01-01 00:00:00 +0000
527+++ scripts/ubuntuone.xml 2012-01-09 14:40:29 +0000
528@@ -0,0 +1,396 @@
529+<project>
530+ <shortName>ubuntuone</shortName>
531+ <fullName>Ubuntu One</fullName>
532+ <version>2.0.3</version>
533+ <componentList>
534+ <component>
535+ <name>autoupdater</name>
536+ <description>Includes tool to perform updates</description>
537+ <canBeEdited>0</canBeEdited>
538+ <selected>1</selected>
539+ <show>0</show>
540+ <folderList>
541+ <folder>
542+ <destination>${installdir}</destination>
543+ <name>autoupdaterwin</name>
544+ <platforms>windows</platforms>
545+ <distributionFileList>
546+ <distributionFile origin="autoupdate-windows.exe"/>
547+ </distributionFileList>
548+ </folder>
549+ </folderList>
550+ <postInstallationActionList>
551+ <writeFile>
552+ <path>${installdir}/update.ini</path>
553+ <text>[Update]
554+url = http://one.ubuntu.com/windows/update.xml
555+version_id = 203
556+check_for_updates = 1
557+</text>
558+ </writeFile>
559+ </postInstallationActionList>
560+ </component>
561+ <component>
562+ <name>default</name>
563+ <description>Default Component</description>
564+ <canBeEdited>1</canBeEdited>
565+ <selected>1</selected>
566+ <show>1</show>
567+ <desktopShortcutList>
568+ <shortcut>
569+ <comment></comment>
570+ <exec></exec>
571+ <icon></icon>
572+ <name>Ubuntu One</name>
573+ <path></path>
574+ <platforms>windows</platforms>
575+ <runAsAdmin>0</runAsAdmin>
576+ <runInTerminal>0</runInTerminal>
577+ <windowsExec>${installdir}\dist\ubuntuone-installer-qt.exe</windowsExec>
578+ <windowsExecArgs></windowsExecArgs>
579+ <windowsIcon>${installdir}/ubuntu_one.ico</windowsIcon>
580+ <windowsPath>${windows_folder_desktopdirectory}</windowsPath>
581+ </shortcut>
582+ </desktopShortcutList>
583+ <folderList>
584+ <folder>
585+ <description>Program Files</description>
586+ <destination>${installdir}</destination>
587+ <name>programfiles</name>
588+ <platforms>all</platforms>
589+ <shortcutList>
590+ <shortcut>
591+ <comment>Uninstall</comment>
592+ <exec>${installdir}/${uninstallerName}</exec>
593+ <icon></icon>
594+ <name>Uninstall ${product_fullname}</name>
595+ <path>${installdir}</path>
596+ <platforms>all</platforms>
597+ <runAsAdmin>1</runAsAdmin>
598+ <runInTerminal>0</runInTerminal>
599+ <windowsExec>${installdir}/${uninstallerName}.exe --mode win32</windowsExec>
600+ <windowsExecArgs></windowsExecArgs>
601+ <windowsIcon></windowsIcon>
602+ <windowsPath>${installdir}</windowsPath>
603+ </shortcut>
604+ </shortcutList>
605+ </folder>
606+ <folder>
607+ <description>Program Files</description>
608+ <destination>${installdir}</destination>
609+ <name>programfileslinux</name>
610+ <platforms>linux</platforms>
611+ </folder>
612+ <folder>
613+ <description>Program Files</description>
614+ <destination>${installdir}</destination>
615+ <name>programfileswindows</name>
616+ <platforms>windows</platforms>
617+ <distributionFileList>
618+ <distributionDirectory>
619+ <origin>dist</origin>
620+ </distributionDirectory>
621+ <distributionDirectory>
622+ <origin>data</origin>
623+ </distributionDirectory>
624+ <distributionFile>
625+ <origin>vcredist_x86.exe</origin>
626+ </distributionFile>
627+ <distributionFile>
628+ <origin>ubuntu_one.ico</origin>
629+ </distributionFile>
630+ </distributionFileList>
631+ </folder>
632+ <folder>
633+ <description>Program Files</description>
634+ <destination>${installdir}</destination>
635+ <name>programfilesosx</name>
636+ <platforms>osx</platforms>
637+ </folder>
638+ </folderList>
639+ <preInstallationActionList>
640+ <actionGroup>
641+ <actionList>
642+ <setInstallerVariable name="installationType" value="upgrade"/>
643+ </actionList>
644+
645+ <!-- We assume an existing installation if ${installdir}/uninstall.exe exists -->
646+ <ruleList>
647+ <fileTest condition="exists" path="${installdir}/uninstall.exe"/>
648+ </ruleList>
649+ </actionGroup>
650+ </preInstallationActionList>
651+ <startMenuShortcutList>
652+ <startMenuShortcut>
653+ <comment>Uninstall ${product_fullname}</comment>
654+ <name>Uninstall ${product_fullname}</name>
655+ <runAsAdmin>0</runAsAdmin>
656+ <runInTerminal>0</runInTerminal>
657+ <windowsExec>${installdir}/${uninstallerName}.exe</windowsExec>
658+ <windowsExecArgs>--mode win32</windowsExecArgs>
659+ <windowsIcon></windowsIcon>
660+ <windowsPath>${installdir}/</windowsPath>
661+ </startMenuShortcut>
662+ <startMenuShortcut>
663+ <comment>Ubuntu One</comment>
664+ <name>Ubuntu One</name>
665+ <runAsAdmin>0</runAsAdmin>
666+ <runInTerminal>0</runInTerminal>
667+ <windowsExec>${installdir}\dist\ubuntuone-installer-qt.exe</windowsExec>
668+ <windowsExecArgs></windowsExecArgs>
669+ <windowsIcon>${installdir}/ubuntu_one.ico</windowsIcon>
670+ <windowsPath>${windows_folder_desktopdirectory}</windowsPath>
671+ </startMenuShortcut>
672+ <startMenuFileShortcut>
673+ <comment></comment>
674+ <filePath>${windows_folder_profile}\Ubuntu One</filePath>
675+ <name>Ubuntu One Folder</name>
676+ <runAsAdmin>0</runAsAdmin>
677+ <runInTerminal>0</runInTerminal>
678+ <windowsIcon></windowsIcon>
679+ </startMenuFileShortcut>
680+ </startMenuShortcutList>
681+ </component>
682+ <component>
683+ <name>vcruntime</name>
684+ <canBeEdited>1</canBeEdited>
685+ <selected>1</selected>
686+ <show>1</show>
687+ <folderList>
688+ <folder>
689+ <destination>${installdir}</destination>
690+ <name>vcfiles</name>
691+ <platforms>all</platforms>
692+ <actionList>
693+ <runProgram>
694+ <abortOnError>0</abortOnError>
695+ <program>${installdir}/vcredist_x86.exe</program>
696+ <programArguments>/q
697+</programArguments>
698+ <progressText>Installing C++ runtime</progressText>
699+ <showMessageOnError>0</showMessageOnError>
700+ </runProgram>
701+ </actionList>
702+ <distributionFileList>
703+ <distributionFile>
704+ <origin>vcredist_x86.exe</origin>
705+ </distributionFile>
706+ </distributionFileList>
707+ </folder>
708+ </folderList>
709+ </component>
710+ </componentList>
711+ <initializationActionList>
712+ <setInstallerVariable name="msiexec" value=""/>
713+ <setInstallerVariable name="msiexec" persist="1" value="msiexec.exe">
714+ <ruleList>
715+ <programTest condition="is_in_path" name="msiexec.exe"/>
716+ </ruleList>
717+ </setInstallerVariable>
718+ <setInstallerVariable name="msiexec" persist="1" value="${windows_dir}/system32/msiexec.exe">
719+ <ruleList>
720+ <fileTest condition="exists" path="${windows_dir}/system32/msiexec.exe"/>
721+ <compareText logic="equals" text="${msiexec}" value=""/>
722+ </ruleList>
723+ </setInstallerVariable>
724+ <actionGroup>
725+ <actionList>
726+ <getWindowsFileVersionInfo path="${msiexec}" type="version" variable="msi_version"/>
727+ <setInstallerVariableFromRegEx name="msi_version" pattern="(^[0-9]+)\.([0-9]+)\..*" substitution="\1.\2" text="${msi_version}"/>
728+ </actionList>
729+ <ruleList>
730+ <compareText logic="does_not_equal" text="${msiexec}" value=""/>
731+ </ruleList>
732+ </actionGroup>
733+ <throwError>
734+ <ruleEvaluationLogic>or</ruleEvaluationLogic>
735+ <text>
736+You need at least Windows Installer MSI version 3.1.
737+</text>
738+ <ruleList>
739+ <compareText logic="equals" text="${msiexec}" value=""/>
740+ <compareValues logic="less" value1="${msi_version}" value2="3.1"/>
741+ </ruleList>
742+ </throwError>
743+ </initializationActionList>
744+ <postInstallationActionList>
745+ <registrySet>
746+ <key>HKEY_LOCAL_MACHINE\SOFTWARE\${project.fullName}\</key>
747+ <name>path-ubuntuone-syncdaemon</name>
748+ <type>REG_SZ</type>
749+ <value>${installdir}\dist\ubuntuone-syncdaemon.exe</value>
750+ </registrySet>
751+ <registrySet>
752+ <key>HKEY_LOCAL_MACHINE\SOFTWARE\${project.fullName}\</key>
753+ <name>path-ubuntu-sso-client</name>
754+ <type>REG_SZ</type>
755+ <value>${installdir}\dist\ubuntu-sso-login.exe</value>
756+ </registrySet>
757+ <runProgram>
758+ <program>${windows_folder_system}\RunDll32.exe</program>
759+ <programArguments>"${installdir}\dist\VistaLib32.dll" RunNonElevated "${installdir}\dist\ubuntuone-installer-qt.exe" --installer &amp;</programArguments>
760+ <useMSDOSPath>0</useMSDOSPath>
761+ <ruleList>
762+ <compareText>
763+ <logic>does_not_equal</logic>
764+ <text>${installationType}</text>
765+ <value>upgrade</value>
766+ </compareText>
767+ <platformTest>
768+ <type>windows-x86</type>
769+ </platformTest>
770+ </ruleList>
771+ </runProgram>
772+ <runProgram>
773+ <program>${windows_folder_system}\RunDll32.exe</program>
774+ <programArguments>"${installdir}\dist\VistaLib64.dll" RunNonElevated "${installdir}\dist\ubuntuone-installer-qt.exe" --installer &amp;</programArguments>
775+ <useMSDOSPath>0</useMSDOSPath>
776+ <ruleList>
777+ <compareText>
778+ <logic>does_not_equal</logic>
779+ <text>${installationType}</text>
780+ <value>upgrade</value>
781+ </compareText>
782+ <platformTest>
783+ <type>windows-x64</type>
784+ </platformTest>
785+ </ruleList>
786+ </runProgram>
787+ <showInfo>
788+ <text>Please reboot to finish upgrade.</text>
789+ <ruleList>
790+ <compareText>
791+ <logic>equals</logic>
792+ <text>${installationType}</text>
793+ <value>upgrade</value>
794+ </compareText>
795+ </ruleList>
796+ </showInfo>
797+ <createDirectory>
798+ <path>${windows_folder_common_appdata}\ubuntuone</path>
799+ </createDirectory>
800+ <createDirectory>
801+ <path>${windows_folder_common_appdata}\ubuntuone-storageprotocol</path>
802+ </createDirectory>
803+ <copyFile>
804+ <destination>${windows_folder_common_appdata}\ubuntuone</destination>
805+ <origin>${installdir}\data\syncdaemon.conf</origin>
806+ </copyFile>
807+ <copyFile>
808+ <destination>${windows_folder_common_appdata}\ubuntuone</destination>
809+ <origin>${installdir}\data\logging.conf</origin>
810+ </copyFile>
811+ <copyFile>
812+ <destination>${windows_folder_common_appdata}\ubuntuone-storageprotocol</destination>
813+ <origin>${installdir}\data\UbuntuOne-Go_Daddy_CA.pem</origin>
814+ </copyFile>
815+ <copyFile>
816+ <destination>${windows_folder_common_appdata}\ubuntuone-storageprotocol</destination>
817+ <origin>${installdir}\data\UbuntuOne-Go_Daddy_Class_2_CA.pem</origin>
818+ </copyFile>
819+ <deleteFile>
820+ <path>c:\install.exe</path>
821+ </deleteFile>
822+ <deleteFile>
823+ <path>c:\install.res.1028.dll</path>
824+ </deleteFile>
825+ <deleteFile>
826+ <path>c:\install.res.1031.dll</path>
827+ </deleteFile>
828+ <deleteFile>
829+ <path>c:\install.res.1033.dll</path>
830+ </deleteFile>
831+ <deleteFile>
832+ <path>c:\install.res.1036.dll</path>
833+ </deleteFile>
834+ <deleteFile>
835+ <path>c:\install.res.1040.dll</path>
836+ </deleteFile>
837+ <deleteFile>
838+ <path>c:\install.res.1041.dll</path>
839+ </deleteFile>
840+ <deleteFile>
841+ <path>c:\install.res.1042.dll</path>
842+ </deleteFile>
843+ <deleteFile>
844+ <path>c:\install.res.2052.dll</path>
845+ </deleteFile>
846+ <deleteFile>
847+ <path>c:\install.res.3082.dll</path>
848+ </deleteFile>
849+ <deleteFile>
850+ <path>c:\vcredist.bmp</path>
851+ </deleteFile>
852+ <deleteFile>
853+ <path>c:\globdata.ini</path>
854+ </deleteFile>
855+ <deleteFile>
856+ <path>c:\install.ini</path>
857+ </deleteFile>
858+ <deleteFile>
859+ <path>c:\eula.1028.txt</path>
860+ </deleteFile>
861+ <deleteFile>
862+ <path>c:\eula.1031.txt</path>
863+ </deleteFile>
864+ <deleteFile>
865+ <path>c:\eula.1033.txt</path>
866+ </deleteFile>
867+ <deleteFile>
868+ <path>c:\eula.1036.txt</path>
869+ </deleteFile>
870+ <deleteFile>
871+ <path>c:\eula.1040.txt</path>
872+ </deleteFile>
873+ <deleteFile>
874+ <path>c:\eula.1041.txt</path>
875+ </deleteFile>
876+ <deleteFile>
877+ <path>c:\eula.1042.txt</path>
878+ </deleteFile>
879+ <deleteFile>
880+ <path>c:\eula.2052.txt</path>
881+ </deleteFile>
882+ <deleteFile>
883+ <path>c:\eula.3082.txt</path>
884+ </deleteFile>
885+ <deleteFile>
886+ <path>c:\vc_red.msi</path>
887+ </deleteFile>
888+ <deleteFile>
889+ <path>c:\vc_red.cab</path>
890+ </deleteFile>
891+ </postInstallationActionList>
892+ <compressionAlgorithm>lzma</compressionAlgorithm>
893+ <defaultInstallationMode>unattended</defaultInstallationMode>
894+ <disableSplashScreen>1</disableSplashScreen>
895+ <enableRollback>1</enableRollback>
896+ <enableTimestamp>1</enableTimestamp>
897+ <installationLogFile>${installdir}/install.log</installationLogFile>
898+ <saveRelativePaths>1</saveRelativePaths>
899+ <unattendedModeUI>minimal</unattendedModeUI>
900+ <vendor>Canonical</vendor>
901+ <windowsSoftwareRegistryPrefix>${product_fullname}</windowsSoftwareRegistryPrefix>
902+ <customLanguageFileList>
903+ <language>
904+ <code>en</code>
905+ <file>customlang/ubuntuone_en.lng</file>
906+ </language>
907+ </customLanguageFileList>
908+ <parameterList>
909+ <directoryParameter>
910+ <name>installdir</name>
911+ <description>Installer.Parameter.installdir.description</description>
912+ <explanation>Installer.Parameter.installdir.explanation</explanation>
913+ <value></value>
914+ <default>${platform_install_prefix}/${product_shortname}</default>
915+ <allowEmptyValue>0</allowEmptyValue>
916+ <ask>0</ask>
917+ <cliOptionName>prefix</cliOptionName>
918+ <mustBeWritable>1</mustBeWritable>
919+ <mustExist>0</mustExist>
920+ <width>40</width>
921+ </directoryParameter>
922+ </parameterList>
923+</project>
924+
925
926=== added file 'scripts/ubuntuone_autoupdate.xml'
927--- scripts/ubuntuone_autoupdate.xml 1970-01-01 00:00:00 +0000
928+++ scripts/ubuntuone_autoupdate.xml 2012-01-09 14:40:29 +0000
929@@ -0,0 +1,9 @@
930+<autoUpdateProject>
931+ <fullName>Ubuntu One</fullName>
932+ <shortName>ubuntuone</shortName>
933+ <vendor>Canonical</vendor>
934+ <version>203</version>
935+ <singleInstanceCheck>1</singleInstanceCheck>
936+ <requireInstallationByRootUser>0</requireInstallationByRootUser>
937+ <requestedExecutionLevel>asInvoker</requestedExecutionLevel>
938+</autoUpdateProject>
939
940=== modified file 'ubuntuone_installer/gui/qt/sync_now_or_later.py'
941--- ubuntuone_installer/gui/qt/sync_now_or_later.py 2011-09-09 14:33:19 +0000
942+++ ubuntuone_installer/gui/qt/sync_now_or_later.py 2012-01-09 14:40:29 +0000
943@@ -1,6 +1,4 @@
944 # -*- coding: utf-8 -*-
945-
946-# Authors: Roberto Alsina <roberto.alsina@canonical.com>
947 #
948 # Copyright 2011 Canonical Ltd.
949 #

Subscribers

People subscribed via source and target branches