shoes 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +12 -0
- data/CHANGELOG +29 -0
- data/COPYING +30 -0
- data/README.md +76 -0
- data/README.old +117 -0
- data/Rakefile +130 -0
- data/Rakefile.bk +651 -0
- data/app.yaml +7 -0
- data/bin/main.skel +104 -0
- data/bugs/issue-012e9468ddc7b0cb7e1503413a8a11c4f8707b67.yaml +21 -0
- data/bugs/issue-0711ff8b67baa63586f11d0096fee9dd4436bf58.yaml +23 -0
- data/bugs/issue-07f87998d93eb401e22395c11085676389b935c4.yaml +22 -0
- data/bugs/issue-0bff2d80008803cbc7efbcdacdc60ef2163664d2.yaml +22 -0
- data/bugs/issue-0c66f223d19efbca7b692f3b91961f407ad7abec.yaml +24 -0
- data/bugs/issue-183bc3c7a8f575aff2b24e0bf22aa0dfcc8e4fc2.yaml +29 -0
- data/bugs/issue-1bad1e60a04cb3adb6a8f3ded128af2e16b56ffe.yaml +18 -0
- data/bugs/issue-1f1d43f76bf4de79d7f94adbae6dd506a9d81633.yaml +41 -0
- data/bugs/issue-320924117cadb045cc91f2a6fca922b4d81d4bb5.yaml +20 -0
- data/bugs/issue-33e5c8355fbf65252ea9e939714651df8bd8cb3b.yaml +25 -0
- data/bugs/issue-36f7c8262a72bcd5e28cfa4ed29328b8237ea79b.yaml +20 -0
- data/bugs/issue-39bf04ee50c3bef67b89b8e9beb28657805587ce.yaml +18 -0
- data/bugs/issue-3e28ba7754f73d02ef416eef989af707a8c00f01.yaml +23 -0
- data/bugs/issue-3f638cc03f41f9c3fdf217355321f1563f8fee45.yaml +22 -0
- data/bugs/issue-41e48e14f1ef4f6deb69be68165d7dd3ffd99156.yaml +22 -0
- data/bugs/issue-4c9408166a2aa5dd333bbb05520deebf4ded08e0.yaml +22 -0
- data/bugs/issue-55c687e108ecd5aeb8e0d0aeb4294984f84acd3e.yaml +18 -0
- data/bugs/issue-5811d34692cc292717a58ec1df1f8948cf30d826.yaml +28 -0
- data/bugs/issue-5a7c1f59a0526f9cea7fb366867cf1e6ed8ef69d.yaml +22 -0
- data/bugs/issue-688a2c2566bef6a03efa57a4ae1f7cfa8fc74444.yaml +21 -0
- data/bugs/issue-78b16c7988ade2ef96e716fa8cb9a004bd4ced65.yaml +33 -0
- data/bugs/issue-804ee49f9800154eddf0650690c7a9bb5626253f.yaml +27 -0
- data/bugs/issue-807dd1c610b2e941a5d454e26b2eac27e89a0ab4.yaml +22 -0
- data/bugs/issue-822ee33ec11ebd25f90ea86e8438de7891e63aee.yaml +18 -0
- data/bugs/issue-82ff7152cebb8a1cb065b864cb4fe22de2328146.yaml +29 -0
- data/bugs/issue-856afbdcdd4970ad54b8ce4a6c017fbaab45f49d.yaml +31 -0
- data/bugs/issue-8d49e32fb21522651c67490adb4d80076dbb14e1.yaml +24 -0
- data/bugs/issue-91583359653a9d530c1e32be72d874d847a306e7.yaml +21 -0
- data/bugs/issue-af41a5229613172764e7d3c98431172db337053d.yaml +20 -0
- data/bugs/issue-bd9856b3788dd429c998a5af1b2aae8221cb80b7.yaml +28 -0
- data/bugs/issue-be22aef5c564fb7b5e9938343136a9cd6a2edb7b.yaml +22 -0
- data/bugs/issue-bf8697523c77c326e7e35fc82cf3dd739ae92310.yaml +27 -0
- data/bugs/issue-cdd4b4795f34d6ff46e56ece10f8216a4a5456b2.yaml +25 -0
- data/bugs/issue-d9bfb5581d745ef9deb3b9b2e08ef74d1cd43082.yaml +20 -0
- data/bugs/issue-e0ce2f687cc096f35715d28b0af88589f4ab6cc6.yaml +18 -0
- data/bugs/issue-e4b0aca4a10a574b333aeaecaaf221dbc5ed22c6.yaml +38 -0
- data/bugs/issue-f263746594b95ba778455730478ee8df60ee639d.yaml +22 -0
- data/bugs/project.yaml +72 -0
- data/builddeps.sh +102 -0
- data/fonts/Coolvetica.ttf +0 -0
- data/fonts/Lacuna.ttf +0 -0
- data/gemlib/shoes.rb +1 -0
- data/lib/shoes.rb +548 -0
- data/lib/shoes/cache.rb +54 -0
- data/lib/shoes/chipmunk.rb +35 -0
- data/lib/shoes/data.rb +39 -0
- data/lib/shoes/help.rb +468 -0
- data/lib/shoes/image.rb +25 -0
- data/lib/shoes/inspect.rb +128 -0
- data/lib/shoes/log.rb +48 -0
- data/lib/shoes/minitar.rb +986 -0
- data/lib/shoes/override.rb +38 -0
- data/lib/shoes/pack.rb +543 -0
- data/lib/shoes/search.rb +46 -0
- data/lib/shoes/setup.rb +329 -0
- data/lib/shoes/shy.rb +131 -0
- data/lib/shoes/shybuilder.rb +44 -0
- data/lib/shoes/version.rb +3 -0
- data/make/darwin/deps.vlc +12 -0
- data/make/darwin/dylibs.shoes +22 -0
- data/make/darwin/dylibs.video +11 -0
- data/make/darwin/env.rb +81 -0
- data/make/darwin/tasks.rb +105 -0
- data/make/linux/env.rb +65 -0
- data/make/linux/tasks.rb +61 -0
- data/make/make.rb +85 -0
- data/make/mingw/dlls +19 -0
- data/make/mingw/env.rb +69 -0
- data/make/mingw/tasks.rb +70 -0
- data/make/rakefile_common.rb +8 -0
- data/manual-snapshots/class-book.png +0 -0
- data/manual-snapshots/expert-definr.png +0 -0
- data/manual-snapshots/expert-funnies.png +0 -0
- data/manual-snapshots/expert-irb.png +0 -0
- data/manual-snapshots/expert-minesweeper.png +0 -0
- data/manual-snapshots/expert-othello.png +0 -0
- data/manual-snapshots/expert-pong.png +0 -0
- data/manual-snapshots/expert-tankspank.png +0 -0
- data/manual-snapshots/good-arc.png +0 -0
- data/manual-snapshots/good-clock.png +0 -0
- data/manual-snapshots/good-follow.png +0 -0
- data/manual-snapshots/good-reminder.png +0 -0
- data/manual-snapshots/good-vjot.png +0 -0
- data/manual-snapshots/simple-accordion.png +0 -0
- data/manual-snapshots/simple-anim-shapes.png +0 -0
- data/manual-snapshots/simple-anim-text.png +0 -0
- data/manual-snapshots/simple-arc.png +0 -0
- data/manual-snapshots/simple-bounce.png +0 -0
- data/manual-snapshots/simple-calc.png +0 -0
- data/manual-snapshots/simple-chipmunk.png +0 -0
- data/manual-snapshots/simple-control-sizes.png +0 -0
- data/manual-snapshots/simple-curve.png +0 -0
- data/manual-snapshots/simple-dialogs.png +0 -0
- data/manual-snapshots/simple-downloader.png +0 -0
- data/manual-snapshots/simple-draw.png +0 -0
- data/manual-snapshots/simple-editor.png +0 -0
- data/manual-snapshots/simple-form.png +0 -0
- data/manual-snapshots/simple-mask.png +0 -0
- data/manual-snapshots/simple-menu.png +0 -0
- data/manual-snapshots/simple-menu1.png +0 -0
- data/manual-snapshots/simple-rubygems.png +0 -0
- data/manual-snapshots/simple-slide.png +0 -0
- data/manual-snapshots/simple-sphere.png +0 -0
- data/manual-snapshots/simple-sqlite3.png +0 -0
- data/manual-snapshots/simple-timer.png +0 -0
- data/manual-snapshots/simple-video.png +0 -0
- data/platform/mac/Info.plist +55 -0
- data/platform/mac/build-deps.sh +658 -0
- data/platform/mac/command-manual.rb +1 -0
- data/platform/mac/deps-osx.patch +159 -0
- data/platform/mac/dmg_ds_store +0 -0
- data/platform/mac/pangorc +2 -0
- data/platform/mac/pkg-dmg +1447 -0
- data/platform/mac/shoes +31 -0
- data/platform/mac/shoes-launch +7 -0
- data/platform/mac/stub.m +178 -0
- data/platform/mac/version.plist +14 -0
- data/platform/msw/base.nsi +644 -0
- data/platform/msw/installer-1.bmp +0 -0
- data/platform/msw/installer-2.bmp +0 -0
- data/platform/msw/shoes.exe.manifest +17 -0
- data/platform/msw/shoes.ico +0 -0
- data/platform/msw/stub-inject.c +59 -0
- data/platform/msw/stub.c +271 -0
- data/platform/msw/stub32.h +14 -0
- data/platform/msw/stub32.rc +16 -0
- data/platform/nix/INSTALL +56 -0
- data/platform/nix/Makefile +144 -0
- data/platform/nix/shoes.launch +20 -0
- data/platform/skel.rb +27 -0
- data/rakefile_darwin.rb +7 -0
- data/rakefile_linux.rb +3 -0
- data/rakefile_mingw.rb +7 -0
- data/samples/class-book.rb +43 -0
- data/samples/class-book.yaml +387 -0
- data/samples/expert-definr.rb +23 -0
- data/samples/expert-funnies.rb +51 -0
- data/samples/expert-irb.rb +112 -0
- data/samples/expert-minesweeper.rb +267 -0
- data/samples/expert-othello.rb +319 -0
- data/samples/expert-pong.rb +62 -0
- data/samples/expert-tankspank.rb +385 -0
- data/samples/good-arc.rb +37 -0
- data/samples/good-clock.rb +51 -0
- data/samples/good-follow.rb +26 -0
- data/samples/good-reminder.rb +174 -0
- data/samples/good-vjot.rb +56 -0
- data/samples/simple-accordion.rb +75 -0
- data/samples/simple-anim-shapes.rb +17 -0
- data/samples/simple-anim-text.rb +13 -0
- data/samples/simple-arc.rb +23 -0
- data/samples/simple-bounce.rb +24 -0
- data/samples/simple-calc.rb +70 -0
- data/samples/simple-chipmunk.rb +26 -0
- data/samples/simple-control-sizes.rb +24 -0
- data/samples/simple-curve.rb +26 -0
- data/samples/simple-dialogs.rb +29 -0
- data/samples/simple-downloader.rb +27 -0
- data/samples/simple-draw.rb +13 -0
- data/samples/simple-editor.rb +28 -0
- data/samples/simple-form.rb +28 -0
- data/samples/simple-form.shy +0 -0
- data/samples/simple-mask.rb +21 -0
- data/samples/simple-menu.rb +31 -0
- data/samples/simple-menu1.rb +35 -0
- data/samples/simple-rubygems.rb +29 -0
- data/samples/simple-slide.rb +45 -0
- data/samples/simple-sphere.rb +28 -0
- data/samples/simple-sqlite3.rb +13 -0
- data/samples/simple-timer.rb +13 -0
- data/samples/simple-video.rb +13 -0
- data/shoes.gemspec +21 -0
- data/shoes/app.c +591 -0
- data/shoes/app.h +110 -0
- data/shoes/appwin32.h +13 -0
- data/shoes/appwin32.rc +28 -0
- data/shoes/canvas.c +2202 -0
- data/shoes/canvas.h +682 -0
- data/shoes/code.h +14 -0
- data/shoes/config.h +232 -0
- data/shoes/effects.c +243 -0
- data/shoes/effects.h +7 -0
- data/shoes/http.h +44 -0
- data/shoes/http/common.h +86 -0
- data/shoes/http/curl.c +259 -0
- data/shoes/http/nsurl.m +274 -0
- data/shoes/http/windownload.c +114 -0
- data/shoes/http/winhttp.c +216 -0
- data/shoes/http/winhttp.h +19 -0
- data/shoes/image.c +1020 -0
- data/shoes/internal.c +46 -0
- data/shoes/internal.h +63 -0
- data/shoes/native.h +110 -0
- data/shoes/native/cocoa.h +105 -0
- data/shoes/native/cocoa.m +1557 -0
- data/shoes/native/gtk.c +1257 -0
- data/shoes/native/windows.c +2392 -0
- data/shoes/ruby.c +5221 -0
- data/shoes/ruby.h +299 -0
- data/shoes/world.c +243 -0
- data/shoes/world.h +63 -0
- data/static/Shoes.icns +0 -0
- data/static/avatar.png +0 -0
- data/static/code_highlighter.js +188 -0
- data/static/code_highlighter_ruby.js +26 -0
- data/static/icon-debug.png +0 -0
- data/static/icon-error.png +0 -0
- data/static/icon-info.png +0 -0
- data/static/icon-warn.png +0 -0
- data/static/listbox_button1.png +0 -0
- data/static/listbox_button2.png +0 -0
- data/static/man-app.png +0 -0
- data/static/man-builds.png +0 -0
- data/static/man-builds1.png +0 -0
- data/static/man-editor-notepad.png +0 -0
- data/static/man-editor-osx.png +0 -0
- data/static/man-ele-background.png +0 -0
- data/static/man-ele-border.png +0 -0
- data/static/man-ele-button.png +0 -0
- data/static/man-ele-check.png +0 -0
- data/static/man-ele-editbox.png +0 -0
- data/static/man-ele-editline.png +0 -0
- data/static/man-ele-image.png +0 -0
- data/static/man-ele-listbox.png +0 -0
- data/static/man-ele-progress.png +0 -0
- data/static/man-ele-radio.png +0 -0
- data/static/man-ele-shape.png +0 -0
- data/static/man-ele-textblock.png +0 -0
- data/static/man-ele-video.png +0 -0
- data/static/man-intro-dmg.png +0 -0
- data/static/man-intro-exe.png +0 -0
- data/static/man-look-tiger.png +0 -0
- data/static/man-look-ubuntu.png +0 -0
- data/static/man-look-vista.png +0 -0
- data/static/man-run-osx.png +0 -0
- data/static/man-run-vista.png +0 -0
- data/static/man-run-xp.png +0 -0
- data/static/man-shot1.png +0 -0
- data/static/manual-en.txt +3531 -0
- data/static/manual-ja.txt +2825 -0
- data/static/manual.css +167 -0
- data/static/menu-corner1.png +0 -0
- data/static/menu-corner2.png +0 -0
- data/static/menu-gray.png +0 -0
- data/static/menu-left.png +0 -0
- data/static/menu-right.png +0 -0
- data/static/menu-top.png +0 -0
- data/static/shoes-dmg.jpg +0 -0
- data/static/shoes-icon-blue.png +0 -0
- data/static/shoes-icon.png +0 -0
- data/static/shoes-manual-apps.gif +0 -0
- data/static/shoes_main_window.png +0 -0
- data/static/stripe.png +0 -0
- data/static/stubs/blank.exe +0 -0
- data/static/stubs/blank.hfz +0 -0
- data/static/stubs/blank.run +375 -0
- data/static/stubs/cocoa-install +0 -0
- data/static/stubs/sh-install +49 -0
- data/static/stubs/shoes-stub-inject.exe +0 -0
- data/static/stubs/shoes-stub.exe +0 -0
- data/static/tutor-back.png +0 -0
- data/test/shoes_test.rb +8 -0
- data/test/test_helper.rb +25 -0
- data/use-deps +12 -0
- data/use-tmp-dep +8 -0
- metadata +509 -0
data/platform/mac/shoes
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
APPPATH="${0%/*}"
|
3
|
+
APPFULLPATH="`cd \"$APPPATH\" 2>/dev/null && pwd`"
|
4
|
+
RUNPATH="$@"
|
5
|
+
|
6
|
+
if [ "$1" = "--ruby" ]; then
|
7
|
+
$APPFULLPATH/#{NAME}-bin "$@"
|
8
|
+
exit
|
9
|
+
fi
|
10
|
+
|
11
|
+
while getopts mhv OPTION
|
12
|
+
do
|
13
|
+
case $OPTION in
|
14
|
+
h) printf "Usage: #{NAME} [options] (app.rb or app.shy)\n"
|
15
|
+
printf "\t-m\tOpen the built-in manual.\n"
|
16
|
+
printf "\t-v\tDisplay version info.\n"
|
17
|
+
exit
|
18
|
+
;;
|
19
|
+
m) RUNPATH="$APPFULLPATH/command-manual.rb"
|
20
|
+
;;
|
21
|
+
v) cat "$APPFULLPATH/VERSION.txt"
|
22
|
+
exit
|
23
|
+
;;
|
24
|
+
esac
|
25
|
+
done
|
26
|
+
|
27
|
+
if [ "$1" = "" ]; then
|
28
|
+
open -a "$APPFULLPATH/../../../#{APPNAME}.app"
|
29
|
+
else
|
30
|
+
open -a "$APPFULLPATH/../../../#{APPNAME}.app" "$RUNPATH"
|
31
|
+
fi
|
data/platform/mac/stub.m
ADDED
@@ -0,0 +1,178 @@
|
|
1
|
+
#import <Cocoa/Cocoa.h>
|
2
|
+
|
3
|
+
#define INIT NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]
|
4
|
+
#define RELEASE [pool release]
|
5
|
+
|
6
|
+
@interface StubEvents : NSObject
|
7
|
+
{
|
8
|
+
NSWindow *win;
|
9
|
+
NSFileManager *fm;
|
10
|
+
NSMutableData *data;
|
11
|
+
NSString *setupURL;
|
12
|
+
NSURLConnection *metaConn;
|
13
|
+
NSURLDownload *pkgDown;
|
14
|
+
NSURLResponse *pkgResp;
|
15
|
+
NSString *pkgPath;
|
16
|
+
NSFileHandle *tempDir, *pkgFile;
|
17
|
+
NSTextField *textField;
|
18
|
+
NSProgressIndicator *progress;
|
19
|
+
long long bytes;
|
20
|
+
}
|
21
|
+
@end
|
22
|
+
|
23
|
+
@implementation StubEvents
|
24
|
+
- (id)initWithWindow: (NSWindow *)w andText: (NSTextField *)text andProgress: (NSProgressIndicator *)pop
|
25
|
+
{
|
26
|
+
if ((self = [super init]))
|
27
|
+
{
|
28
|
+
data = [[NSMutableData data] retain];
|
29
|
+
fm = [NSFileManager defaultManager];
|
30
|
+
win = w;
|
31
|
+
progress = pop;
|
32
|
+
textField = text;
|
33
|
+
}
|
34
|
+
return self;
|
35
|
+
}
|
36
|
+
- (NSString *)getTempPath
|
37
|
+
{
|
38
|
+
NSString *temp = NSTemporaryDirectory(), *p;
|
39
|
+
if (temp == NULL) temp = NSHomeDirectory();
|
40
|
+
return temp;
|
41
|
+
}
|
42
|
+
-(IBAction)cancelClick: (id)sender
|
43
|
+
{
|
44
|
+
[[NSApplication sharedApplication] stop: nil];
|
45
|
+
}
|
46
|
+
- (void)checkForLatestShoesAt: (NSString *)url
|
47
|
+
{
|
48
|
+
NSURLRequest *req = [NSURLRequest requestWithURL:
|
49
|
+
[NSURL URLWithString: url]
|
50
|
+
cachePolicy: NSURLRequestUseProtocolCachePolicy
|
51
|
+
timeoutInterval: 60.0];
|
52
|
+
metaConn = [[NSURLConnection alloc] initWithRequest: req
|
53
|
+
delegate: self];
|
54
|
+
}
|
55
|
+
- (void)connection: (NSURLConnection *)conn didReceiveResponse: (NSURLResponse *)resp
|
56
|
+
{
|
57
|
+
[data setLength: 0];
|
58
|
+
}
|
59
|
+
- (void)connection: (NSURLConnection *)conn didReceiveData: (NSData *)chunk
|
60
|
+
{
|
61
|
+
[data appendData: chunk];
|
62
|
+
}
|
63
|
+
- (void)connectionDidFinishLoading: (NSURLConnection *)conn
|
64
|
+
{
|
65
|
+
if (metaConn == conn)
|
66
|
+
{
|
67
|
+
NSString *pkgPath;
|
68
|
+
NSURLRequest *req;
|
69
|
+
setupURL = [[NSString alloc] initWithData: data
|
70
|
+
encoding: NSUTF8StringEncoding];
|
71
|
+
setupURL = [@"http://hacketyhack.net" stringByAppendingString:
|
72
|
+
[setupURL stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]]];
|
73
|
+
|
74
|
+
req = [NSURLRequest requestWithURL: [NSURL URLWithString: setupURL]
|
75
|
+
cachePolicy: NSURLRequestUseProtocolCachePolicy timeoutInterval: 60.0];
|
76
|
+
pkgDown = [[NSURLDownload alloc] initWithRequest: req delegate: self];
|
77
|
+
[conn release];
|
78
|
+
}
|
79
|
+
}
|
80
|
+
- (void)download: (NSURLDownload *)download decideDestinationWithSuggestedFilename: (NSString *)filename
|
81
|
+
{
|
82
|
+
pkgPath = [[self getTempPath] stringByAppendingPathComponent: @"shoes-setup.dmg"];
|
83
|
+
[download setDestination: pkgPath allowOverwrite: YES];
|
84
|
+
}
|
85
|
+
- (void)setDownloadResponse: (NSURLResponse *)aDownloadResponse
|
86
|
+
{
|
87
|
+
[aDownloadResponse retain];
|
88
|
+
[pkgResp release];
|
89
|
+
pkgResp = aDownloadResponse;
|
90
|
+
}
|
91
|
+
|
92
|
+
- (void)download: (NSURLDownload *)download didReceiveResponse: (NSURLResponse *)response
|
93
|
+
{
|
94
|
+
bytes = 0;
|
95
|
+
[self setDownloadResponse: response];
|
96
|
+
}
|
97
|
+
- (void)download: (NSURLDownload *)download didReceiveDataOfLength: (unsigned)length
|
98
|
+
{
|
99
|
+
long long expectedLength = [pkgResp expectedContentLength];
|
100
|
+
bytes += length;
|
101
|
+
if (expectedLength != NSURLResponseUnknownLength) {
|
102
|
+
float perc = (bytes / (float)expectedLength) * 100.0;
|
103
|
+
[textField setStringValue: [NSString stringWithFormat: @"Downloading Shoes. (%0.1f%% done)", perc]];
|
104
|
+
[progress setDoubleValue: perc];
|
105
|
+
}
|
106
|
+
}
|
107
|
+
- (void)downloadDidFinish: (NSURLDownload *)download
|
108
|
+
{
|
109
|
+
NSString *shoesMount, *shoesPath;
|
110
|
+
NSTask *mount = [[NSTask alloc] init];
|
111
|
+
[mount setLaunchPath: @"/usr/bin/hdiutil"];
|
112
|
+
[mount setArguments: [NSArray arrayWithObjects:
|
113
|
+
@"mount", @"-noidme", @"-quiet", @"-mountroot", [self getTempPath], pkgPath, nil]];
|
114
|
+
[mount launch];
|
115
|
+
[mount waitUntilExit];
|
116
|
+
[mount release];
|
117
|
+
|
118
|
+
shoesMount = [[self getTempPath] stringByAppendingPathComponent: @"Shoes"];
|
119
|
+
shoesPath = [shoesMount stringByAppendingPathComponent: @"Shoes.app"];
|
120
|
+
[fm copyPath: shoesPath toPath: @"/Applications/Shoes.app" handler: nil];
|
121
|
+
|
122
|
+
mount = [[NSTask alloc] init];
|
123
|
+
[mount setLaunchPath: @"/usr/bin/hdiutil"];
|
124
|
+
[mount setArguments: [NSArray arrayWithObjects: @"unmount", @"-quiet", shoesMount, nil]];
|
125
|
+
[mount launch];
|
126
|
+
[mount waitUntilExit];
|
127
|
+
[mount release];
|
128
|
+
[download release];
|
129
|
+
[[NSApplication sharedApplication] stop: nil];
|
130
|
+
}
|
131
|
+
@end
|
132
|
+
|
133
|
+
int
|
134
|
+
main(int argc, char *argv[])
|
135
|
+
{
|
136
|
+
NSApplication *app = [NSApplication sharedApplication];
|
137
|
+
INIT;
|
138
|
+
NSWindow *win = [[NSWindow alloc] initWithContentRect: NSMakeRect(0, 0, 340, 140)
|
139
|
+
styleMask: (NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSTexturedBackgroundWindowMask)
|
140
|
+
backing: NSBackingStoreBuffered defer: NO];
|
141
|
+
NSProgressIndicator *pop = [[[NSProgressIndicator alloc] initWithFrame:
|
142
|
+
NSMakeRect(40, 68, 260, 14)] autorelease];
|
143
|
+
NSButton *button = [[[NSButton alloc] initWithFrame:
|
144
|
+
NSMakeRect(130, 20, 100, 30)] autorelease];
|
145
|
+
NSTextField *text = [[[NSTextField alloc] initWithFrame:
|
146
|
+
NSMakeRect(40, 90, 260, 18)] autorelease];
|
147
|
+
StubEvents *events = [[StubEvents alloc] initWithWindow: win andText: text andProgress: pop];
|
148
|
+
#ifdef __ppc__
|
149
|
+
[events checkForLatestShoesAt: @"http://hacketyhack.net/pkg/osx/shoes-ppc"];
|
150
|
+
#else
|
151
|
+
[events checkForLatestShoesAt: @"http://hacketyhack.net/pkg/osx/shoes"];
|
152
|
+
#endif
|
153
|
+
|
154
|
+
[[win contentView] addSubview: text];
|
155
|
+
[text setStringValue: @"Downloading Shoes."];
|
156
|
+
[text setBezeled: NO];
|
157
|
+
[text setBackgroundColor: [NSColor windowBackgroundColor]];
|
158
|
+
[text setEditable: NO];
|
159
|
+
[text setSelectable: NO];
|
160
|
+
|
161
|
+
[[win contentView] addSubview: pop];
|
162
|
+
[pop setIndeterminate: FALSE];
|
163
|
+
[pop setDoubleValue: 0.];
|
164
|
+
[pop setBezeled: YES];
|
165
|
+
|
166
|
+
[[win contentView] addSubview: button];
|
167
|
+
[button setTitle: @"Cancel"];
|
168
|
+
[button setBezelStyle: 1];
|
169
|
+
[button setTarget: events];
|
170
|
+
[button setAction: @selector(cancelClick:)];
|
171
|
+
|
172
|
+
[win center];
|
173
|
+
[win setLevel: NSFloatingWindowLevel];
|
174
|
+
[win makeKeyAndOrderFront: win];
|
175
|
+
[app run];
|
176
|
+
RELEASE;
|
177
|
+
return 0;
|
178
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>BuildVersion</key>
|
6
|
+
<string>1</string>
|
7
|
+
<key>CFBundleVersion</key>
|
8
|
+
<string>0.1</string>
|
9
|
+
<key>ProjectName</key>
|
10
|
+
<string>Shoes</string>
|
11
|
+
<key>SourceVersion</key>
|
12
|
+
<string>1200000</string>
|
13
|
+
</dict>
|
14
|
+
</plist>
|
@@ -0,0 +1,644 @@
|
|
1
|
+
;--------------------------------
|
2
|
+
;Definitions
|
3
|
+
!define AppName "#{APPNAME}"
|
4
|
+
!define AppRelease "#{RELEASE_NAME}"
|
5
|
+
!define AppVersion "#{VERS}"
|
6
|
+
!define AppMainEXE "#{NAME}.exe"
|
7
|
+
!define ShortName "#{NAME}"
|
8
|
+
!define InstallKey "Software\Hackety.org\${AppName}"
|
9
|
+
|
10
|
+
;--------------------------------
|
11
|
+
;Path Manipulation Funcs
|
12
|
+
|
13
|
+
!ifndef _AddToPath_nsh
|
14
|
+
!define _AddToPath_nsh
|
15
|
+
|
16
|
+
!verbose 3
|
17
|
+
!include "WinMessages.NSH"
|
18
|
+
!verbose 4
|
19
|
+
|
20
|
+
!ifndef WriteEnvStr_RegKey
|
21
|
+
!ifdef ALL_USERS
|
22
|
+
!define WriteEnvStr_RegKey \
|
23
|
+
'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
|
24
|
+
!else
|
25
|
+
!define WriteEnvStr_RegKey 'HKCU "Environment"'
|
26
|
+
!endif
|
27
|
+
!endif
|
28
|
+
|
29
|
+
; AddToPath - Adds the given dir to the search path.
|
30
|
+
; Input - head of the stack
|
31
|
+
; Note - Win9x systems requires reboot
|
32
|
+
|
33
|
+
Function AddToPath
|
34
|
+
Exch $0
|
35
|
+
Push $1
|
36
|
+
Push $2
|
37
|
+
Push $3
|
38
|
+
|
39
|
+
# don't add if the path doesn't exist
|
40
|
+
IfFileExists "$0\*.*" "" AddToPath_done
|
41
|
+
|
42
|
+
ReadEnvStr $1 PATH
|
43
|
+
Push "$1;"
|
44
|
+
Push "$0;"
|
45
|
+
Call StrStr
|
46
|
+
Pop $2
|
47
|
+
StrCmp $2 "" "" AddToPath_done
|
48
|
+
Push "$1;"
|
49
|
+
Push "$0\;"
|
50
|
+
Call StrStr
|
51
|
+
Pop $2
|
52
|
+
StrCmp $2 "" "" AddToPath_done
|
53
|
+
GetFullPathName /SHORT $3 $0
|
54
|
+
Push "$1;"
|
55
|
+
Push "$3;"
|
56
|
+
Call StrStr
|
57
|
+
Pop $2
|
58
|
+
StrCmp $2 "" "" AddToPath_done
|
59
|
+
Push "$1;"
|
60
|
+
Push "$3\;"
|
61
|
+
Call StrStr
|
62
|
+
Pop $2
|
63
|
+
StrCmp $2 "" "" AddToPath_done
|
64
|
+
|
65
|
+
Call IsNT
|
66
|
+
Pop $1
|
67
|
+
StrCmp $1 1 AddToPath_NT
|
68
|
+
; Not on NT
|
69
|
+
StrCpy $1 $WINDIR 2
|
70
|
+
FileOpen $1 "$1\autoexec.bat" a
|
71
|
+
FileSeek $1 -1 END
|
72
|
+
FileReadByte $1 $2
|
73
|
+
IntCmp $2 26 0 +2 +2 # DOS EOF
|
74
|
+
FileSeek $1 -1 END # write over EOF
|
75
|
+
FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n"
|
76
|
+
FileClose $1
|
77
|
+
SetRebootFlag true
|
78
|
+
Goto AddToPath_done
|
79
|
+
|
80
|
+
AddToPath_NT:
|
81
|
+
ReadRegStr $1 ${WriteEnvStr_RegKey} "PATH"
|
82
|
+
StrCmp $1 "" AddToPath_NTdoIt
|
83
|
+
Push $1
|
84
|
+
Call Trim
|
85
|
+
Pop $1
|
86
|
+
StrCpy $0 "$1;$0"
|
87
|
+
AddToPath_NTdoIt:
|
88
|
+
WriteRegExpandStr ${WriteEnvStr_RegKey} "PATH" $0
|
89
|
+
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
|
90
|
+
|
91
|
+
AddToPath_done:
|
92
|
+
Pop $3
|
93
|
+
Pop $2
|
94
|
+
Pop $1
|
95
|
+
Pop $0
|
96
|
+
FunctionEnd
|
97
|
+
|
98
|
+
; RemoveFromPath - Remove a given dir from the path
|
99
|
+
; Input: head of the stack
|
100
|
+
|
101
|
+
Function un.RemoveFromPath
|
102
|
+
Exch $0
|
103
|
+
Push $1
|
104
|
+
Push $2
|
105
|
+
Push $3
|
106
|
+
Push $4
|
107
|
+
Push $5
|
108
|
+
Push $6
|
109
|
+
|
110
|
+
IntFmt $6 "%c" 26 # DOS EOF
|
111
|
+
|
112
|
+
Call un.IsNT
|
113
|
+
Pop $1
|
114
|
+
StrCmp $1 1 unRemoveFromPath_NT
|
115
|
+
; Not on NT
|
116
|
+
StrCpy $1 $WINDIR 2
|
117
|
+
FileOpen $1 "$1\autoexec.bat" r
|
118
|
+
GetTempFileName $4
|
119
|
+
FileOpen $2 $4 w
|
120
|
+
GetFullPathName /SHORT $0 $0
|
121
|
+
StrCpy $0 "SET PATH=%PATH%;$0"
|
122
|
+
Goto unRemoveFromPath_dosLoop
|
123
|
+
|
124
|
+
unRemoveFromPath_dosLoop:
|
125
|
+
FileRead $1 $3
|
126
|
+
StrCpy $5 $3 1 -1 # read last char
|
127
|
+
StrCmp $5 $6 0 +2 # if DOS EOF
|
128
|
+
StrCpy $3 $3 -1 # remove DOS EOF so we can compare
|
129
|
+
StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoopRemoveLine
|
130
|
+
StrCmp $3 "$0$\n" unRemoveFromPath_dosLoopRemoveLine
|
131
|
+
StrCmp $3 "$0" unRemoveFromPath_dosLoopRemoveLine
|
132
|
+
StrCmp $3 "" unRemoveFromPath_dosLoopEnd
|
133
|
+
FileWrite $2 $3
|
134
|
+
Goto unRemoveFromPath_dosLoop
|
135
|
+
unRemoveFromPath_dosLoopRemoveLine:
|
136
|
+
SetRebootFlag true
|
137
|
+
Goto unRemoveFromPath_dosLoop
|
138
|
+
|
139
|
+
unRemoveFromPath_dosLoopEnd:
|
140
|
+
FileClose $2
|
141
|
+
FileClose $1
|
142
|
+
StrCpy $1 $WINDIR 2
|
143
|
+
Delete "$1\autoexec.bat"
|
144
|
+
CopyFiles /SILENT $4 "$1\autoexec.bat"
|
145
|
+
Delete $4
|
146
|
+
Goto unRemoveFromPath_done
|
147
|
+
|
148
|
+
unRemoveFromPath_NT:
|
149
|
+
ReadRegStr $1 ${WriteEnvStr_RegKey} "PATH"
|
150
|
+
StrCpy $5 $1 1 -1 # copy last char
|
151
|
+
StrCmp $5 ";" +2 # if last char != ;
|
152
|
+
StrCpy $1 "$1;" # append ;
|
153
|
+
Push $1
|
154
|
+
Push "$0;"
|
155
|
+
Call un.StrStr ; Find `$0;` in $1
|
156
|
+
Pop $2 ; pos of our dir
|
157
|
+
StrCmp $2 "" unRemoveFromPath_done
|
158
|
+
; else, it is in path
|
159
|
+
# $0 - path to add
|
160
|
+
# $1 - path var
|
161
|
+
StrLen $3 "$0;"
|
162
|
+
StrLen $4 $2
|
163
|
+
StrCpy $5 $1 -$4 # $5 is now the part before the path to remove
|
164
|
+
StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove
|
165
|
+
StrCpy $3 $5$6
|
166
|
+
|
167
|
+
StrCpy $5 $3 1 -1 # copy last char
|
168
|
+
StrCmp $5 ";" 0 +2 # if last char == ;
|
169
|
+
StrCpy $3 $3 -1 # remove last char
|
170
|
+
|
171
|
+
WriteRegExpandStr ${WriteEnvStr_RegKey} "PATH" $3
|
172
|
+
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
|
173
|
+
|
174
|
+
unRemoveFromPath_done:
|
175
|
+
Pop $6
|
176
|
+
Pop $5
|
177
|
+
Pop $4
|
178
|
+
Pop $3
|
179
|
+
Pop $2
|
180
|
+
Pop $1
|
181
|
+
Pop $0
|
182
|
+
FunctionEnd
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
; AddToEnvVar - Adds the given value to the given environment var
|
187
|
+
; Input - head of the stack $0 environement variable $1=value to add
|
188
|
+
; Note - Win9x systems requires reboot
|
189
|
+
|
190
|
+
Function AddToEnvVar
|
191
|
+
|
192
|
+
Exch $1 ; $1 has environment variable value
|
193
|
+
Exch
|
194
|
+
Exch $0 ; $0 has environment variable name
|
195
|
+
|
196
|
+
DetailPrint "Adding $1 to $0"
|
197
|
+
Push $2
|
198
|
+
Push $3
|
199
|
+
Push $4
|
200
|
+
|
201
|
+
|
202
|
+
ReadEnvStr $2 $0
|
203
|
+
Push "$2;"
|
204
|
+
Push "$1;"
|
205
|
+
Call StrStr
|
206
|
+
Pop $3
|
207
|
+
StrCmp $3 "" "" AddToEnvVar_done
|
208
|
+
|
209
|
+
Push "$2;"
|
210
|
+
Push "$1\;"
|
211
|
+
Call StrStr
|
212
|
+
Pop $3
|
213
|
+
StrCmp $3 "" "" AddToEnvVar_done
|
214
|
+
|
215
|
+
|
216
|
+
Call IsNT
|
217
|
+
Pop $2
|
218
|
+
StrCmp $2 1 AddToEnvVar_NT
|
219
|
+
; Not on NT
|
220
|
+
StrCpy $2 $WINDIR 2
|
221
|
+
FileOpen $2 "$2\autoexec.bat" a
|
222
|
+
FileSeek $2 -1 END
|
223
|
+
FileReadByte $2 $3
|
224
|
+
IntCmp $3 26 0 +2 +2 # DOS EOF
|
225
|
+
FileSeek $2 -1 END # write over EOF
|
226
|
+
FileWrite $2 "$\r$\nSET $0=%$0%;$4$\r$\n"
|
227
|
+
FileClose $2
|
228
|
+
SetRebootFlag true
|
229
|
+
Goto AddToEnvVar_done
|
230
|
+
|
231
|
+
AddToEnvVar_NT:
|
232
|
+
ReadRegStr $2 ${WriteEnvStr_RegKey} $0
|
233
|
+
StrCpy $3 $2 1 -1 # copy last char
|
234
|
+
StrCmp $3 ";" 0 +2 # if last char == ;
|
235
|
+
StrCpy $2 $2 -1 # remove last char
|
236
|
+
StrCmp $2 "" AddToEnvVar_NTdoIt
|
237
|
+
StrCpy $1 "$2;$1"
|
238
|
+
AddToEnvVar_NTdoIt:
|
239
|
+
WriteRegExpandStr ${WriteEnvStr_RegKey} $0 $1
|
240
|
+
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
|
241
|
+
|
242
|
+
AddToEnvVar_done:
|
243
|
+
Pop $4
|
244
|
+
Pop $3
|
245
|
+
Pop $2
|
246
|
+
Pop $0
|
247
|
+
Pop $1
|
248
|
+
|
249
|
+
FunctionEnd
|
250
|
+
|
251
|
+
; RemoveFromEnvVar - Remove a given value from a environment var
|
252
|
+
; Input: head of the stack
|
253
|
+
|
254
|
+
Function un.RemoveFromEnvVar
|
255
|
+
|
256
|
+
Exch $1 ; $1 has environment variable value
|
257
|
+
Exch
|
258
|
+
Exch $0 ; $0 has environment variable name
|
259
|
+
|
260
|
+
DetailPrint "Removing $1 from $0"
|
261
|
+
Push $2
|
262
|
+
Push $3
|
263
|
+
Push $4
|
264
|
+
Push $5
|
265
|
+
Push $6
|
266
|
+
Push $7
|
267
|
+
|
268
|
+
IntFmt $7 "%c" 26 # DOS EOF
|
269
|
+
|
270
|
+
Call un.IsNT
|
271
|
+
Pop $2
|
272
|
+
StrCmp $2 1 unRemoveFromEnvVar_NT
|
273
|
+
; Not on NT
|
274
|
+
StrCpy $2 $WINDIR 2
|
275
|
+
FileOpen $2 "$2\autoexec.bat" r
|
276
|
+
GetTempFileName $5
|
277
|
+
FileOpen $3 $5 w
|
278
|
+
GetFullPathName /SHORT $1 $1
|
279
|
+
StrCpy $1 "SET $0=%$0%;$1"
|
280
|
+
Goto unRemoveFromEnvVar_dosLoop
|
281
|
+
|
282
|
+
unRemoveFromEnvVar_dosLoop:
|
283
|
+
FileRead $2 $4
|
284
|
+
StrCpy $6 $4 1 -1 # read last char
|
285
|
+
StrCmp $6 $7 0 +2 # if DOS EOF
|
286
|
+
StrCpy $4 $4 -1 # remove DOS EOF so we can compare
|
287
|
+
StrCmp $4 "$1$\r$\n" unRemoveFromEnvVar_dosLoopRemoveLine
|
288
|
+
StrCmp $4 "$1$\n" unRemoveFromEnvVar_dosLoopRemoveLine
|
289
|
+
StrCmp $4 "$1" unRemoveFromEnvVar_dosLoopRemoveLine
|
290
|
+
StrCmp $4 "" unRemoveFromEnvVar_dosLoopEnd
|
291
|
+
FileWrite $3 $4
|
292
|
+
Goto unRemoveFromEnvVar_dosLoop
|
293
|
+
unRemoveFromEnvVar_dosLoopRemoveLine:
|
294
|
+
SetRebootFlag true
|
295
|
+
Goto unRemoveFromEnvVar_dosLoop
|
296
|
+
|
297
|
+
unRemoveFromEnvVar_dosLoopEnd:
|
298
|
+
FileClose $3
|
299
|
+
FileClose $2
|
300
|
+
StrCpy $2 $WINDIR 2
|
301
|
+
Delete "$2\autoexec.bat"
|
302
|
+
CopyFiles /SILENT $5 "$2\autoexec.bat"
|
303
|
+
Delete $5
|
304
|
+
Goto unRemoveFromEnvVar_done
|
305
|
+
|
306
|
+
unRemoveFromEnvVar_NT:
|
307
|
+
ReadRegStr $2 ${WriteEnvStr_RegKey} $0
|
308
|
+
StrCpy $6 $2 1 -1 # copy last char
|
309
|
+
StrCmp $6 ";" +2 # if last char != ;
|
310
|
+
StrCpy $2 "$2;" # append ;
|
311
|
+
Push $2
|
312
|
+
Push "$1;"
|
313
|
+
Call un.StrStr ; Find `$1;` in $2
|
314
|
+
Pop $3 ; pos of our dir
|
315
|
+
StrCmp $3 "" unRemoveFromEnvVar_done
|
316
|
+
; else, it is in path
|
317
|
+
# $1 - path to add
|
318
|
+
# $2 - path var
|
319
|
+
StrLen $4 "$1;"
|
320
|
+
StrLen $5 $3
|
321
|
+
StrCpy $6 $2 -$5 # $6 is now the part before the path to remove
|
322
|
+
StrCpy $7 $3 "" $4 # $7 is now the part after the path to remove
|
323
|
+
StrCpy $4 $6$7
|
324
|
+
|
325
|
+
StrCpy $6 $4 1 -1 # copy last char
|
326
|
+
StrCmp $6 ";" 0 +2 # if last char == ;
|
327
|
+
StrCpy $4 $4 -1 # remove last char
|
328
|
+
|
329
|
+
WriteRegExpandStr ${WriteEnvStr_RegKey} $0 $4
|
330
|
+
|
331
|
+
; delete reg value if null
|
332
|
+
StrCmp $4 "" 0 +2 # if null delete reg
|
333
|
+
DeleteRegValue ${WriteEnvStr_RegKey} $0
|
334
|
+
|
335
|
+
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
|
336
|
+
|
337
|
+
unRemoveFromEnvVar_done:
|
338
|
+
Pop $7
|
339
|
+
Pop $6
|
340
|
+
Pop $5
|
341
|
+
Pop $4
|
342
|
+
Pop $3
|
343
|
+
Pop $2
|
344
|
+
Pop $1
|
345
|
+
Pop $0
|
346
|
+
FunctionEnd
|
347
|
+
|
348
|
+
!ifndef IsNT_KiCHiK
|
349
|
+
!define IsNT_KiCHiK
|
350
|
+
|
351
|
+
###########################################
|
352
|
+
# Utility Functions #
|
353
|
+
###########################################
|
354
|
+
|
355
|
+
; IsNT
|
356
|
+
; no input
|
357
|
+
; output, top of the stack = 1 if NT or 0 if not
|
358
|
+
;
|
359
|
+
; Usage:
|
360
|
+
; Call IsNT
|
361
|
+
; Pop $R0
|
362
|
+
; ($R0 at this point is 1 or 0)
|
363
|
+
|
364
|
+
!macro IsNT un
|
365
|
+
Function ${un}IsNT
|
366
|
+
Push $0
|
367
|
+
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
|
368
|
+
StrCmp $0 "" 0 IsNT_yes
|
369
|
+
; we are not NT.
|
370
|
+
Pop $0
|
371
|
+
Push 0
|
372
|
+
Return
|
373
|
+
|
374
|
+
IsNT_yes:
|
375
|
+
; NT!!!
|
376
|
+
Pop $0
|
377
|
+
Push 1
|
378
|
+
FunctionEnd
|
379
|
+
!macroend
|
380
|
+
!insertmacro IsNT ""
|
381
|
+
!insertmacro IsNT "un."
|
382
|
+
|
383
|
+
!endif ; IsNT_KiCHiK
|
384
|
+
|
385
|
+
; StrStr
|
386
|
+
; input, top of stack = string to search for
|
387
|
+
; top of stack-1 = string to search in
|
388
|
+
; output, top of stack (replaces with the portion of the string remaining)
|
389
|
+
; modifies no other variables.
|
390
|
+
;
|
391
|
+
; Usage:
|
392
|
+
; Push "this is a long ass string"
|
393
|
+
; Push "ass"
|
394
|
+
; Call StrStr
|
395
|
+
; Pop $R0
|
396
|
+
; ($R0 at this point is "ass string")
|
397
|
+
|
398
|
+
!macro StrStr un
|
399
|
+
Function ${un}StrStr
|
400
|
+
Exch $R1 ; st=haystack,old$R1, $R1=needle
|
401
|
+
Exch ; st=old$R1,haystack
|
402
|
+
Exch $R2 ; st=old$R1,old$R2, $R2=haystack
|
403
|
+
Push $R3
|
404
|
+
Push $R4
|
405
|
+
Push $R5
|
406
|
+
StrLen $R3 $R1
|
407
|
+
StrCpy $R4 0
|
408
|
+
; $R1=needle
|
409
|
+
; $R2=haystack
|
410
|
+
; $R3=len(needle)
|
411
|
+
; $R4=cnt
|
412
|
+
; $R5=tmp
|
413
|
+
loop:
|
414
|
+
StrCpy $R5 $R2 $R3 $R4
|
415
|
+
StrCmp $R5 $R1 done
|
416
|
+
StrCmp $R5 "" done
|
417
|
+
IntOp $R4 $R4 + 1
|
418
|
+
Goto loop
|
419
|
+
done:
|
420
|
+
StrCpy $R1 $R2 "" $R4
|
421
|
+
Pop $R5
|
422
|
+
Pop $R4
|
423
|
+
Pop $R3
|
424
|
+
Pop $R2
|
425
|
+
Exch $R1
|
426
|
+
FunctionEnd
|
427
|
+
!macroend
|
428
|
+
!insertmacro StrStr ""
|
429
|
+
!insertmacro StrStr "un."
|
430
|
+
|
431
|
+
!endif ; _AddToPath_nsh
|
432
|
+
|
433
|
+
Function Trim ; Added by Pelaca
|
434
|
+
Exch $R1
|
435
|
+
Push $R2
|
436
|
+
Loop:
|
437
|
+
StrCpy $R2 "$R1" 1 -1
|
438
|
+
StrCmp "$R2" " " RTrim
|
439
|
+
StrCmp "$R2" "$\n" RTrim
|
440
|
+
StrCmp "$R2" "$\r" RTrim
|
441
|
+
StrCmp "$R2" ";" RTrim
|
442
|
+
GoTo Done
|
443
|
+
RTrim:
|
444
|
+
StrCpy $R1 "$R1" -1
|
445
|
+
Goto Loop
|
446
|
+
Done:
|
447
|
+
Pop $R2
|
448
|
+
Exch $R1
|
449
|
+
FunctionEnd
|
450
|
+
|
451
|
+
;--------------------------------
|
452
|
+
;Include Modern UI
|
453
|
+
|
454
|
+
!include "MUI.nsh"
|
455
|
+
!include LogicLib.nsh
|
456
|
+
|
457
|
+
;--------------------------------
|
458
|
+
;General
|
459
|
+
|
460
|
+
;Name and file
|
461
|
+
Name "${AppName} (${AppRelease})"
|
462
|
+
OutFile "${ShortName}-${AppVersion}.exe"
|
463
|
+
|
464
|
+
;Default installation folder
|
465
|
+
InstallDir "$COMMONFILES\${AppName}"
|
466
|
+
|
467
|
+
;Get installation folder from registry if available
|
468
|
+
InstallDirRegKey HKLM "${InstallKey}" "Base"
|
469
|
+
|
470
|
+
;Vista redirects $SMPROGRAMS to all users without this
|
471
|
+
RequestExecutionLevel admin
|
472
|
+
|
473
|
+
;Best compression
|
474
|
+
SetCompressor /SOLID lzma
|
475
|
+
|
476
|
+
;--------------------------------
|
477
|
+
;Variables
|
478
|
+
|
479
|
+
Var MUI_TEMP
|
480
|
+
Var STARTMENU_FOLDER
|
481
|
+
|
482
|
+
;--------------------------------
|
483
|
+
;Interface Configuration
|
484
|
+
|
485
|
+
!define MUI_ABORTWARNING
|
486
|
+
!define MUI_ICON setup.ico
|
487
|
+
!define MUI_UNICON setup.ico
|
488
|
+
!define MUI_WELCOMEPAGE_TITLE_3LINES
|
489
|
+
!define MUI_WELCOMEFINISHPAGE_BITMAP installer-1.bmp
|
490
|
+
!define MUI_HEADERIMAGE
|
491
|
+
!define MUI_HEADERIMAGE_RIGHT
|
492
|
+
!define MUI_HEADERIMAGE_BITMAP installer-2.bmp
|
493
|
+
!define MUI_COMPONENTSPAGE_NODESC
|
494
|
+
|
495
|
+
;--------------------------------
|
496
|
+
;Pages
|
497
|
+
|
498
|
+
!insertmacro MUI_PAGE_WELCOME
|
499
|
+
!define MUI_PAGE_HEADER_TEXT "Shoes is MIT Licensed"
|
500
|
+
!define MUI_PAGE_HEADER_SUBTEXT "You are free to do as you please with Shoes."
|
501
|
+
!define MUI_LICENSEPAGE_TEXT_TOP "When you are ready to continue with Setup, click I Agree."
|
502
|
+
!define MUI_LICENSEPAGE_TEXT_BOTTOM " "
|
503
|
+
!insertmacro MUI_PAGE_LICENSE "..\COPYING.txt"
|
504
|
+
|
505
|
+
;Start Menu Folder Page Configuration
|
506
|
+
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "${AppName}"
|
507
|
+
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
|
508
|
+
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${InstallKey}"
|
509
|
+
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
|
510
|
+
|
511
|
+
!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
|
512
|
+
!insertmacro MUI_PAGE_DIRECTORY
|
513
|
+
!insertmacro MUI_PAGE_INSTFILES
|
514
|
+
|
515
|
+
; Finish Page
|
516
|
+
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
|
517
|
+
!define MUI_FINISHPAGE_TITLE_3LINES
|
518
|
+
!define MUI_FINISHPAGE_RUN
|
519
|
+
!define MUI_FINISHPAGE_RUN_FUNCTION LaunchApp
|
520
|
+
!define MUI_FINISHPAGE_RUN_TEXT $(LAUNCH_TEXT)
|
521
|
+
;!define MUI_PAGE_CUSTOMFUNCTION_PRE preFinish
|
522
|
+
!insertmacro MUI_PAGE_FINISH
|
523
|
+
|
524
|
+
!insertmacro MUI_UNPAGE_CONFIRM
|
525
|
+
!insertmacro MUI_UNPAGE_INSTFILES
|
526
|
+
|
527
|
+
;--------------------------------
|
528
|
+
;Languages
|
529
|
+
|
530
|
+
!insertmacro MUI_LANGUAGE "English"
|
531
|
+
LangString LAUNCH_TEXT ${LANG_ENGLISH} "Run ${AppName}"
|
532
|
+
LangString TEXT_IO_TITLE ${LANG_ENGLISH} "Your ${AppName} Settings"
|
533
|
+
LangString TEXT_IO_SUBTITLE ${LANG_ENGLISH} "Customize the way you use ${AppName}"
|
534
|
+
|
535
|
+
;--------------------------------
|
536
|
+
;Reserve Files
|
537
|
+
|
538
|
+
;--------------------------------
|
539
|
+
;Installer Section
|
540
|
+
!macro MakeFileAssoc LangName LangExt
|
541
|
+
WriteRegStr HKCR ".${LangExt}" "" "${ShortName}.${LangName}Program"
|
542
|
+
WriteRegStr HKCR "${ShortName}.${LangName}Program" "" "${AppName} ${LangName} Program"
|
543
|
+
WriteRegStr HKCR "${ShortName}.${LangName}Program\shell\open\command" "" '"$INSTDIR\${AppMainEXE}" "%1"'
|
544
|
+
!macroend
|
545
|
+
|
546
|
+
!macro UnmakeFileAssoc LangName LangExt
|
547
|
+
DeleteRegKey /ifempty HKCU ".${LangExt}"
|
548
|
+
DeleteRegKey /ifempty HKCU "${ShortName}.${LangName}Program"
|
549
|
+
!macroend
|
550
|
+
|
551
|
+
Section "App Section" SecApp
|
552
|
+
|
553
|
+
;Store installation folder
|
554
|
+
WriteRegStr HKLM "${InstallKey}" "" "$INSTDIR\${AppVersion}"
|
555
|
+
WriteRegStr HKLM "${InstallKey}" "Base" $INSTDIR
|
556
|
+
|
557
|
+
;ReadEnvStr $INSTDIR "COMMONPROGRAMFILES"
|
558
|
+
StrCpy $INSTDIR "$INSTDIR\${AppVersion}"
|
559
|
+
SetOutPath "$INSTDIR"
|
560
|
+
|
561
|
+
File /r /x nsis ..\*.*
|
562
|
+
|
563
|
+
;Make associations
|
564
|
+
!insertmacro MakeFileAssoc "Shoes" "shy"
|
565
|
+
|
566
|
+
;Create uninstaller
|
567
|
+
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
568
|
+
|
569
|
+
;Create batch file
|
570
|
+
FileOpen $0 "$INSTDIR\..\shoes.bat" w
|
571
|
+
FileWrite $0 "@ECHO OFF$\r$\n"
|
572
|
+
FileWrite $0 '@"$INSTDIR\shoes.exe" %1 %2 %3 %4 %5 %6 %7 %8 %9$\r$\n'
|
573
|
+
FileClose $0
|
574
|
+
|
575
|
+
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
|
576
|
+
|
577
|
+
;Create shortcuts
|
578
|
+
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
|
579
|
+
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\${AppName}.lnk" "$INSTDIR\${AppMainEXE}"
|
580
|
+
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Manual.lnk" "$INSTDIR\${AppMainEXE}" "--manual"
|
581
|
+
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Packager.lnk" "$INSTDIR\${AppMainEXE}" "--package"
|
582
|
+
|
583
|
+
;Setup environment vars
|
584
|
+
Push "$INSTDIR\.."
|
585
|
+
Call AddToPath
|
586
|
+
|
587
|
+
!insertmacro MUI_STARTMENU_WRITE_END
|
588
|
+
|
589
|
+
SectionEnd
|
590
|
+
|
591
|
+
|
592
|
+
Function LaunchApp
|
593
|
+
; ${CloseApp} "true" $(WARN_APP_RUNNING_INSTALL)
|
594
|
+
Exec "$INSTDIR\${AppMainEXE}"
|
595
|
+
FunctionEnd
|
596
|
+
|
597
|
+
;--------------------------------
|
598
|
+
;Descriptions
|
599
|
+
|
600
|
+
;Language strings
|
601
|
+
LangString DESC_SecApp ${LANG_ENGLISH} "A test section."
|
602
|
+
|
603
|
+
;Assign language strings to sections
|
604
|
+
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
605
|
+
!insertmacro MUI_DESCRIPTION_TEXT ${SecApp} $(DESC_SecApp)
|
606
|
+
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
607
|
+
|
608
|
+
;--------------------------------
|
609
|
+
;Uninstaller Section
|
610
|
+
|
611
|
+
Section "Uninstall"
|
612
|
+
|
613
|
+
RMDir /r "$INSTDIR"
|
614
|
+
Delete "$INSTDIR\..\shoes.bat"
|
615
|
+
|
616
|
+
!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
|
617
|
+
|
618
|
+
Delete "$SMPROGRAMS\$MUI_TEMP\${AppName}.lnk"
|
619
|
+
Delete "$SMPROGRAMS\$MUI_TEMP\Manual.lnk"
|
620
|
+
Delete "$SMPROGRAMS\$MUI_TEMP\Packager.lnk"
|
621
|
+
|
622
|
+
;Delete empty start menu parent diretories
|
623
|
+
StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
|
624
|
+
|
625
|
+
startMenuDeleteLoop:
|
626
|
+
ClearErrors
|
627
|
+
RMDir $MUI_TEMP
|
628
|
+
GetFullPathName $MUI_TEMP "$MUI_TEMP\.."
|
629
|
+
|
630
|
+
IfErrors startMenuDeleteLoopDone
|
631
|
+
|
632
|
+
StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop
|
633
|
+
startMenuDeleteLoopDone:
|
634
|
+
|
635
|
+
;Unmake associations
|
636
|
+
!insertmacro UnmakeFileAssoc "Shoes" "shy"
|
637
|
+
|
638
|
+
;Remove environment vars
|
639
|
+
Push "$INSTDIR\.."
|
640
|
+
Call un.RemoveFromPath
|
641
|
+
|
642
|
+
DeleteRegKey /ifempty HKLM "${InstallKey}"
|
643
|
+
|
644
|
+
SectionEnd
|