#ifdef NOMINGW
-static define buildString = $"Ecere SDK v0.44 (Without MinGW) -- built on March 13, 2012 ";
+static define buildString = $"Ecere SDK v0.44.08 (Without MinGW) -- built on August 9, 2013 ";
#else
-static define buildString = $"Ecere SDK v0.44 -- built on March 13, 2012 ";
+static define buildString = $"Ecere SDK v0.44.08 -- built on August 9, 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
{
char * name;
void * data;
+ bool add32Bit;
char * OnGetString(char * tempString, void * fieldData, bool * needClass)
{
+ if(add32Bit)
+ {
+ strcpy(tempString, name);
+ strcat(tempString, " (32)");
+ return tempString;
+ }
return name;
}
FileSetTime(outputFile, stats.created, 0, stats.modified);
}
+public enum BitArch { none, bits32, bits64 };
+
struct Component
{
char * name;
Component * subComponents;
bool mandatory;
bool selected;
+ bool available;
+ BitArch arch;
+
Component * parent;
uint requiredSize;
PathCat(path, installPath);
}
- void Install(char * parentPath)
+ void Install(char * parentPath, char * parentPath32)
{
int c;
- if(selected)
+ if(selected && (arch == none || arch == bits32 || osIS64bit))
{
- char path[MAX_LOCATION];
- strcpy(path, parentPath);
- PathCat(path, installPath);
+ char path64[MAX_LOCATION];
+ char path32[MAX_LOCATION];
+ strcpy(path64, parentPath);
+ PathCat(path64, installPath);
+
+ strcpy(path32, parentPath32);
+ PathCat(path32, installPath);
installProgress.installing.SetText($"Installing %s...", name);
((GuiApplication)__thisModule).UpdateDisplay();
if(dataPath)
{
+ char * path = path64;
char source[MAX_LOCATION];
strcpy(source, ":");
strcat(source, dataPath);
+ if(arch == bits32)
+ path = path32;
+
MakeDir(path);
if(FileExists(source).isFile)
if(subComponents)
{
for(c = 0; subComponents[c].name; c++)
- subComponents[c].Install(path);
+ subComponents[c].Install(path64, path32);
}
}
}
};
+
+#ifndef NOMINGW
+define minGWIncluded = true;
+#else
+define minGWIncluded = false;
+#endif
+
Component samples[] =
{
- { "Ecere Chess", "samples/chess", "chess", null, false, true },
- { "Ecere Fractals", "samples/fractals", "fractals", null, false, true },
- { "3D", "samples/3D", "3D", null, false, true },
- { "Audio", "samples/audio", "audio", null, false, true },
- { "Database", "samples/db", "db", null, false, true },
- { "eC", "samples/eC", "eC", null, false, true },
- { "Games", "samples/games", "games", null, false, true },
- { "GUI & Graphics", "samples/guiAndGfx", "guiAndGfx", null, false, true },
- { "Miscellaneous", "samples/misc", "misc", null, false, true },
- { "Networking", "samples/net", "net", null, false, true },
- { "WIA Scanning", "samples/scanning", "scanning", null, false, true },
- { "Threading", "samples/threads", "threads", null, false, true }
+ { "Ecere Chess", "samples/chess", "chess", null, false, true, true, none },
+ { "Ecere Fractals", "samples/fractals", "fractals", null, false, true, true, none },
+ { "3D", "samples/3D", "3D", null, false, true, true, none },
+ { "Android", "samples/android", "android", null, false, true, true, none },
+ { "Audio", "samples/audio", "audio", null, false, true, true, none },
+ { "Database", "samples/db", "db", null, false, true, true, none },
+ { "eC", "samples/eC", "eC", null, false, true, true, none },
+ { "Games", "samples/games", "games", null, false, true, true, none },
+ { "GUI & Graphics", "samples/guiAndGfx", "guiAndGfx", null, false, true, true, none },
+ { "Miscellaneous", "samples/misc", "misc", null, false, true, true, none },
+ { "Networking", "samples/net", "net", null, false, true, true, none },
+ { "WIA Scanning", "samples/scanning", "scanning", null, false, true, true, none },
+ { "Threading", "samples/threads", "threads", null, false, true, true, none }
{ null }
};
public enum CoreSDKID
{
- ide, runtime, ec, eda, vanilla, extras,
-#ifndef NOMINGW
- gcc, gdb, mingw, binutils, make,
-#endif
+ ide, ide32, runtime, runtime32, ec, ec32,
+ gcc, gdb, gdb32, mingw, binutils, make,
none
};
Component coreSDK[CoreSDKID] =
{
- { "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 },
-#ifndef NOMINGW
- { "GNU C Compiler", "mingw/gcc/core", "mingw", null, true, true },
- { "GNU Debugger", "mingw/gdb", "mingw", null, true, true },
- { "MinGW Runtime", "mingw/mingwrt", "mingw", null, true, true },
- { "Binary Utils", "mingw/binutils", "mingw", null, true, true },
- { "GNU Make", "mingw/make", "mingw", null, true, true },
-#endif
+ { "Ecere IDE", "ecere-sdk/ide", "bin", null, true, true, true, bits64 },
+ { "Ecere IDE", "ecere-sdk32/ide", "bin", null, true, true, true, bits32 },
+ { "Runtime Library", "ecere-sdk/ecere.dll", "bin", null, true, true, true, bits64 },
+ { "Runtime Library", "ecere-sdk32/ecere.dll", "bin", null, true, true, true, bits32 },
+ { "eC Compiler", "ecere-sdk/compiler", "bin", null, true, true, true, bits64 },
+ { "eC Compiler", "ecere-sdk32/compiler", "bin", null, true, true, true, bits32 },
+ { "GNU C Compiler", "tdm/gcc/core", "tdm", null, true, true, minGWIncluded, none },
+ { "GNU Debugger", "tdm/gdb", "tdm", null, true, true, minGWIncluded, bits64 },
+ { "GNU Debugger", "tdm/gdb32", "tdm", null, true, true, minGWIncluded, bits32 },
+ { "MinGW Runtime", "tdm/mingwrt", "tdm", null, true, true, minGWIncluded, none },
+ { "Binary Utils", "tdm/binutils", "tdm", null, true, true, minGWIncluded, none },
+ { "GNU Make", "tdm/make", "tdm", null, true, true, minGWIncluded, none },
{ null }
};
-#ifndef NOMINGW
-Component additional[] =
+public enum AdditionalID
{
- { "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 },
+ eda, eda32, vanilla, vanilla32, extras, upx, gnurx, gnurx32, /*pthreads, */cpp, /*w32api, gcci18n, gdbi18n, makei18n, binutilsi18n, */none
+};
+
+Component additional[AdditionalID] =
+{
+ { "Data Access", "ecere-sdk/eda", "bin", null, false, true, true, bits64 },
+ { "Data Access", "ecere-sdk32/eda", "bin", null, false, true, true, bits32 },
+ { "Ecere Vanilla", "ecere-sdk/libecereVanilla.a", "lib", null, false, true, true, bits64 },
+ { "Ecere Vanilla", "ecere-sdk32/libecereVanilla.a", "lib", null, false, true, true, bits32 },
+ { "Ecere Extras", "extras", "extras", null, false, true, true, none },
+ { "UPX", "upx/bin", "upx/bin", null, false, true, true, none },
+ { "GNU Regexp", "tdm/gnurx", "tdm", null, false, true, true, bits64 },
+ { "GNU Regexp", "tdm/gnurx32", "tdm", null, false, true, true, bits32 },
+// { "pthreads", "tdm/pthreads", "mingw", null, false, true, minGWIncluded, none },
+ { "C++ Compiler", "tdm/gcc/c++", "tdm", null, false, true, minGWIncluded, none },
+// { "Win32 APIs", "mingw/w32api", "mingw", null, false, true, minGWIncluded, none },
+/* { "GCC I18n", "mingw/locale/gcc", "tdm", null, false, false, minGWIncluded, none },
+ { "GDB I18n", "mingw/locale/gdb", "tdm", null, false, false, minGWIncluded, none },
+ { "Make I18n", "mingw/locale/make", "tdm", null, false, false, minGWIncluded, none },
+ { "Binutils I18n", "mingw/locale/binutils", "tdm", null, false, false, minGWIncluded, none },
+*/
{ null }
};
-#endif
public enum DocumentationID
{
ecereBook, apiRef, tutorials, coursework,
-#ifndef NOMINGW
gccDoc, gppDocs, gdbDocs, makeDocs, binDocs, mingwDocs, gnurxDocs, upxDocs,
-#endif
none
};
Component documentation[DocumentationID] =
{
- { "Ecere Book", "ecere-sdk/book", "doc", null, false, true },
- { "API Reference", "ecere-sdk/doc", "doc", null, false, true },
- { "Ecere Tutorials", "ecere-sdk/tutorials", "doc", null, false, true },
- { "Ecere Coursework", "ecere-sdk/coursework", "doc", null, false, true },
-#ifndef NOMINGW
- { "GCC Docs", "mingw/doc/gcc", "mingw", null, false, false },
- { "G++ Docs", "mingw/doc/g++", "mingw", null, false, false },
- { "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/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
+ { "Ecere Book", "ecere-sdk/book", "doc", null, false, true, true, none },
+ { "API Reference", "ecere-sdk/doc", "doc", null, false, true, true, none },
+ { "Ecere Tutorials", "ecere-sdk/tutorials", "doc", null, false, true, true, none },
+ { "Ecere Coursework", "ecere-sdk/coursework", "doc", null, false, true, true, none },
+ { "GCC Docs", "tdm/doc/gcc", "tdm", null, false, false, minGWIncluded, none },
+ { "G++ Docs", "tdm/doc/g++", "tdm", null, false, false, minGWIncluded, none },
+ { "GDB Docs", "tdm/doc/gdb", "tdm", null, false, false, minGWIncluded, none },
+ { "Make Docs", "tdm/doc/make", "tdm", null, false, false, minGWIncluded, none },
+ { "Binutils Docs", "tdm/doc/binutils", "tdm", null, false, false, minGWIncluded, none },
+ { "MinGW Docs", "tdm/doc/mingwrt", "tdm", null, false, false, minGWIncluded, none },
+ { "gnurx Docs", "tdm/doc/gnurx", "tdm", null, false, false, minGWIncluded, none },
+ { "UPX Docs", "upx/doc", "upx/doc", null, false, false, minGWIncluded, none },
{ null }
};
public enum ComponentID
{
coreSDK,
-#ifndef NOMINGW
additional,
-#endif
documentation,
samples,
none
Component components[ComponentID] =
{
- { "Core SDK Files", null, null, coreSDK, true, true },
-#ifndef NOMINGW
- { "Additional Support", null, null, additional, false, true },
-#endif
- { "Documentation", null /*"doc"*/, null /*"doc"*/, documentation, false, true },
- { "Samples", null, "samples", samples, false, true },
+ { "Core SDK Files", null, null, coreSDK, true, true, true, none },
+ { "Additional Support", null, null, additional, false, true, true, none },
+ { "Documentation", null /*"doc"*/, null /*"doc"*/, documentation, false, true, true, none },
+ { "Samples", null, "samples", samples, false, true, true, none },
{ null }
};
FileSize totalSize;
char * name;
InstallOption * subOptions;
bool selected;
+ bool available;
DataRow row;
};
enum PathOptions
{
- AddECEREPaths
-#ifndef NOMINGW
- , AddMinGWPaths
-#endif
+ AddECEREPaths, AddMinGWPaths
};
InstallOption pathOptions[] =
{
- { "Add Ecere binaries location to the system path", null, true },
- { "Add MinGW to the system path", null, true }
+ { "Add Ecere binaries location to the user environment path", null, true, true },
+ { "Add MinGW to the user environment path", null, true, minGWIncluded }
{ null }
};
InstallOption options[] =
{
- { "Start Menu Group", null, true },
- { "Desktop Icon", null, true },
- { "Quicklaunch Icon", null, true },
- { "Associate the ECERE IDE with Supported File Types", associateOptions, true },
-#ifndef NOMINGW
- { "Add binaries location to the system paths", pathOptions, true },
-#endif
+ { "Start Menu Group", null, true, true },
+ { "Desktop Icon", null, true, true },
+ { "Quicklaunch Icon", null, true, true },
+ { "Associate the Ecere IDE with Supported File Types", associateOptions, true, true },
+ { "Add binaries location to the user environment paths", pathOptions, true, minGWIncluded },
{ null }
};
char sourceDir[MAX_LOCATION] = ":";
char installDir[MAX_LOCATION];
+char installDir32[MAX_LOCATION];
+bool osIS64bit;
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\" 64 Bit Edition";
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;
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
{
inactive = true, noSelect = true,
multiLine = true, parent = label3, text = "editBox1", opacity = 0, borderStyle = none, size = Size { 350, 35 }, anchor = Anchor { horz = 111, vert = 13 },
- contents = $"Choose in which folder to install the ECERE SDK, which features\n"
+ contents = $"Choose in which folder to install the Ecere SDK, which features\n"
"of the SDK to install, as well as where to install program icons."
};
Label label2 { parent = this, text = buildString, position = { 16, 392 }, font = { "Tahoma", 10, true }, disabled = true, opacity = 0, background = activeBorder };
}
};
Label label4 { parent = label3, text = $"Choose Components, Locations and Install Options", font = FontResource { "Tahoma", 8.25f, bold = true }, size = Size { 326, 16 }, anchor = Anchor { horz = 91, vert = -12 } };
- DataField componentField { "CheckItem", width = 140, header = $"Component" };
+ DataField componentField { "CheckItem", width = 160, header = $"Component" };
DataField locationField { "char *", width = 108, header = $"Destination Folder", editable = true };
- DataField reqField { "FileSize", width = 80, header = $"Req. Space", alignment = right };
- DataField avField { "FileSize64", width = 80, header = $"Avail. Space", alignment = right };
+ DataField reqField { "FileSize", width = 70, header = $"Req. Space", alignment = right };
+ DataField avField { "FileSize64", width = 70, header = $"Avail. Space", alignment = right };
DataField optionField { "CheckItem" };
void SetAvailableSpace(Component component, char * parentPath)
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);
component.parent = parent;
- row.SetData(null, CheckItem { component.name, component } );
+ row.SetData(null, CheckItem { component.name, component, (component.arch == bits32 && osIS64bit) } );
if(component.defInstallPath)
{
row.SetData(locationField, component.installPath);
}
- if(component.mandatory) checkBox.disabled = true;
- if(!component.selected) componentsBox.ToggleCheck(row);
+ if(component.mandatory)
+ {
+ if(component.arch != bits32 || !osIS64bit) // || component == &coreSDK[gdb32])
+ componentsBox.SetDisabled(row, true);
+ else
+ component.selected = false;
+ }
+ else if(component.arch == bits32 && osIS64bit)
+ component.selected = false;
+
+ componentsBox.SetCheck(row, component.selected);
+
if(component.dataPath)
{
char path[MAX_LOCATION];
int c;
for(c = 0; component.subComponents[c].name; c++)
{
- AddComponent(component.subComponents[c], component, path);
- size += component.subComponents[c].requiredSize;
+ Component * sub = &component.subComponents[c];
+ if(sub->available && (osIS64bit || sub->arch == bits32 || sub->arch == none))
+ {
+ AddComponent(sub, component, path);
+ size += sub->requiredSize;
+ }
+ else
+ sub->selected = false;
}
}
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));
if(GetEnvironment("ProgramFiles", programFilesDir, MAX_LOCATION))
{
- strcpy(installDir, programFilesDir);
- PathCat(installDir, "ECERE SDK");
+ char * x86 = strstr(programFilesDir, " (x86)");
+ if(x86)
+ {
+ strcpy(installDir32, programFilesDir);
+ PathCat(installDir32, "Ecere SDK");
+ osIS64bit = true;
+
+ *x86 = 0;
+ strcpy(installDir, programFilesDir);
+ PathCat(installDir, "Ecere SDK");
+ }
+ else
+ {
+ PathCat(installDir, "Ecere SDK");
+ strcpy(installDir, programFilesDir);
+ }
}
else if(homeDrive && homeDrive[0])
{
strcpy(installDir, homeDrive);
- PathCat(installDir, "ECERE SDK");
+ PathCat(installDir, "Ecere SDK");
}
else if(winDir && winDir[0])
{
strcpy(installDir, winDir);
- PathCat(installDir, "..\\ECERE SDK");
+ PathCat(installDir, "..\\Ecere SDK");
}
else
- strcpy(installDir, "C:\\ECERE SDK");
+ strcpy(installDir, "C:\\Ecere SDK");
if(appData && appData[0])
{
static char defSamplesPath[MAX_LOCATION];
static char defExtrasPath[MAX_LOCATION];
strcpy(defSamplesPath, appData);
- PathCat(defSamplesPath, "ECERE SDK\\Samples");
+ PathCat(defSamplesPath, "Ecere SDK\\Samples");
components[samples].defInstallPath = defSamplesPath;
strcpy(defExtrasPath, appData);
- PathCat(defExtrasPath, "ECERE SDK\\extras");
- coreSDK[extras].defInstallPath = defExtrasPath;
+ PathCat(defExtrasPath, "Ecere SDK\\extras");
+ additional[extras].defInstallPath = defExtrasPath;
}
destBox.path = installDir;
class InstallProgress : Window
{
- text = $"Ecere Software Development Kit Setup - v0.44 \"Ryōan-ji\"";
+ text = $"Ecere Software Development Kit Setup - v0.44.08 \"Ryōan-ji\" 64 Bit Edition";
background = activeBorder;
borderStyle = fixed;
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 } };
return true;
}
};
- Label title { parent = label3, text = $"Installing the ECERE SDK", font = FontResource { "Tahoma", 8.25f, bold = true }, size = Size { 326, 16 }, anchor = Anchor { horz = 91, vert = -12 } };
+ Label title { parent = label3, text = $"Installing the Ecere SDK", font = FontResource { "Tahoma", 8.25f, bold = true }, size = Size { 326, 16 }, anchor = Anchor { horz = 91, vert = -12 } };
void OnDrawOverChildren(Surface surface)
{
Installer installer {};
InstallProgress installProgress { autoCreate = false };
-void ModifyPath(char * newPath)
+static void AddPath(char * sysPaths[200], int sysCount, char * paths[200], int * count, char * oldPath, char * userPath, char * path)
{
- char * paths[200];
- int p, count;
- char oldPath[8192];
- CoreSDKID c;
-
- strcpy(oldPath, newPath);
- count = TokenizeWith(oldPath, sizeof(paths) / sizeof(char *), paths, ";", false);
-
- for(c = 0; coreSDK[c].name; c++)
+ int p;
+ bool found = false;
+ for(p = 0; p<sysCount; p++)
+ if(!fstrcmp(sysPaths[p], path))
+ {
+ found = true;
+ break;
+ }
+ for(p = 0; !found && p<*count; p++)
+ if(!fstrcmp(paths[p], path))
+ {
+ found = true;
+ break;
+ }
+ if(!found)
{
- char path[MAX_LOCATION];
- if(c == extras || c == vanilla) continue;
-
- coreSDK[c].GetFullPath(path);
- if(c != ide && c != runtime && c != eda && c != ec)
+ char * start;
+ if(*count)
{
-#ifndef NOMINGW
- if(!pathOptions[PathOptions::AddMinGWPaths].selected)
-#endif
- continue;
- PathCat(path, "bin");
+ strcat(userPath, ";");
+ start = paths[(*count)-1] + strlen(paths[(*count)-1])+1;
}
- else if(!pathOptions[PathOptions::AddECEREPaths].selected) continue;
+ else
+ start = oldPath;
- for(p = 0; p<count; p++)
- if(!fstrcmp(paths[p], path))
- break;
- if(p == count)
+ strcpy(start, path);
+ *(start + strlen(path)) = '\0';
+ paths[(*count)++] = start;
+
+ strcat(userPath, path);
+ }
+}
+
+
+void ModifyPath(char * systemPath, char * userPath)
+{
+ char oldPath[8192], * paths[200], * sysPaths[200];
+ int count, sysCount;
+
+ strcpy(oldPath, userPath);
+ count = TokenizeWith(oldPath, sizeof(paths) / sizeof(char *), paths, ";", false);
+ sysCount = TokenizeWith(systemPath, sizeof(sysPaths) / sizeof(char *), sysPaths, ";", false);
+
+ {
+ CoreSDKID c;
+ for(c = 0; coreSDK[c].name; c++)
{
- char * start;
- if(count)
+ bool found = false;
+ char path[MAX_LOCATION];
+ if(!coreSDK[c].selected) continue;
+ coreSDK[c].GetFullPath(path);
+ if(c != ide && c != runtime && c != ec &&
+ c != ide32 && c != runtime32 && c != ec32)
{
- strcat(newPath, ";");
- start = paths[count-1] + strlen(paths[count-1])+1;
+ if(!pathOptions[PathOptions::AddMinGWPaths].available || !pathOptions[PathOptions::AddMinGWPaths].selected)
+ continue;
+ PathCat(path, "bin");
}
- else
- start = oldPath;
-
- strcpy(start, path);
- *(start + strlen(path)) = '\0';
- paths[count++] = start;
+ else if(!pathOptions[PathOptions::AddECEREPaths].selected) continue;
- strcat(newPath, path);
+ AddPath(sysPaths, sysCount, paths, &count, oldPath, userPath, path);
}
}
-#ifndef NOMINGW
- if(pathOptions[PathOptions::AddMinGWPaths].selected)
{
- int c;
- // Up to before Win32 APIs
- for(c = 0; c < 4 /*additional[c].name*/; c++)
+ AdditionalID c;
+ // Up to C++
+ for(c = 0; c <= cpp; c++)
{
+ bool found = false;
char path[MAX_LOCATION];
+ if(!additional[c].selected || c == vanilla || c == vanilla32 || c == extras) continue;
+ if((c != eda && c != eda32 && c != upx) && (!pathOptions[PathOptions::AddMinGWPaths].available || !pathOptions[PathOptions::AddMinGWPaths].selected))
+ continue;
additional[c].GetFullPath(path);
- if(c != 0) // UPX already is in bin
+ if(c != eda && c != eda32 && c != upx)
PathCat(path, "bin");
- for(p = 0; p<count; p++)
- if(!fstrcmp(paths[p], path))
- break;
-
- if(p == count)
- {
- char * start;
- if(count)
- {
- strcat(newPath, ";");
- start = paths[count-1] + strlen(paths[count-1])+1;
- }
- else
- start = oldPath;
-
- strcpy(start, path);
- *(start + strlen(path)) = '\0';
- paths[count++] = start;
-
- strcat(newPath, path);
- }
+ AddPath(sysPaths, sysCount, paths, &count, oldPath, userPath, path);
}
}
-#endif
}
void AssociateExtension(char * extension, char * description, char *name, char * action, char * path)
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);
}
((GuiApplication)__thisModule).Lock();
installProgress.progressBar.range = totalSize;
for(c = 0; components[c].name && !abortInstall; c++)
- components[c].Install(installDir);
+ components[c].Install(installDir, installDir32);
if(abortInstall)
{
installProgress.progressBar.range = 0;
}
else
{
- CoreSDKID c;
char idePath[MAX_LOCATION];
char userProfile[MAX_LOCATION];
dataClass = class(IDESettings);
};
CompilerConfig compiler;
- installProgress.installing.text = $"Configuring ECERE IDE...";
+ installProgress.installing.text = $"Configuring Ecere IDE...";
((GuiApplication)__thisModule).Unlock();
((GuiApplication)__thisModule).SignalEvent();
compiler = settings.GetCompilerConfig(defaultCompilerName);
if(compiler)
{
- for(c = 0; coreSDK[c].name; c++)
{
- 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");
- }
-
- if(c != vanilla)
+ CoreSDKID c;
+ for(c = 0; coreSDK[c].name; c++)
{
- if(!compiler.executableDirs.Find(path))
- compiler.executableDirs.Add(CopyString(path));
- }
+ char path[MAX_LOCATION];
+ if(!coreSDK[c].selected || !coreSDK[c].available) continue;
+
+ coreSDK[c].GetFullPath(path);
+ if(c != ide && c != runtime && c != ec &&
+ c != ide32 && c != runtime32 && c != ec32)
+ PathCat(path, "bin");
+ MakeSlashPath(path);
+ if((c == ide && osIS64bit) || (c == ide32 && !osIS64bit))
+ {
+ coreSDK[c].GetFullPath(idePath);
+ PathCat(idePath, "ide.exe");
+ }
- if(c == runtime || c == vanilla)
- {
- if(!compiler.libraryDirs.Find(path))
- compiler.libraryDirs.Add(CopyString(path));
+ if(c == runtime || c == runtime32)
+ {
+ if(!compiler.libraryDirs.Find(path))
+ compiler.libraryDirs.Add(CopyString(path));
+ }
}
}
- #ifndef NOMINGW
- // Up to before Win32 APIs
- for(c = 0; c < 4 /*additional[c].name*/; c++)
{
- 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));
+ AdditionalID c;
+ // Up to C++
+ for(c = 0; c <= cpp; c++)
+ {
+ char path[MAX_LOCATION];
+ if(c == extras || !additional[c].selected || !additional[c].available) continue;
+ additional[c].GetFullPath(path);
+ if(c != upx && c != eda && c != vanilla && c != eda32 && c != vanilla32)
+ PathCat(path, "bin");
+ MakeSlashPath(path);
+ if(c == vanilla || c == vanilla32)
+ {
+ if(!compiler.libraryDirs.Find(path))
+ compiler.libraryDirs.Add(CopyString(path));
+ }
+ else
+ {
+ 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[0])
+ settings.ideProjectFileDialogLocation = path;
+ if(!settings.ideFileDialogLocation[0])
+ settings.ideFileDialogLocation = path;
+
+ if(documentation[apiRef].selected)
{
- 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;
+ documentation[apiRef].GetFullPath(path);
+ if(!settings.docDir[0])
+ settings.docDir = path;
}
}
{
HKEY key;
uint status, size;
- char * displayName = "ECERE SDK 0.44";
+ char * displayName = "Ecere SDK 0.44";
char uninstaller[MAX_LOCATION];
bool nomodify = true;
strcpy(uninstaller, installDir);
PathCat(uninstaller, "uninstall_ecere.exe");
- RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\ECERE SDK", 0, "", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, null, &key, &status);
+ 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);
#endif
)
{
- HKEY key;
+ HKEY userKey = null, systemKey = null;
uint status, size;
- char path[4096] = "";
- uint16 wPath[4096];
+ char userPath[8192] = "";
+ char systemPath[8192] = "";
+ uint16 wUserPath[8192];
+ uint16 wSystemPath[8192];
+
+ wUserPath[0] = 0;
+ wSystemPath[0] = 0;
((GuiApplication)__thisModule).Lock();
installProgress.installing.text = "Registering paths...";
((GuiApplication)__thisModule).Unlock();
((GuiApplication)__thisModule).SignalEvent();
- // if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Environment", 0, KEY_ALL_ACCESS, &key) == ERROR_SUCCESS)
+ if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment", 0, KEY_QUERY_VALUE, &systemKey) == ERROR_SUCCESS)
+ {
+ size = sizeof(wSystemPath);
+ RegQueryValueExW(systemKey, L"path", null, null, (byte *)wSystemPath, &size);
+ UTF16toUTF8Buffer(wSystemPath, systemPath, sizeof(systemPath));
+ }
- RegCreateKeyEx(HKEY_CURRENT_USER, "Environment", 0, "", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, null, &key, &status);
- // RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment", 0, "", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, null, &key, &status);
+ RegCreateKeyEx(HKEY_CURRENT_USER, "Environment", 0, "", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, null, &userKey, &status);
if(status == REG_OPENED_EXISTING_KEY)
{
- size = sizeof(wPath);
- RegQueryValueExW(key, L"path", null, null, (byte *)wPath, &size);
- UTF16toUTF8Buffer(wPath, path, sizeof(path));
+ size = sizeof(wUserPath);
+ RegQueryValueExW(userKey, L"path", null, null, (byte *)wUserPath, &size);
+ UTF16toUTF8Buffer(wUserPath, userPath, sizeof(userPath));
}
- ModifyPath(path);
- UTF8toUTF16Buffer(path, wPath, sizeof(wPath) / sizeof(uint16));
- RegSetValueExW(key, L"path", 0, REG_EXPAND_SZ, (byte *)wPath, (wcslen(wPath)+1) * 2);
- RegCloseKey(key);
+ ModifyPath(systemPath, userPath);
+ UTF8toUTF16Buffer(userPath, wUserPath, sizeof(wUserPath) / sizeof(uint16));
+ RegSetValueExW(userKey, L"path", 0, REG_EXPAND_SZ, (byte *)wUserPath, (uint)(wcslen(wUserPath)+1) * 2);
+ RegCloseKey(userKey);
+ RegCloseKey(systemKey);
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");
if(startMenuPath[0])
{
strcpy(destPath, startMenuPath);
- PathCat(destPath, "ECERE SDK");
+ PathCat(destPath, "Ecere SDK");
MakeDir(destPath);
strcpy(destPath, startMenuPath);
- PathCat(destPath, "ECERE SDK\\ECERE IDE.lnk");
- CreateLink(idePath, destPath, null); //"ECERE IDE");
+ PathCat(destPath, "Ecere SDK\\Ecere IDE.lnk");
+ CreateLink(idePath, destPath, null); //"Ecere IDE");
if(components[samples].selected)
{
char samplesPath[MAX_LOCATION] = "";
components[samples].GetFullPath(samplesPath);
strcpy(destPath, startMenuPath);
- PathCat(destPath, "ECERE SDK\\Sample Projects.lnk");
+ PathCat(destPath, "Ecere SDK\\Sample Projects.lnk");
CreateLink(samplesPath, destPath, null);//"Sample Projects");
}
if(components[documentation].selected && documentation[ecereBook].selected)
}
strcpy(destPath, startMenuPath);
- PathCat(destPath, "ECERE SDK\\The Ecere Tao of Programming.lnk");
+ 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");
if(desktopPath[0])
{
- PathCat(desktopPath, "ECERE IDE.lnk");
+ PathCat(desktopPath, "Ecere IDE.lnk");
((GuiApplication)__thisModule).Lock();
installProgress.installing.text = $"Installing Desktop Icon...";
((GuiApplication)__thisModule).Unlock();
((GuiApplication)__thisModule).SignalEvent();
- CreateLink(idePath, desktopPath, null);//"ECERE IDE");
+ CreateLink(idePath, desktopPath, null);//"Ecere IDE");
}
}
// 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];
((GuiApplication)__thisModule).SignalEvent();
strcpy(destPath, appData);
- PathCat(destPath, "Microsoft\\Internet Explorer\\Quick Launch\\ECERE IDE.lnk");
+ PathCat(destPath, "Microsoft\\Internet Explorer\\Quick Launch\\Ecere IDE.lnk");
- CreateLink(idePath, destPath, null);//"ECERE IDE");
+ CreateLink(idePath, destPath, null);//"Ecere IDE");
}
}
if(associateOptions[AssociateOptions::AssociateEPJ].selected)
{
- AssociateExtension(".epj", "ECERE IDE Project", "epj_file", "Open", idePath);
+ AssociateExtension(".epj", "Ecere IDE Project", "epj_file", "Open", idePath);
}
if(associateOptions[AssociateOptions::AssociateEC].selected)
{