Merge lp:~mandel/ubuntuone-windows-installer/add_reg_installation_path into lp:ubuntuone-windows-installer/beta

Proposed by Manuel de la Peña
Status: Merged
Approved by: Rick McBride
Approved revision: 101
Merged at revision: 100
Proposed branch: lp:~mandel/ubuntuone-windows-installer/add_reg_installation_path
Merge into: lp:ubuntuone-windows-installer/beta
Prerequisite: lp:~mandel/ubuntuone-windows-installer/make_anycpu_projects
Diff against target: 268 lines (+66/-16)
11 files modified
build.number (+1/-1)
install/UbuntuOne7.wxs (+8/-0)
install/UbuntuOneXP.wxs (+8/-0)
src/Canonical.Ubuntu.SSO.Tests/KeyringFixture.cs (+1/-0)
src/Canonical.Ubuntu.SSO/Canonical.Ubuntu.SSO.csproj (+0/-2)
src/Canonical.Ubuntu.SSO/Keyring.cs (+1/-0)
src/Canonical.UbuntuOne.Client/Notification/NotificationIconPresenter.cs (+39/-7)
src/Canonical.UbuntuOne.Common/Canonical.UbuntuOne.Common.csproj (+2/-0)
src/Canonical.UbuntuOne.Common/Win32/IRegistryKey.cs (+1/-1)
src/Canonical.UbuntuOne.Common/Win32/RegistryKeyWrapper.cs (+2/-2)
src/Version.cs (+3/-3)
To merge this branch: bzr merge lp:~mandel/ubuntuone-windows-installer/add_reg_installation_path
Reviewer Review Type Date Requested Status
Rick McBride (community) Approve
John Lenton (community) Approve
Review via email: mp+37776@code.launchpad.net

Description of the change

Fix lp:629510 by adding a registry key during the installation with the path used. Later use the registry key to know where the location of u1sync is.

To post a comment you must log in.
Revision history for this message
John Lenton (chipaca) :
review: Approve
Revision history for this message
Rick McBride (rmcbride) wrote :

I got text conflicts when merging this into trunk + prerequisites:

Text conflict in build.number
Text conflict in src/Version.css

