#ifdef NOMINGW
-static define buildString = $"Ecere SDK v0.44 (Without MinGW) -- built on March 7, 2012 ";
+static define buildString = $"Ecere SDK v0.44.08 (Without MinGW) -- built on August 8, 2013 ";
#else
-static define buildString = $"Ecere SDK v0.44 -- built on March 7, 2012 ";
+static define buildString = $"Ecere SDK v0.44.08 -- built on August 8, 2013 ";
#endif
#define WIN32_LEAN_AND_MEAN
#endif
import "IDESettings"
import "createLink"
-// import "licenseBox"
import "licensing"
-
-class CheckListBox : ListBox
-{
- fullRowSelect = false, collapseControl = true, treeBranches = true, rootCollapseButton = true,
- noDragging = true;
- rowHeight = 18;
-
- void ToggleCheck(DataRow row)
- {
- Button checkBox = (Button)row.tag;
- DataRow parent;
- bool checked = !(checkBox.checked) || checkBox.buttonState == down;
- if(!checkBox.disabled)
- {
- SetCheck(row, checked);
- checkBox.buttonState = up;
-
- for(parent = row; parent; parent = parent.parent)
- {
- for(row = parent.firstRow; row; row = row.next)
- {
- checkBox = (Button)row.tag;
- if(checkBox.checked != checked)
- break;
- }
- checkBox = (Button)parent.tag;
- if(row)
- {
- checkBox.checked = true;
- NotifyChecked(master, this, parent);
- checkBox.buttonState = down;
- checked = true;
- }
- else
- {
- checkBox.checked = checked;
- NotifyChecked(master, this, parent);
- checkBox.buttonState = up;
- }
- }
- }
- }
-
- void SetCheck(DataRow row, bool checked)
- {
- Button checkBox = (Button)row.tag;
- DataRow subRow;
- if(!checkBox.disabled && (checkBox.checked != checked || checkBox.buttonState == down))
- {
- checkBox.checked = checked;
- for(subRow = row.firstRow; subRow; subRow = subRow.next)
- SetCheck(subRow, checked);
- NotifyChecked(master, this, row);
- }
- }
-
- DataRow AddRow(DataRow parentRow)
- {
- DataRow row = parentRow ? parentRow.AddRow() : ListBox::AddRow();
- int c;
- DataRow parent;
- int indent = 20;
- for(parent = row.parent; parent; parent = parent.parent)
- indent += 20;
- row.tag = (int)Button
- {
- this, isCheckbox = true, inactive = true, checked = true,
- position = { 2 + indent, 1+(row.index + hasHeader) * rowHeight }, size = { 12, 12 };
- id = (int)row;
-
- bool NotifyPushed(Button button, int x, int y, Modifiers mods)
- {
- currentRow = (DataRow)button.id;
- ToggleCheck(currentRow);
- return false;
- }
-
- bool NotifyReleased(Button button, int x, int y, Modifiers mods)
- {
- return false;
- }
-
- bool OnMouseOver(int x, int y, Modifiers mods)
- {
-
- return true;
- }
-
- bool OnMouseLeave(Modifiers mods)
- {
-
- return true;
- }
- };
- return row;
- }
-
- bool NotifyKeyDown(CheckListBox listBox, DataRow row, Key key, unichar ch)
- {
- if(key == space)
- {
- listBox.ToggleCheck(row);
- return false;
- }
- return true;
- }
-
- bool OnKeyHit(Key key, unichar ch)
- {
- if(key == space)
- return false;
- return ListBox::OnKeyHit(key, ch);
- }
-
- bool NotifyDoubleClick(CheckListBox listBox, int x, int y, Modifiers mods)
- {
- listBox.OnLeftButtonDown(x, y, mods);
- return false;
- }
-
- bool NotifyReclick(CheckListBox listBox, DataRow row, Modifiers mods)
- {
- listBox.ToggleCheck(row);
- return true;
- }
-
- bool NotifyCollapse(ListBox listBox, DataRow row, bool collapsed)
- {
- DataRow r;
- for(r = row.firstRow; r && r != row; )
- {
- Button checkBox = (Button)r.tag;
- checkBox.visible = !collapsed;
- if(r.firstRow && !r.collapsed)
- row = r.firstRow;
- else
- for(; r != row; r = r.parent)
- if(r.next) { r = r.next; break; }
- }
- for(r = row.GetNextRow(); r; r = r.GetNextRow())
- {
- Button checkBox = (Button)r.tag;
- checkBox.position.y = 1 + (r.index + listBox.hasHeader) * listBox.rowHeight;
- }
- return true;
- }
-
- virtual void Window::NotifyChecked(CheckListBox listBox, DataRow row);
-};
+import "CheckListBox"
struct CheckItem
{
{ "Ecere IDE", "ecere-sdk/ide", "bin", null, true, true },
{ "Runtime Library", "ecere-sdk/ecere.dll", "bin", null, true, true },
{ "eC Compiler", "ecere-sdk/compiler", "bin", null, true, true },
- { "Data Access", "ecere-sdk/eda", "bin", null, false, true },
- { "Ecere Vanilla", "ecere-sdk/libecereVanilla.a", "lib", null, false, true },
- { "Ecere Extras", "extras", "extras", null, false, true },
#ifndef NOMINGW
{ "GNU C Compiler", "mingw/gcc/core", "mingw", null, true, true },
{ "GNU Debugger", "mingw/gdb", "mingw", null, true, true },
#ifndef NOMINGW
Component additional[] =
{
- { "UPX", "upx/bin", "mingw", null, false, true },
- { "GNU Regexp", "mingw/gnurx", "mingw", null, false, true },
- { "Win32 APIs", "mingw/w32api", "mingw", null, false, true },
- { "pthreads", "mingw/pthreads", "mingw", null, false, true },
- { "C++ Compiler", "mingw/gcc/c++", "mingw", null, false, true },
- { "GCC I18n", "mingw/locale/gcc", "mingw", null, false, false },
- { "GDB I18n", "mingw/locale/gdb", "mingw", null, false, false },
- { "Make I18n", "mingw/locale/make", "mingw", null, false, false },
- { "Binutils I18n", "mingw/locale/binutils", "mingw", null, false, false },
+ { "Data Access", "ecere-sdk/eda", "bin", null, false, true },
+ { "Ecere Vanilla", "ecere-sdk/libecereVanilla.a", "lib", null, false, true },
+ { "Ecere Extras", "extras", "extras", null, false, true },
+ { "UPX", "upx/bin", "mingw/bin",null, false, true },
+ { "GNU Regexp", "mingw/gnurx", "mingw", null, false, true },
+ { "pthreads", "mingw/pthreads", "mingw", null, false, true },
+ { "C++ Compiler", "mingw/gcc/c++", "mingw", null, false, true },
+ { "Win32 APIs", "mingw/w32api", "mingw", null, false, true },
+ { "GCC I18n", "mingw/locale/gcc", "mingw", null, false, false },
+ { "GDB I18n", "mingw/locale/gdb", "mingw", null, false, false },
+ { "Make I18n", "mingw/locale/make", "mingw", null, false, false },
+ { "Binutils I18n", "mingw/locale/binutils", "mingw", null, false, false },
{ null }
};
#endif
{ "GDB Docs", "mingw/doc/gdb", "mingw", null, false, false },
{ "Make Docs", "mingw/doc/make", "mingw", null, false, false },
{ "Binutils Docs", "mingw/doc/binutils", "mingw", null, false, false },
- { "MinGW Docs", "mingw/doc/mingw", "mingw", null, false, false },
+ { "MinGW Docs", "mingw/doc/mingwrt", "mingw", null, false, false },
{ "gnurx Docs", "mingw/doc/gnurx", "mingw", null, false, false },
{ "UPX Docs", "upx/doc", "mingw/doc/upx", null, false, false },
#endif
class Installer : Window
{
- text = $"Ecere Software Development Kit Setup - v0.44 \"Ryōan-ji\"";
+ text = $"Ecere Software Development Kit Setup - v0.44.08 \"Ryōan-ji\"";
background = activeBorder;
borderStyle = fixed;
hasMinimize = true;
hasClose = true;
tabCycle = true;
clientSize = { 636, 456 };
+ // clientSize = { 796, 576 };
icon = { ":icon.png" };
Picture back { image = BitmapResource { ":ryoanji.png" }, parent = this, position = { 0, 0 } };
};
Button browse
{
- master = this, autoCreate = false, inactive = true, /*hotKey = F2,*/ text = "...";
+ master = this, autoCreate = false, inactive = true, text = "...";
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
{
CheckListBox componentsBox
{
this, size = { 460, 112 }, position = { 160, 160 }, hasHeader = true;
+ fullRowSelect = false, collapseControl = true, treeBranches = true, rootCollapseButton = true,
+ noDragging = true;
+ rowHeight = 18;
+ selectionColor = { 145, 150, 140 };
+
alwaysEdit = true;
opacity = 0;
+ bool NotifyKeyDown(ListBox listBox, DataRow row, Key key, unichar ch)
+ {
+ if(key == f2 && browse.visible)
+ browse.NotifyClicked(this, browse, 0, 0, 0);
+ return true;
+ }
+
bool NotifyChanged(ListBox listBox, DataRow row)
{
Component * component = ((CheckItem *)listBox.GetData(componentField))->data;
- char path[MAX_LOCATION], relative[MAX_LOCATION] = "", ** newPath;
+ char path[MAX_LOCATION], relative[MAX_LOCATION] = "", * newPath;
char fullPath[MAX_LOCATION];
component->parent->GetFullPath(path);
strcpy(fullPath, path);
- newPath = (char **)row.GetData(locationField);
- if(newPath && *newPath)
+ newPath = row.GetData(locationField);
+ if(newPath)
{
- PathCat(fullPath, *newPath);
+ PathCat(fullPath, newPath);
MakePathRelative(fullPath, path, relative);
}
listBox.SetData(locationField, relative);
bool NotifyEdited(ListBox listBox, DataRow row)
{
+ Window e;
browse.parent = listBox;
browse.position = { componentField.width + locationField.width + 18, (listBox.currentIndex+1) * listBox.rowHeight - 2 };
browse.size = { 30, listBox.rowHeight + 3 };
-
+ for(e = listBox.firstChild; e; e = e.next)
+ {
+ if(e._class == class(DataBox))
+ break;
+ }
+ if(e)
+ e.Activate();
browse.Create();
return true;
}
{
Component * component = ((CheckItem *)row.GetData(componentField))->data;
int c;
- Button checkBox = (Button)row.tag;
- component->selected = checkBox.checked;
+ component->selected = listBox.IsChecked(row);
if(!component->parent) totalSize -= component->requiredSize;
component->requiredSize = 0;
CheckListBox optionsBox
{
this, size = { 460, 94 }, position = { 160, 284 };
+ fullRowSelect = false, collapseControl = true, treeBranches = true, rootCollapseButton = true,
+ noDragging = true;
+ rowHeight = 18;
opacity = 0;
void NotifyChecked(CheckListBox listBox, DataRow row)
{
CheckItem * item = row.GetData(optionField);
InstallOption * option = item->data;
- int c;
- Button checkBox = (Button)row.tag;
- option->selected = checkBox.checked;
+ option->selected = listBox.IsChecked(row);
}
};
Button install
void AddComponent(Component component, Component parent, char * parentPath)
{
- DataRow row = component.row = componentsBox.AddRow((parent != null) ? parent.row : null);
- Button checkBox = (Button) row.tag;
+ DataRow row = (parent != null) ? parent.row.AddRow() : componentsBox.AddRow();
FileSize size = 0;
FileSize64 avSize = 0;
char path[MAX_LOCATION];
+
+ component.row = row;
strcpy(path, parentPath);
if(component.defInstallPath)
PathCat(path, component.defInstallPath);
row.SetData(locationField, component.installPath);
}
- if(component.mandatory) checkBox.disabled = true;
- if(!component.selected) componentsBox.ToggleCheck(row);
+ if(component.mandatory)
+ componentsBox.SetDisabled(row, true);
+ componentsBox.SetCheck(row, component.selected);
+
if(component.dataPath)
{
char path[MAX_LOCATION];
void AddOption(InstallOption option, InstallOption parent)
{
- DataRow row = option.row = optionsBox.AddRow((parent != null) ? parent.row : null);
+ DataRow row = option.row = (parent != null) ? parent.row.AddRow() : optionsBox.AddRow();
row.SetData(null, CheckItem { option.name, option } );
- if(!option.selected)
- optionsBox.ToggleCheck(row);
+ optionsBox.SetCheck(row, option.selected);
if(option.subOptions)
{
int c;
{
int c;
char programFilesDir[MAX_LOCATION];
- char appData[MAX_LOCATION]; // = getenv("APPDATA");
- char homeDrive[MAX_LOCATION]; //= getenv("HOMEDRIVE");
- char winDir[MAX_LOCATION]; //= getenv("windir");
+ char appData[MAX_LOCATION];
+ char homeDrive[MAX_LOCATION];
+ char winDir[MAX_LOCATION];
GetEnvironment("APPDATA", appData, sizeof(appData));
GetEnvironment("HOMEDRIVE", homeDrive, sizeof(homeDrive));
hasMinimize = true;
hasClose = true;
tabCycle = true;
- size = Size { 640, 480 };
+ // size = Size { 640, 480 };
+ clientSize = { 636, 456 };
+ //clientSize = { 796, 576 };
icon = { ":icon.png" };
Picture back { image = BitmapResource { ":ryoanji-progress.png" }, parent = this, position = { 0, 0 } };
void ModifyPath(char * newPath)
{
- char * paths[100];
+ char * paths[200];
int p, count;
- char oldPath[4096];
+ char oldPath[8192];
CoreSDKID c;
strcpy(oldPath, newPath);
if(count)
{
strcat(newPath, ";");
- start = oldPath + strlen(paths[count-1])+1;
+ start = paths[count-1] + strlen(paths[count-1])+1;
}
else
start = oldPath;
if(pathOptions[PathOptions::AddMinGWPaths].selected)
{
int c;
- for(c = 0; additional[c].name; c++)
+ // Up to before Win32 APIs
+ for(c = 0; c < 4 /*additional[c].name*/; c++)
{
char path[MAX_LOCATION];
- NamedItem item;
additional[c].GetFullPath(path);
- PathCat(path, "bin");
+ if(c != 0) // UPX already is in bin
+ PathCat(path, "bin");
for(p = 0; p<count; p++)
if(!fstrcmp(paths[p], path))
break;
if(count)
{
strcat(newPath, ";");
- start = oldPath + strlen(paths[count-1])+1;
+ start = paths[count-1] + strlen(paths[count-1])+1;
}
else
start = oldPath;
char keyName[1024];
RegCreateKeyEx(HKEY_CLASSES_ROOT, extension, 0, "", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, null, &key, &status);
- RegSetValueEx(key, null, 0, REG_SZ, name, strlen(name)+1);
+ RegSetValueEx(key, null, 0, REG_SZ, name, (uint)strlen(name)+1);
RegCloseKey(key);
RegCreateKeyEx(HKEY_CLASSES_ROOT, name, 0, "", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, null, &key, &status);
- RegSetValueEx(key, null, 0, REG_SZ, description, strlen(description)+1);
+ RegSetValueEx(key, null, 0, REG_SZ, description, (uint)strlen(description)+1);
RegCloseKey(key);
sprintf(keyName, "%s\\shell", extension);
RegCreateKeyEx(HKEY_CLASSES_ROOT, keyName, 0, "", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, null, &key, &status);
- RegSetValueEx(key, null, 0, REG_SZ, action, strlen(action)+1);
+ RegSetValueEx(key, null, 0, REG_SZ, action, (uint)strlen(action)+1);
RegCloseKey(key);
sprintf(keyName, "%s\\shell\\%s", name, action);
{
uint16 wKeyName[2048];
UTF8toUTF16Buffer(keyName, wKeyName, sizeof(wKeyName) / sizeof(uint16));
- RegSetValueExW(key, null, 0, REG_SZ, (byte *)wKeyName, (wcslen(wKeyName) + 1)*sizeof(uint16));
+ RegSetValueExW(key, null, 0, REG_SZ, (byte *)wKeyName, (uint)(wcslen(wKeyName) + 1)*sizeof(uint16));
}
RegCloseKey(key);
}
char userProfile[MAX_LOCATION];
// Configure IDE
- GlobalSettings settings
+ IDESettings settings = null; // Don't instantiate yet so we can pick up old settings
+
+ IDESettingsContainer settingsContainer
{
-
+ driver = "JSON";
+ dataOwner = &settings;
+ dataClass = class(IDESettings);
};
+ CompilerConfig compiler;
installProgress.installing.text = $"Configuring ECERE IDE...";
((GuiApplication)__thisModule).Unlock();
((GuiApplication)__thisModule).SignalEvent();
- settings.Load();
- for(c = 0; coreSDK[c].name; c++)
+ settingsContainer.Load();
+ compiler = settings.GetCompilerConfig(defaultCompilerName);
+ if(compiler)
{
- char path[MAX_LOCATION];
- NamedItem item;
- coreSDK[c].GetFullPath(path);
- if(c != ide && c != runtime && c != eda && c != ec)
- PathCat(path, "bin");
- if(c == ide)
+ for(c = 0; coreSDK[c].name; c++)
{
- coreSDK[c].GetFullPath(idePath);
- PathCat(idePath, "IDE.exe");
- }
+ char path[MAX_LOCATION];
+
+ if(c == extras) continue;
+ coreSDK[c].GetFullPath(path);
+ if(c != ide && c != runtime && c != eda && c != ec && c != vanilla)
+ PathCat(path, "bin");
+ MakeSlashPath(path);
+ if(c == ide)
+ {
+ coreSDK[c].GetFullPath(idePath);
+ PathCat(idePath, "IDE.exe");
+ }
- // TODO: Update This!
- /*
- for(item = settings.systemDirs[executables].first; item; item = item.next)
- if(!fstrcmp(item.name, path))
- break;
- if(!item)
- {
- settings.systemDirs[executables].Add(NamedItem { name = CopyString(path); });
- }
+ if(c != vanilla)
+ {
+ if(!compiler.executableDirs.Find(path))
+ compiler.executableDirs.Add(CopyString(path));
+ }
- if(c == runtime)
- {
- for(item = settings.systemDirs[libraries].first; item; item = item.next)
- if(!fstrcmp(item.name, path))
- break;
- if(!item)
+ if(c == runtime || c == vanilla)
{
- settings.systemDirs[libraries].Add(NamedItem { name = CopyString(path); });
+ if(!compiler.libraryDirs.Find(path))
+ compiler.libraryDirs.Add(CopyString(path));
}
}
- */
- }
-#ifndef NOMINGW
- /*
- for(c = 0; additional[c].name; c++)
- {
- char path[MAX_LOCATION];
- NamedItem item;
- additional[c].GetFullPath(path);
- PathCat(path, "bin");
- for(item = settings.systemDirs[executables].first; item; item = item.next)
- if(!fstrcmp(item.name, path))
- break;
- if(!item)
+ #ifndef NOMINGW
+ // Up to before Win32 APIs
+ for(c = 0; c < 4 /*additional[c].name*/; c++)
{
- settings.systemDirs[executables].Add(NamedItem { name = CopyString(path); });
+ char path[MAX_LOCATION];
+ additional[c].GetFullPath(path);
+ if(c != 0) // upx
+ PathCat(path, "bin");
+ MakeSlashPath(path);
+ if(!compiler.executableDirs.Find(path))
+ compiler.executableDirs.Add(CopyString(path));
+ }
+ #endif
+
+ {
+ char path[MAX_LOCATION] = "";
+ if(components[samples].selected)
+ components[samples].GetFullPath(path);
+ else
+ components[coreSDK].GetFullPath(path);
+
+ if(!settings.ideProjectFileDialogLocation)
+ settings.ideProjectFileDialogLocation = path;
+ if(!settings.ideFileDialogLocation)
+ settings.ideFileDialogLocation = path;
}
- }
- */
-#endif
-
- {
- char path[MAX_LOCATION] = "";
- if(components[samples].selected)
- components[samples].GetFullPath(path);
- else
- components[coreSDK].GetFullPath(path);
- /* TODO: Update This!
- if(!settings.ideProjectFileDialogLocation)
- settings.ideProjectFileDialogLocation = path;
- if(!settings.ideFileDialogLocation)
- settings.ideFileDialogLocation = path;
- */
}
- settings.Save();
+ settingsContainer.Save();
+ delete settingsContainer;
delete settings;
// Set up Uninstaller
RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\ECERE SDK", 0, "", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, null, &key, &status);
- RegSetValueEx(key, "DisplayName", 0, REG_SZ, displayName, strlen(displayName)+1);
- RegSetValueEx(key, "UninstallString", 0, REG_SZ, uninstaller, strlen(uninstaller)+1);
- RegSetValueEx(key, "DisplayIcon", 0, REG_SZ, idePath, strlen(idePath)+1);
+ RegSetValueEx(key, "DisplayName", 0, REG_SZ, displayName, (uint)strlen(displayName)+1);
+ RegSetValueEx(key, "UninstallString", 0, REG_SZ, uninstaller, (uint)strlen(uninstaller)+1);
+ RegSetValueEx(key, "DisplayIcon", 0, REG_SZ, idePath, (uint)strlen(idePath)+1);
//RegSetValueEx(key, "NoModify", 0, REG_DWORD, (byte *)&nomodify, sizeof(nomodify));
//RegSetValueEx(key, "NoRepair", 0, REG_DWORD, (byte *)&nomodify, sizeof(nomodify));
RegCloseKey(key);
{
HKEY key;
uint status, size;
- char path[2048] = "";
- uint16 wPath[2048];
+ char path[4096] = "";
+ uint16 wPath[4096];
((GuiApplication)__thisModule).Lock();
installProgress.installing.text = "Registering paths...";
}
ModifyPath(path);
UTF8toUTF16Buffer(path, wPath, sizeof(wPath) / sizeof(uint16));
- RegSetValueExW(key, L"path", 0, REG_EXPAND_SZ, (byte *)wPath, (wcslen(wPath)+1) * 2);
+ RegSetValueExW(key, L"path", 0, REG_EXPAND_SZ, (byte *)wPath, (uint)(wcslen(wPath)+1) * 2);
RegCloseKey(key);
SendMessageTimeout (HWND_BROADCAST, WM_SETTINGCHANGE, 0, (int)"Environment", SMTO_NORMAL, 1000, NULL);
}
// Install Program Group Icons
- // userProfile = getenv("USERPROFILE");
GetEnvironment("USERPROFILE", userProfile, sizeof(userProfile));
if(options[IconOptions::StartMenuIcon].selected)
UTF16toUTF8Buffer(wStartMenuPath, startMenuPath, sizeof(startMenuPath));
RegCloseKey(key);
}
- if(!startMenuPath[0] && userProfile && userProfile[0])
+ if(!startMenuPath[0] && userProfile[0])
{
strcpy(startMenuPath, userProfile);
PathCat(startMenuPath, "Start Menu\\Programs");
documentation[ecereBook].GetFullPath(docPath);
PathCat(docPath, "Ecere Tao of Programming [work in progress].pdf");
+ {
+ char tao[MAX_LOCATION] ;
+ documentation[ecereBook].GetFullPath(tao);
+ PathCat(tao, "tao.pdf");
+ RenameFile(tao, docPath);
+ }
+
strcpy(destPath, startMenuPath);
PathCat(destPath, "ECERE SDK\\The Ecere Tao of Programming.lnk");
CreateLink(docPath, destPath, null);
UTF16toUTF8Buffer(wDesktopPath, desktopPath, sizeof(desktopPath));
RegCloseKey(key);
}
- if(!desktopPath[0] && userProfile && userProfile[0])
+ if(!desktopPath[0] && userProfile[0])
{
strcpy(desktopPath, userProfile);
PathCat(desktopPath, "Desktop");
// Install QuickLaunch Icon
if(options[IconOptions::QuickLaunchIcon].selected)
{
- char appData[MAX_LOCATION]; // = getenv("APPDATA");
+ char appData[MAX_LOCATION];
GetEnvironment("APPDATA", appData, sizeof(appData));
- if(appData && appData[0])
+ if(appData[0])
{
char destPath[MAX_LOCATION];