Skip to content

Commit

Permalink
Merge branch 'master' into glenn/win-build-script
Browse files Browse the repository at this point in the history
  • Loading branch information
gruehle committed Dec 13, 2012
2 parents 3b82410 + b0b2803 commit d1a6f1f
Show file tree
Hide file tree
Showing 19 changed files with 651 additions and 570 deletions.
2 changes: 1 addition & 1 deletion Brackets.vcxproj

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion appshell.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

{
'variables': {
'appname': 'Brackets',
'chromium_code': 1,
'conditions': [
[ 'OS=="mac"', {
Expand All @@ -14,6 +13,8 @@
]
},
'includes': [
# Bring in the configuration vars
'appshell_config.gypi',
# Bring in the source file lists for appshell.
'appshell_paths.gypi',
],
Expand Down
1,054 changes: 539 additions & 515 deletions appshell.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions appshell/appshell_extensions_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,10 @@ int32 ReadDir(ExtensionString path, CefRefPtr<CefListValue>& directoryContents)
NSString* pathStr = [NSString stringWithUTF8String:path.c_str()];
NSError* error = nil;

if ([pathStr length] == 0) {
return ERR_INVALID_PARAMS;
}

NSArray* contents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:pathStr error:&error];

if (contents != nil)
Expand Down
45 changes: 5 additions & 40 deletions appshell/cefclient.rc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
#include "windows.h"
#undef APSTUDIO_HIDDEN_SYMBOLS

#define OS_WIN
#include "config.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

Expand All @@ -23,44 +26,6 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32

/////////////////////////////////////////////////////////////////////////////
//
// VersionInfo
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,17,0,0
/* PRODUCTVERSION 1,0,0,0 */
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName", "brackets.io\0"
VALUE "FileDescription", "\0"
VALUE "FileVersion", "Sprint 17\0"
VALUE "ProductName", "Brackets\0"
VALUE "ProductVersion", "\0"
VALUE "LegalCopyright", "(c) 2012 Adobe Systems, Inc.\0"
END
END

BLOCK "VarFileInfo"
BEGIN
/* The following line should only be modified for localized versions. */
/* It consists of any number of WORD,WORD pairs, with each pair */
/* describing a language,codepage combination supported by the file. */
/* */
/* For example, a file might have values "0x409,1252" indicating that it */
/* supports English language (0x409) in the Windows ANSI codepage (1252). */

VALUE "Translation", 0x409, 1252
VALUE "Translation", 0x40C, 1252
END
END

/////////////////////////////////////////////////////////////////////////////
//
// Binary
Expand All @@ -75,7 +40,7 @@ IDS_APPSHELL_EXTENSIONS BINARY "appshell_extensions.js"

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_CEFCLIENT ICON "res\brackets.ico"
IDI_CEFCLIENT ICON "res\\appshell.ico"

/////////////////////////////////////////////////////////////////////////////
//
Expand Down Expand Up @@ -178,7 +143,7 @@ END

STRINGTABLE
BEGIN
IDS_APP_TITLE "Brackets"
IDS_APP_TITLE WINDOW_TITLE
IDC_CEFCLIENT "CEFCLIENT"
END

Expand Down
9 changes: 9 additions & 0 deletions appshell/cefclient_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,15 @@ -(BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theAppli
return YES;
}

- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)theApplication {
if (!g_isTerminating && g_handler.get() && !g_handler->AppIsQuitting() && g_handler->HasWindows()) {
g_handler->DispatchCloseToNextBrowser();
return NSTerminateCancel;
}
g_isTerminating = true;
return NSTerminateNow;
}

@end


Expand Down
5 changes: 2 additions & 3 deletions appshell/cefclient_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
// Initialize global strings
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadString(hInstance, IDC_CEFCLIENT, szWindowClass, MAX_LOADSTRING);
MyRegisterClass(hInstance, settings.locale);
MyRegisterClass(hInstance, *(app->GetCurrentLanguage().GetStruct()));

CefRefPtr<CefCommandLine> cmdLine = AppGetCommandLine();
if (cmdLine->HasSwitch(cefclient::kStartupPath)) {
Expand Down Expand Up @@ -183,8 +183,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance,

// Temporary localization hack. Default to English. Check for French.
DWORD menuId = IDC_CEFCLIENT;
if (settings.locale.str && (settings.locale.length > 0) &&
(CefString(settings.locale.str) == CefString("fr-FR")))
if (app->GetCurrentLanguage() == CefString("fr-FR"))
{
menuId = IDC_CEFCLIENT_FR;
}
Expand Down
1 change: 1 addition & 0 deletions appshell/client_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ class ClientHandler : public CefClient,

void QuittingApp(bool quitting) { m_quitting = quitting; }
bool AppIsQuitting() { return m_quitting; }
bool HasWindows() const { return !browser_window_map_.empty(); }

protected:
void SetLoading(bool isLoading);
Expand Down
4 changes: 2 additions & 2 deletions appshell/mac/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string>brackets.icns</string>
<string>appshell.icns</string>
<key>CFBundleIdentifier</key>
<string>io.brackets.appshell</string>
<key>CFBundleInfoDictionaryVersion</key>
Expand All @@ -19,7 +19,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.17.0.0</string>
<string>0.18.0.0</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
Expand Down
File renamed without changes.
File renamed without changes.
68 changes: 68 additions & 0 deletions appshell/version.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#undef APSTUDIO_HIDDEN_SYMBOLS

#define OS_WIN
#include "config.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32

/////////////////////////////////////////////////////////////////////////////
//
// VersionInfo
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,18,0,0
/* PRODUCTVERSION 1,0,0,0 */
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName", "brackets.io\0"
VALUE "FileDescription", "\0"
VALUE "FileVersion", "Sprint 18\0"
VALUE "ProductName", APP_NAME "\0"
VALUE "ProductVersion", "\0"
VALUE "LegalCopyright", "(c) 2012 Adobe Systems, Inc.\0"
END
END

BLOCK "VarFileInfo"
BEGIN
/* The following line should only be modified for localized versions. */
/* It consists of any number of WORD,WORD pairs, with each pair */
/* describing a language,codepage combination supported by the file. */
/* */
/* For example, a file might have values "0x409,1252" indicating that it */
/* supports English language (0x409) in the Windows ANSI codepage (1252). */

VALUE "Translation", 0x409, 1252
VALUE "Translation", 0x40C, 1252
END
END

#endif // !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)

5 changes: 5 additions & 0 deletions appshell_config.gypi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
'variables': {
'appname': "Brackets"
}
}
5 changes: 3 additions & 2 deletions appshell_paths.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,12 @@
'appshell_sources_win': [
'appshell/appshell_extensions_win.cpp',
'appshell/cefclient.rc',
'appshell/version.rc',
'appshell/cefclient_win.cpp',
'appshell/client_app_win.cpp',
'appshell/client_handler_win.cpp',
'appshell/resource.h',
'appshell/res/brackets.ico',
'appshell/res/appshell.ico',
'appshell/resource_util_win.cpp',
],
'appshell_sources_mac': [
Expand Down Expand Up @@ -138,7 +139,7 @@
'appshell/util.h',
],
'appshell_bundle_resources_mac': [
'appshell/mac/brackets.icns',
'appshell/mac/appshell.icns',
'appshell/mac/English.lproj/InfoPlist.strings',
'appshell/mac/English.lproj/MainMenu.xib',
'appshell/mac/French.lproj/InfoPlist.strings',
Expand Down
2 changes: 1 addition & 1 deletion installer/mac/buildInstaller.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# config
releaseName="Brackets Sprint 17"
releaseName="Brackets Sprint 18"
format="bzip2"
encryption="none"
tmpLayout="./dropDmgConfig/layouts/tempLayout"
Expand Down
2 changes: 1 addition & 1 deletion installer/win/Brackets.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ xmlns:fire="http://schemas.microsoft.com/wix/FirewallExtension">
</DirectoryRef>

<DirectoryRef Id="ProgramMenuFolder">
<Component Id="StartMenuShortcut" Guid="{4BEB5C69-F540-49C1-B29F-76D18BCC1D35}" Win64="no" >
<Component Id="StartMenuShortcut" Guid="{199B8324-1B28-403B-8455-066E7257F1E5}" Win64="no" >
<Shortcut Id="AppShortcut" Name="!(loc.ProductName) $(var.ProductVersionName)"
Description="!(loc.ShortcutDescription)"
Target="[INSTALLDIR]\$(var.ExeName).exe" />
Expand Down
7 changes: 4 additions & 3 deletions installer/win/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ Normally, the installer scripts are run from a specific pre-set-up build machine
## To rev the Brackets sprint number
1. Open brackets-win-install-build.xml and change `product.sprint.number`
2. Open brackets-shell\installer\mac\buildInstaller.sh and change `releaseName`
3. Open brackets-shell\appshell\cefclient.rc and change `FILEVERSION` and `"FileVersion"`
4. Open brackets-shell\appshell\mac\Info.plist and change `CFBundleVersion`
5. Open brackets\src\package.json and change `"version"`
3. Open Brackets.wxs and replace the `StartMenuShortcut` GUID property with a newly generated GUID
4. Open brackets-shell\appshell\cefclient.rc and change `FILEVERSION` and `"FileVersion"`
5. Open brackets-shell\appshell\mac\Info.plist and change `CFBundleVersion`
6. Open brackets\src\package.json and change `"version"`

## To build the Brackets installer
1. Sync both the brackets and brackets-shell repos
Expand Down
2 changes: 1 addition & 1 deletion installer/win/brackets-win-install-build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ default="build.mul">
<!-- See also: product name definitions in Brackets_<locale>.wxl -->
<property name="product.shortname" value="Brackets"/>
<property name="product.fullname" value="Brackets"/>
<property name="product.sprint.number" value="17"/>
<property name="product.sprint.number" value="18"/>
<property name="product.version.number" value="0.${product.sprint.number}"/>
<property name="product.version.name" value="Sprint ${product.sprint.number}"/>
<property name="product.manufacturer" value="brackets.io"/>
Expand Down
3 changes: 3 additions & 0 deletions scripts/make_symlinks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ ln -s deps/cef/libcef_dll/ libcef_dll
ln -s deps/cef/Release/ Release
ln -s deps/cef/Resources/ Resources
ln -s deps/cef/tools/ tools

# Make sure scripts in deps/cef/tools are executable
chmod u+x deps/cef/tools/*

0 comments on commit d1a6f1f

Please sign in to comment.