1
1
#import " CCPackageInstaller.h"
2
2
#import " CCPackageConstants.h"
3
3
#import " CCPackage.h"
4
- #import " CCPackageInstallData.h"
5
- #import " CCPackage+InstallData.h"
6
- #import " CCPackageCocos2dEnabler.h"
7
4
#import " ccMacros.h"
8
5
9
6
@@ -34,10 +31,13 @@ - (instancetype)initWithPackage:(CCPackage *)package installPath:(NSString *)ins
34
31
35
32
- (BOOL )installWithError : (NSError **)error
36
33
{
34
+
35
+ /* TODO
37
36
CCPackageInstallData *installData = [_package installData];
38
37
39
38
NSAssert(installData != nil, @"installData must not be nil");
40
39
NSAssert(installData.unzipURL != nil, @"installData.unzipURL must not be nil");
40
+ */
41
41
42
42
if (![self unzippedPackageFolderExists: error])
43
43
{
@@ -58,16 +58,17 @@ - (BOOL)installWithError:(NSError **)error
58
58
59
59
- (BOOL )movePackageToInstallPathWithError : (NSError **)error
60
60
{
61
- CCPackageInstallData *installData = [_package installData ];
61
+ // TODO
62
+ // CCPackageInstallData *installData = [_package installData];
62
63
63
- NSAssert (installData .unzipURL != nil , @" installData .unzipURL must not be nil." );
64
- NSAssert (installData .folderName != nil , @" installData .folderName must not be nil." );
64
+ NSAssert (_package .unzipURL != nil , @" package .unzipURL must not be nil." );
65
+ NSAssert (_package .folderName != nil , @" package .folderName must not be nil." );
65
66
66
- [_package setValue: [NSURL fileURLWithPath: [_installPath stringByAppendingPathComponent: installData .folderName]] forKey: @" installURL" ];
67
+ [_package setValue: [NSURL fileURLWithPath: [_installPath stringByAppendingPathComponent: _package .folderName]] forKey: @" installURL" ];
67
68
68
69
NSError *errorMove;
69
70
NSFileManager *fileManager = [NSFileManager defaultManager ];
70
- if (![fileManager moveItemAtPath: [installData .unzipURL.path stringByAppendingPathComponent: installData .folderName]
71
+ if (![fileManager moveItemAtPath: [_package .unzipURL.path stringByAppendingPathComponent: _package .folderName]
71
72
toPath: _package.installURL.path
72
73
error: &errorMove])
73
74
{
@@ -88,15 +89,18 @@ - (BOOL)movePackageToInstallPathWithError:(NSError **)error
88
89
89
90
- (BOOL )unzippedPackageFolderExists : (NSError **)error
90
91
{
92
+ /* TODO
91
93
CCPackageInstallData *installData = [_package installData];
92
94
NSAssert(installData.unzipURL, @"installData.unzipURL must not be nil");
95
+ */
96
+ NSAssert (_package.unzipURL != nil , @" package.unzipURL must not be nil." );
93
97
94
98
NSFileManager *fileManager = [NSFileManager defaultManager ];
95
- if (![fileManager fileExistsAtPath: installData .unzipURL.path])
99
+ if (![fileManager fileExistsAtPath: _package .unzipURL.path])
96
100
{
97
101
[self setNewError: error
98
102
code: PACKAGE_ERROR_INSTALL_UNZIPPED_PACKAGE_NOT_FOUND
99
- message: [NSString stringWithFormat: @" Package to install not found at path \" %@ \" " , installData .unzipURL]];
103
+ message: [NSString stringWithFormat: @" Package to install not found at path \" %@ \" " , _package .unzipURL]];
100
104
101
105
CCLOG (@" [PACKAGE/INSTALL][ERROR] Moving unzipped package to installation folder, package already exists! %@ " , *error);
102
106
return NO ;
0 commit comments