review: Needs Fixing
Revision history for this message
Rick McBride (rmcbride) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'build.number'
2--- build.number 2010-08-10 12:18:28 +0000
3+++ build.number 2010-10-06 18:34:40 +0000
4@@ -1,1 +1,1 @@
5-1.0.409.6549
6+1.0.606.5623
7\ No newline at end of file
8
9=== modified file 'install/UbuntuOne7.wxs'
10--- install/UbuntuOne7.wxs 2010-10-06 18:34:40 +0000
11+++ install/UbuntuOne7.wxs 2010-10-06 18:34:40 +0000
12@@ -42,6 +42,13 @@
13
14 <Directory Id="TARGETDIR"
15 Name="SourceDir">
16+ <Component Id="RegistryEntries" Guid="76925500-d14e-11df-bd3b-0800200c9a66">
17+ <RegistryKey Root="HKLM"
18+ Key="Software\Canonical\UbuntuOne"
19+ Action="createAndRemoveOnUninstall">
20+ <RegistryValue Type="string" Name="InstallationPath" Value="[U1Installdir]"/>
21+ </RegistryKey>
22+ </Component>
23 <Directory Id="ProgramMenuFolder"
24 Name="Programs" >
25 <Directory Id="ApplicationProgramsFolder" Name="Ubuntu One">
26@@ -934,6 +941,7 @@
27 Title="Ubuntu One"
28 Description="Ubuntu One is the personal cloud service that simplifies your digital life.">
29 <!-- common data -->
30+ <ComponentRef Id="RegistryEntries" />
31 <ComponentRef Id="ApplicationShortcut" />
32 <ComponentRef Id="UbuntuOneGoDaddyCAComponent" />
33 <ComponentRef Id="UbuntuOneGoDaddyClass2CAComponent" />
34
35=== modified file 'install/UbuntuOneXP.wxs'
36--- install/UbuntuOneXP.wxs 2010-10-06 18:34:40 +0000
37+++ install/UbuntuOneXP.wxs 2010-10-06 18:34:40 +0000
38@@ -42,6 +42,13 @@
39
40 <Directory Id="TARGETDIR"
41 Name="SourceDir">
42+ <Component Id="RegistryEntries" Guid="76925500-d14e-11df-bd3b-0800200c9a66">
43+ <RegistryKey Root="HKLM"
44+ Key="Software\Canonical\UbuntuOne"
45+ Action="createAndRemoveOnUninstall">
46+ <RegistryValue Type="string" Name="InstallationPath" Value="[U1Installdir]"/>
47+ </RegistryKey>
48+ </Component>
49 <Directory Id="ProgramMenuFolder"
50 Name="Programs">
51 <Directory Id="ApplicationProgramsFolder" Name="Ubuntu One">
52@@ -731,6 +738,7 @@
53 Title="Ubuntu One"
54 Description="Ubuntu One is the personal cloud service that simplifies your digital life.">
55 <!-- common data -->
56+ <ComponentRef Id="RegistryEntries" />
57 <ComponentRef Id="ApplicationShortcut" />
58 <ComponentRef Id="UbuntuOneGoDaddyCAComponent" />
59 <ComponentRef Id="UbuntuOneGoDaddyClass2CAComponent" />
60
61=== modified file 'src/Canonical.Ubuntu.SSO.Tests/KeyringFixture.cs'
62--- src/Canonical.Ubuntu.SSO.Tests/KeyringFixture.cs 2010-10-06 18:34:40 +0000
63+++ src/Canonical.Ubuntu.SSO.Tests/KeyringFixture.cs 2010-10-06 18:34:40 +0000
64@@ -20,6 +20,7 @@
65 using System.Linq;
66 using System.Security.Cryptography;
67 using System.Text;
68+using Canonical.UbuntuOne.Common.Win32;
69 using Microsoft.Win32;
70 using NUnit.Framework;
71 using Rhino.Mocks;
72
73=== modified file 'src/Canonical.Ubuntu.SSO/Canonical.Ubuntu.SSO.csproj'
74--- src/Canonical.Ubuntu.SSO/Canonical.Ubuntu.SSO.csproj 2010-10-06 18:34:40 +0000
75+++ src/Canonical.Ubuntu.SSO/Canonical.Ubuntu.SSO.csproj 2010-10-06 18:34:40 +0000
76@@ -70,14 +70,12 @@
77 <Compile Include="ILoginOrRegisterView.cs" />
78 <Compile Include="ILoginView.cs" />
79 <Compile Include="IOAuth.cs" />
80- <Compile Include="IRegistryKey.cs" />
81 <Compile Include="ISSOCredentialsEncoder.cs" />
82 <Compile Include="ISSOLoginProcessor.cs" />
83 <Compile Include="JsonSSOCredentialsEncoder.cs" />
84 <Compile Include="Keyring.cs" />
85 <Compile Include="LoginCredentialsEventArgs.cs" />
86 <Compile Include="OAuth.cs" />
87- <Compile Include="RegistryKeyWrapper.cs" />
88 <Compile Include="Service\Account.cs" />
89 <Compile Include="Service\AccountDiff.cs" />
90 <Compile Include="Service\AccountFull.cs" />
91
92=== modified file 'src/Canonical.Ubuntu.SSO/Keyring.cs'
93--- src/Canonical.Ubuntu.SSO/Keyring.cs 2010-10-06 18:34:40 +0000
94+++ src/Canonical.Ubuntu.SSO/Keyring.cs 2010-10-06 18:34:40 +0000
95@@ -23,6 +23,7 @@
96 using System.Text;
97 using Canonical.UbuntuOne.Common.Aop;
98 using Canonical.UbuntuOne.Common.Validation;
99+using Canonical.UbuntuOne.Common.Win32;
100 using log4net;
101 using Microsoft.Win32;
102
103
104=== modified file 'src/Canonical.UbuntuOne.Client/Notification/NotificationIconPresenter.cs'
105--- src/Canonical.UbuntuOne.Client/Notification/NotificationIconPresenter.cs 2010-10-06 18:34:40 +0000
106+++ src/Canonical.UbuntuOne.Client/Notification/NotificationIconPresenter.cs 2010-10-06 18:34:40 +0000
107@@ -25,6 +25,7 @@
108 using Canonical.UbuntuOne.Common.Aop;
109 using Canonical.UbuntuOne.Common.Utils;
110 using log4net;
111+using Microsoft.Win32;
112
113 namespace Canonical.UbuntuOne.Client.Notification
114 {
115@@ -52,7 +53,8 @@
116 private ISSOCredentialsProvider _ssoProvider;
117 private ILog _logger;
118 private readonly object _loggerLock = new object();
119-
120+ private string _u1SyncPath;
121+ private readonly object _u1SyncPathLock = new object();
122
123 #endregion
124
125@@ -151,6 +153,36 @@
126 set { _logger = value; }
127 }
128
129+ private string U1SyncPath
130+ {
131+ get
132+ {
133+ if (_u1SyncPath == null)
134+ {
135+ lock (_u1SyncPathLock)
136+ {
137+ try
138+ {
139+ using (var softwareEntry = Registry.LocalMachine.OpenSubKey("SOFTWARE"))
140+ using (var canonicalEntry = softwareEntry.OpenSubKey("Canonical"))
141+ using (var ubuntuOneEntry = canonicalEntry.OpenSubKey("UbuntuOne"))
142+ {
143+ _u1SyncPath = (string) ubuntuOneEntry.GetValue("InstallationPath");
144+ _u1SyncPath = Path.Combine(_u1SyncPath, "Client");
145+ _u1SyncPath = Path.Combine(_u1SyncPath, "U1Sync");
146+ }
147+ }
148+ catch(NullReferenceException)
149+ {
150+ // thrown when we did not find the key, that is, not correct installation
151+ Logger.Error("Registry key HKLM/Software/Canonical/UbuntuOne is not present!!!");
152+ }
153+ }
154+ }
155+ return _u1SyncPath;
156+ }
157+ }
158+
159 #endregion
160
161 #region Constructors
162@@ -247,15 +279,15 @@
163 {
164 StartInfo =
165 {
166- WorkingDirectory = @"C:\Program Files\Canonical\UbuntuOne\Client\U1Sync",
167- FileName = @"C:\Program Files\Canonical\UbuntuOne\Client\U1Sync\main.exe",
168+ WorkingDirectory = U1SyncPath,
169+ FileName = Path.Combine(U1SyncPath, "main.exe"),
170 Arguments = String.Format(" --init \"{0}\" --oauth {1}", oneDir, tokens),
171 UseShellExecute = false,
172 RedirectStandardOutput = true,
173 RedirectStandardError = true,
174 CreateNoWindow = true,
175 WindowStyle = ProcessWindowStyle.Hidden
176-
177+
178 }
179 };
180 Logger.InfoFormat("Executing u1sync with args: {0}", init.StartInfo.Arguments);
181@@ -264,15 +296,15 @@
182 Logger.InfoFormat("StandarOutput from u1sync is: {0}", init.StandardOutput.ReadToEnd());
183 Logger.ErrorFormat("StandardError from u1sync is: {0}", init.StandardError.ReadToEnd());
184 init.Close();
185-
186+
187 }
188
189 var proc = new Process
190 {
191 StartInfo =
192 {
193- WorkingDirectory = @"C:\Program Files\Canonical\UbuntuOne\Client\U1Sync",
194- FileName = @"C:\Program Files\Canonical\UbuntuOne\Client\U1Sync\main.exe",
195+ WorkingDirectory = U1SyncPath,
196+ FileName = Path.Combine(U1SyncPath, "main.exe"),
197 Arguments = String.Format("\"{0}\" --oauth {1}", oneDir, tokens),
198 UseShellExecute = false,
199 RedirectStandardOutput = true,
200
201=== modified file 'src/Canonical.UbuntuOne.Common/Canonical.UbuntuOne.Common.csproj'
202--- src/Canonical.UbuntuOne.Common/Canonical.UbuntuOne.Common.csproj 2010-10-06 18:34:40 +0000
203+++ src/Canonical.UbuntuOne.Common/Canonical.UbuntuOne.Common.csproj 2010-10-06 18:34:40 +0000
204@@ -139,6 +139,8 @@
205 <Compile Include="Validation\ValidationException.cs" />
206 <Compile Include="Validation\ValidationExtensions.cs" />
207 <Compile Include="Utils\Webbrowser.cs" />
208+ <Compile Include="Win32\IRegistryKey.cs" />
209+ <Compile Include="Win32\RegistryKeyWrapper.cs" />
210 </ItemGroup>
211 <ItemGroup>
212 <Reference Include="DotUpdater, Version=0.2.0.4, Culture=neutral, processorArchitecture=MSIL">
213
214=== added directory 'src/Canonical.UbuntuOne.Common/Win32'
215=== renamed file 'src/Canonical.Ubuntu.SSO/IRegistryKey.cs' => 'src/Canonical.UbuntuOne.Common/Win32/IRegistryKey.cs'
216--- src/Canonical.Ubuntu.SSO/IRegistryKey.cs 2010-09-08 15:29:50 +0000
217+++ src/Canonical.UbuntuOne.Common/Win32/IRegistryKey.cs 2010-10-06 18:34:40 +0000
218@@ -21,7 +21,7 @@
219 using System;
220 using Microsoft.Win32;
221
222-namespace Canonical.Ubuntu.SSO
223+namespace Canonical.UbuntuOne.Common.Win32
224 {
225 /// <summary>
226 /// Interface that represents a class that allows to perform the access to
227
228=== renamed file 'src/Canonical.Ubuntu.SSO/RegistryKeyWrapper.cs' => 'src/Canonical.UbuntuOne.Common/Win32/RegistryKeyWrapper.cs'
229--- src/Canonical.Ubuntu.SSO/RegistryKeyWrapper.cs 2010-10-06 18:34:40 +0000
230+++ src/Canonical.UbuntuOne.Common/Win32/RegistryKeyWrapper.cs 2010-10-06 18:34:40 +0000
231@@ -23,7 +23,7 @@
232 using log4net;
233 using Microsoft.Win32;
234
235-namespace Canonical.Ubuntu.SSO
236+namespace Canonical.UbuntuOne.Common.Win32
237 {
238 /// <summary>
239 /// Simple wrapper around the registry class that allows the class to be mocked for testing
240@@ -53,7 +53,7 @@
241 {
242 lock (_loggerLock)
243 {
244- _logger = LogManager.GetLogger(typeof(Keyring));
245+ _logger = LogManager.GetLogger(typeof(RegistryKeyWrapper));
246 }
247 }
248 return _logger;
249
250=== modified file 'src/Version.cs'
251--- src/Version.cs 2010-08-10 12:18:28 +0000
252+++ src/Version.cs 2010-10-06 18:34:40 +0000
253@@ -3,13 +3,13 @@
254 //------------------------------------------------------------------------------
255 // <auto-generated>
256 // This code was generated by a tool.
257-// Runtime Version:2.0.50727.4927
258+// Runtime Version:2.0.50727.4952
259 //
260 // Changes to this file may cause incorrect behavior and will be lost if
261 // the code is regenerated.
262 // </auto-generated>
263 //------------------------------------------------------------------------------
264
265-[assembly: AssemblyVersionAttribute("1.0.409.6549")]
266-[assembly: AssemblyFileVersionAttribute("1.0.409.6549")]
267+[assembly: AssemblyVersionAttribute("1.0.606.5623")]
268+[assembly: AssemblyFileVersionAttribute("1.0.606.5623")]
269

Subscribers

People subscribed via source and target branches

to all changes: