[sword-svn] r90 - trunk/src/Installer - VC2005
bdrake at www.crosswire.org
bdrake at www.crosswire.org
Fri Jan 18 10:04:43 MST 2008
Author: bdrake
Date: 2008-01-18 10:04:43 -0700 (Fri, 18 Jan 2008)
New Revision: 90
Added:
trunk/src/Installer - VC2005/AssemblyInfo.cpp
trunk/src/Installer - VC2005/Form1.h
trunk/src/Installer - VC2005/Form1.resx
trunk/src/Installer - VC2005/ReadMe.txt
trunk/src/Installer - VC2005/SRInstallMGR.cpp
trunk/src/Installer - VC2005/SRInstallMGR.sln
trunk/src/Installer - VC2005/SRInstallMGR.suo
trunk/src/Installer - VC2005/SRInstallMGR.vcproj
trunk/src/Installer - VC2005/app.ico
trunk/src/Installer - VC2005/app.rc
trunk/src/Installer - VC2005/doInstall.cpp
trunk/src/Installer - VC2005/doInstall.h
trunk/src/Installer - VC2005/resource.h
trunk/src/Installer - VC2005/stdafx.cpp
trunk/src/Installer - VC2005/stdafx.h
Log:
Installer amended to build under Visual Studio 2005
Added: trunk/src/Installer - VC2005/AssemblyInfo.cpp
===================================================================
--- trunk/src/Installer - VC2005/AssemblyInfo.cpp (rev 0)
+++ trunk/src/Installer - VC2005/AssemblyInfo.cpp 2008-01-18 17:04:43 UTC (rev 90)
@@ -0,0 +1,40 @@
+#include "stdafx.h"
+
+using namespace System;
+using namespace System::Reflection;
+using namespace System::Runtime::CompilerServices;
+using namespace System::Runtime::InteropServices;
+using namespace System::Security::Permissions;
+
+//
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+//
+[assembly:AssemblyTitleAttribute("SRInstallMGR")];
+[assembly:AssemblyDescriptionAttribute("")];
+[assembly:AssemblyConfigurationAttribute("")];
+[assembly:AssemblyCompanyAttribute("")];
+[assembly:AssemblyProductAttribute("SRInstallMGR")];
+[assembly:AssemblyCopyrightAttribute("Copyright (c) 2008")];
+[assembly:AssemblyTrademarkAttribute("")];
+[assembly:AssemblyCultureAttribute("")];
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the value or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly:AssemblyVersionAttribute("1.0.*")];
+
+[assembly:ComVisible(false)];
+
+[assembly:CLSCompliantAttribute(true)];
+
+[assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)];
Added: trunk/src/Installer - VC2005/Form1.h
===================================================================
--- trunk/src/Installer - VC2005/Form1.h (rev 0)
+++ trunk/src/Installer - VC2005/Form1.h 2008-01-18 17:04:43 UTC (rev 90)
@@ -0,0 +1,135 @@
+#pragma once
+#include "doInstall.h"
+
+namespace SRInstallMGR {
+
+ using namespace System;
+ using namespace System::ComponentModel;
+ using namespace System::Collections;
+ using namespace System::Windows::Forms;
+ using namespace System::Data;
+ using namespace System::Drawing;
+
+ /// <summary>
+ /// Summary for Form1
+ ///
+ /// WARNING: If you change the name of this class, you will need to change the
+ /// 'Resource File Name' property for the managed resource compiler tool
+ /// associated with all .resx files this class depends on. Otherwise,
+ /// the designers will not be able to interact properly with localized
+ /// resources associated with this form.
+ /// </summary>
+ public ref class Form1 : public System::Windows::Forms::Form
+ {
+ public:
+ Form1(void)
+ {
+ InitializeComponent();
+ //
+ //TODO: Add the constructor code here
+ //
+ }
+
+ protected:
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ ~Form1()
+ {
+ if (components)
+ {
+ delete components;
+ }
+ }
+ private: System::Windows::Forms::TextBox^ textBox1;
+ protected:
+ private: System::Windows::Forms::Button^ button1;
+ private: System::Windows::Forms::Button^ button2;
+
+ private:
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ System::ComponentModel::Container ^components;
+
+#pragma region Windows Form Designer generated code
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ void InitializeComponent(void)
+ {
+ System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
+ this->textBox1 = (gcnew System::Windows::Forms::TextBox());
+ this->button1 = (gcnew System::Windows::Forms::Button());
+ this->button2 = (gcnew System::Windows::Forms::Button());
+ this->SuspendLayout();
+ //
+ // textBox1
+ //
+ this->textBox1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 14.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
+ static_cast<System::Byte>(0)));
+ this->textBox1->Location = System::Drawing::Point(8, 8);
+ this->textBox1->Multiline = true;
+ this->textBox1->Name = L"textBox1";
+ this->textBox1->Size = System::Drawing::Size(450, 284);
+ this->textBox1->TabIndex = 0;
+ this->textBox1->Text = resources->GetString(L"textBox1.Text");
+ this->textBox1->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
+ //
+ // button1
+ //
+ this->button1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 14.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
+ static_cast<System::Byte>(0)));
+ this->button1->Location = System::Drawing::Point(9, 300);
+ this->button1->Name = L"button1";
+ this->button1->Size = System::Drawing::Size(304, 84);
+ this->button1->TabIndex = 1;
+ this->button1->Text = L"Click to scan Mobile Device";
+ this->button1->UseVisualStyleBackColor = true;
+ this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
+ this->button1->MouseEnter += gcnew System::EventHandler(this, &Form1::button1_MouseEnter);
+ //
+ // button2
+ //
+ this->button2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 14.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
+ static_cast<System::Byte>(0)));
+ this->button2->Location = System::Drawing::Point(332, 302);
+ this->button2->Name = L"button2";
+ this->button2->Size = System::Drawing::Size(125, 81);
+ this->button2->TabIndex = 2;
+ this->button2->Text = L"Cancel";
+ this->button2->UseVisualStyleBackColor = true;
+ this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click);
+ //
+ // Form1
+ //
+ this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
+ this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
+ this->ClientSize = System::Drawing::Size(464, 390);
+ this->Controls->Add(this->button2);
+ this->Controls->Add(this->button1);
+ this->Controls->Add(this->textBox1);
+ this->Name = L"Form1";
+ this->Text = L"Sword Reader Module Manager";
+ this->ResumeLayout(false);
+ this->PerformLayout();
+
+ }
+#pragma endregion
+ private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
+ textBox1->Clear();
+ textBox1->Text = "*WORKING*";
+ const char* OutStr = doInstall();
+ Application::Exit();
+ }
+ private: System::Void button1_MouseEnter(System::Object^ sender, System::EventArgs^ e) {
+ textBox1->Clear();
+ textBox1->Text = "Click button and wait for Install Manager screen. We first need to catalogue your existing modules. This may take a few seconds ..... please wait!";
+ }
+ private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
+ Application::Exit();
+ }
+};
+}
+
Added: trunk/src/Installer - VC2005/Form1.resx
===================================================================
--- trunk/src/Installer - VC2005/Form1.resx (rev 0)
+++ trunk/src/Installer - VC2005/Form1.resx 2008-01-18 17:04:43 UTC (rev 90)
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <data name="textBox1.Text" xml:space="preserve">
+ <value>About to start cataloguing the Sword installation on your device.
+
+This assumes that there is already a valid installation of SwordReader on the connected device. If not, then we recommend that you first install the SwordReader starter-pack.
+
+Before clicking on button, ensure that your device is connected, and ActiveSync is in operation and showing connection.
+</value>
+ </data>
+</root>
\ No newline at end of file
Added: trunk/src/Installer - VC2005/ReadMe.txt
===================================================================
--- trunk/src/Installer - VC2005/ReadMe.txt (rev 0)
+++ trunk/src/Installer - VC2005/ReadMe.txt 2008-01-18 17:04:43 UTC (rev 90)
@@ -0,0 +1,33 @@
+========================================================================
+ APPLICATION : SRInstallMGR Project Overview
+========================================================================
+
+AppWizard has created this SRInstallMGR Application for you.
+
+This file contains a summary of what you will find in each of the files that
+make up your SRInstallMGR application.
+
+SRInstallMGR.vcproj
+ This is the main project file for VC++ projects generated using an Application Wizard.
+ It contains information about the version of Visual C++ that generated the file, and
+ information about the platforms, configurations, and project features selected with the
+ Application Wizard.
+
+SRInstallMGR.cpp
+ This is the main application source file.
+ Contains the code to display the form.
+
+Form1.h
+ Contains the implementation of your form class and InitializeComponent() function.
+
+AssemblyInfo.cpp
+ Contains custom attributes for modifying assembly metadata.
+
+/////////////////////////////////////////////////////////////////////////////
+Other standard files:
+
+StdAfx.h, StdAfx.cpp
+ These files are used to build a precompiled header (PCH) file
+ named SRInstallMGR.pch and a precompiled types file named StdAfx.obj.
+
+/////////////////////////////////////////////////////////////////////////////
Added: trunk/src/Installer - VC2005/SRInstallMGR.cpp
===================================================================
--- trunk/src/Installer - VC2005/SRInstallMGR.cpp (rev 0)
+++ trunk/src/Installer - VC2005/SRInstallMGR.cpp 2008-01-18 17:04:43 UTC (rev 90)
@@ -0,0 +1,18 @@
+// SRInstallMGR.cpp : main project file.
+
+#include "stdafx.h"
+#include "Form1.h"
+
+using namespace SRInstallMGR;
+
+[STAThreadAttribute]
+int main(array<System::String ^> ^args)
+{
+ // Enabling Windows XP visual effects before any controls are created
+ Application::EnableVisualStyles();
+ Application::SetCompatibleTextRenderingDefault(false);
+
+ // Create the main window and run it
+ Application::Run(gcnew Form1());
+ return 0;
+}
Added: trunk/src/Installer - VC2005/SRInstallMGR.sln
===================================================================
--- trunk/src/Installer - VC2005/SRInstallMGR.sln (rev 0)
+++ trunk/src/Installer - VC2005/SRInstallMGR.sln 2008-01-18 17:04:43 UTC (rev 90)
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SRInstallMGR", "SRInstallMGR.vcproj", "{226BC215-6889-4ABC-853B-C5E8219BC9C3}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {226BC215-6889-4ABC-853B-C5E8219BC9C3}.Debug|Win32.ActiveCfg = Debug|Win32
+ {226BC215-6889-4ABC-853B-C5E8219BC9C3}.Debug|Win32.Build.0 = Debug|Win32
+ {226BC215-6889-4ABC-853B-C5E8219BC9C3}.Release|Win32.ActiveCfg = Release|Win32
+ {226BC215-6889-4ABC-853B-C5E8219BC9C3}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
Added: trunk/src/Installer - VC2005/SRInstallMGR.suo
===================================================================
(Binary files differ)
Property changes on: trunk/src/Installer - VC2005/SRInstallMGR.suo
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/Installer - VC2005/SRInstallMGR.vcproj
===================================================================
--- trunk/src/Installer - VC2005/SRInstallMGR.vcproj (rev 0)
+++ trunk/src/Installer - VC2005/SRInstallMGR.vcproj 2008-01-18 17:04:43 UTC (rev 90)
@@ -0,0 +1,282 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="SRInstallMGR"
+ ProjectGUID="{226BC215-6889-4ABC-853B-C5E8219BC9C3}"
+ RootNamespace="SRInstallMGR"
+ Keyword="ManagedCProj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ ManagedExtensions="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="C:\Program Files\Windows CE Tools\wce420\POCKET PC 2003\ActiveSync\inc;C:\Program Files\Microsoft eMbedded Tools\include"
+ PreprocessorDefinitions="WIN32;_DEBUG"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="2"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="rapi.lib $(NOINHERIT)"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="C:\Program Files\Windows CE Tools\wce420\POCKET PC 2003\Activesync\Lib"
+ GenerateDebugInformation="true"
+ AssemblyDebug="1"
+ SubSystem="2"
+ EntryPointSymbol="main"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ ManagedExtensions="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="WIN32;NDEBUG"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="2"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="$(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ EntryPointSymbol="main"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ <AssemblyReference
+ RelativePath="System.dll"
+ AssemblyName="System, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
+ />
+ <AssemblyReference
+ RelativePath="System.Data.dll"
+ AssemblyName="System.Data, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=x86"
+ />
+ <AssemblyReference
+ RelativePath="System.Drawing.dll"
+ AssemblyName="System.Drawing, Version=2.0.0.0, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
+ />
+ <AssemblyReference
+ RelativePath="System.Windows.Forms.dll"
+ AssemblyName="System.Windows.Forms, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
+ />
+ <AssemblyReference
+ RelativePath="System.XML.dll"
+ AssemblyName="System.Xml, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
+ />
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\AssemblyInfo.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\doInstall.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\SRInstallMGR.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\stdafx.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath=".\doInstall.h"
+ >
+ </File>
+ <File
+ RelativePath=".\Form1.h"
+ FileType="3"
+ >
+ <File
+ RelativePath=".\Form1.resX"
+ SubType="Designer"
+ >
+ </File>
+ </File>
+ <File
+ RelativePath=".\resource.h"
+ >
+ </File>
+ <File
+ RelativePath=".\stdafx.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ <File
+ RelativePath=".\app.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\app.rc"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath=".\ReadMe.txt"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: trunk/src/Installer - VC2005/app.ico
===================================================================
(Binary files differ)
Property changes on: trunk/src/Installer - VC2005/app.ico
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/Installer - VC2005/app.rc
===================================================================
--- trunk/src/Installer - VC2005/app.rc (rev 0)
+++ trunk/src/Installer - VC2005/app.rc 2008-01-18 17:04:43 UTC (rev 90)
@@ -0,0 +1,63 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon placed first or with lowest ID value becomes application icon
+
+LANGUAGE 9, 2
+#pragma code_page(1252)
+1 ICON "app.ico"
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+ "\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
Added: trunk/src/Installer - VC2005/doInstall.cpp
===================================================================
--- trunk/src/Installer - VC2005/doInstall.cpp (rev 0)
+++ trunk/src/Installer - VC2005/doInstall.cpp 2008-01-18 17:04:43 UTC (rev 90)
@@ -0,0 +1,522 @@
+#include "stdafx.h"
+#include "Form1.h"
+#include <tchar.h>
+#include <rapi.h>
+#include <windows.h>
+#include <fstream>
+
+using namespace SRInstallMGR;
+using namespace System;
+using namespace System::IO;
+
+TCHAR swordPath[MAX_PATH];
+
+const char *stristr(const char *haystack, const char *needle){ // not mine - nicked this off the 'net
+if ( !*needle )
+ return haystack;
+for ( ; *haystack; ++haystack ){
+ if ( toupper(*haystack) == toupper(*needle) ){
+ const char *h, *n;
+ for ( h = haystack, n = needle; *h && *n; ++h, ++n ){
+ if ( toupper(*h) != toupper(*n) )break;
+ }
+ if ( !*n )
+ return haystack; //return the start of the match
+ }
+ }
+return 0;
+}
+
+char *wstrtostr(const wchar_t *str) { // this came out of original SwordReader code - is there a better way?
+ static char *c, *buffer = 0;
+ if (buffer)
+ delete [] buffer;
+ buffer = c = new char[ wcslen(str) + 1 ];
+ while (*str)
+ *c++ = (char)*str++;
+ *c = 0;
+ return buffer;
+}
+
+void copyconfs(WCHAR *confName) {
+ TCHAR wszSrcFile[MAX_PATH];
+ WCHAR tszDestFile[MAX_PATH];
+ BYTE Buffer[10000];
+ HANDLE hSrc, hDest;
+ DWORD dwNumRead, dwNumWritten;
+
+ wcscpy_s(wszSrcFile, swordPath);
+ wcscat_s(wszSrcFile, TEXT("mods.d\\"));
+ wcscat_s(wszSrcFile, confName);
+ wcscpy_s( tszDestFile, TEXT("mods.d\\"));
+ wcscat_s( tszDestFile, confName);
+ hSrc = CeCreateFile(wszSrcFile, GENERIC_READ, FILE_SHARE_READ,
+ NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (INVALID_HANDLE_VALUE == hSrc) {
+ MessageBox::Show("Sorry, I'm struggling to open a file on your \
+device.", "Process Failed", MessageBoxButtons::OK);
+ Application::Exit();
+ }
+ hDest = CreateFile(tszDestFile, GENERIC_WRITE, FILE_SHARE_READ,
+ NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (INVALID_HANDLE_VALUE == hDest) {
+ MessageBox::Show("Sorry, I can't seem to write files to your PC.\
+Do you have a mods.d directory where you put me?", "Process Failed",
+ MessageBoxButtons::OK); // TODO - line break in MessageBox???
+ Application::Exit();
+ }
+ if (CeReadFile(hSrc, &Buffer, sizeof(Buffer), &dwNumRead, NULL)) {
+ if (!WriteFile(hDest, &Buffer, dwNumRead, &dwNumWritten, NULL)) {
+ MessageBox::Show("Sorry, I can't seem to read the files on \
+your mobile device.", "Process Failed", MessageBoxButtons::OK);
+ Application::Exit();
+ }
+ }
+ else {
+ MessageBox::Show("Sorry, I can't read the files on your mobile \
+device.", "Process Failed", MessageBoxButtons::OK);
+ Application::Exit();
+ }
+ if (hSrc){
+ CeCloseHandle(hSrc);
+ hSrc = NULL;
+ }
+ if (hDest){
+ CloseHandle (hDest);
+ hDest = NULL;
+ }
+}
+
+TCHAR* PrintDirectory(LPWSTR Path, UINT Indent){ // recurse through device from root
+ DWORD foundCount;
+ LPCE_FIND_DATA findDataArray;
+ WCHAR searchPath[MAX_PATH];
+
+ wcscpy_s(searchPath, Path);
+ wcscat_s(searchPath, L"*");
+ if(!CeFindAllFiles(searchPath, FAF_ATTRIBUTES | FAF_NAME, &foundCount, &findDataArray)) {
+ MessageBox::Show("Sorry, I can't seem to open \
+the files on your mobile device", "CeFindAllFiles Process Failed",
+ MessageBoxButtons::OK);
+ Application::Exit();
+ }
+ if(!foundCount) return(NULL);
+ for(UINT i = 0; i < foundCount; i++) {
+ if(findDataArray[i].dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { // directory found
+ WCHAR newPath[MAX_PATH];
+ wcscpy_s(newPath, Path);
+ wcscat_s(newPath, findDataArray[i].cFileName);
+ wcscat_s(newPath, L"\\");
+ PrintDirectory(newPath, Indent + 1);
+ }
+ else if ((stristr(wstrtostr(Path), "MODS.D"))){ // not directory - this is a file
+ const char* modstr = stristr(wstrtostr(Path), "MODS.D");
+ wcscpy_s(swordPath, Path);
+ int len = strlen (modstr);
+ int swlen = wcslen (swordPath);
+ while (len--) swlen--;
+ swordPath[swlen] = 0; // global swordPath now set to CE sword dir
+
+/************************************************************************
+// this refers to files on your mobile device, not your PC.
+// I don't want to do anything with files except when they are in your
+// MODS.D directory, so 'swordPath' at this point should be your sword
+// home directory+mods.d, so save it use return from stristr to truncate
+// I have assumed that mods.d occurs only once!!! There is one possible
+// additional instance (at least) ....
+//
+// TODO
+// note: have not checked for more than one installation: it is possible
+// for someone to have installed into several different locations - really!
+**************************************************************************/
+ copyconfs(findDataArray[i].cFileName);
+ } // else if ((stristr(wstrtostr ......
+ } // for(UINT i = 0; ........
+ if (findDataArray)
+ RapiFreeBuffer(findDataArray);
+ return (swordPath); // swordPath is global ....... I don't like globals ... maybe a 'new' const wchar string would be better??
+}
+
+void CopyOver (LPCWSTR sourceName, LPCWSTR destName) {
+ HANDLE hSrc, hCeDest;
+ BYTE Buffer[10000];
+ DWORD dwNumRead, dwNumWritten;
+ hSrc = CreateFile(sourceName, GENERIC_READ, FILE_SHARE_READ,
+ NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (INVALID_HANDLE_VALUE == hSrc) {
+ MessageBox::Show("Sorry, I can't seem able to open source/host file on PC", "Process Failed",
+ MessageBoxButtons::OK);
+ Application::Exit();
+ }
+ hCeDest = CeCreateFile(destName, GENERIC_WRITE, FILE_SHARE_READ,
+ NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (INVALID_HANDLE_VALUE == hCeDest ) {
+ MessageBox::Show("Sorry, I can't seem able to open destination file file on your mobile device for writing", "Process Failed",
+ MessageBoxButtons::OK);
+ Application::Exit();
+ }
+ do {
+ if (ReadFile(hSrc, &Buffer, sizeof(Buffer), &dwNumRead, NULL)) {
+ if (!CeWriteFile(hCeDest, &Buffer, dwNumRead, &dwNumWritten, NULL)) {
+ MessageBox::Show("Sorry, I can't seem able to open the file on your mobile device for writing", "Process Failed",
+ MessageBoxButtons::OK);
+ Application::Exit();
+ }
+ }
+ else {
+ MessageBox::Show("Sorry, I can't seem able to open the source file file on your mobile device for writing", "Process Failed",
+ MessageBoxButtons::OK);
+ Application::Exit();
+ }
+ } while (dwNumRead);
+ if (hCeDest){
+ CeCloseHandle(hCeDest);
+ hCeDest = NULL;
+ }
+ if (hSrc){
+ CloseHandle (hSrc);
+ hSrc = NULL;
+ }
+}
+
+bool fileExists(char *thisFile)
+{
+ //char *thisFile = "sword.exe";
+ std::fstream fin;
+ fin.open(thisFile, std::ios::in);
+ if( fin.is_open()) {
+ fin.close();
+ return true;
+ }
+ fin.close();
+ return false;
+}
+
+
+void getModulePath (LPCWSTR confName, char &outBuffer) {
+ // each .conf file in mods.d comes here with name
+ char longstr[10000];
+ const char *pathstr;
+ char mPath[MAX_PATH];
+ char *modulePath = mPath;
+ BOOL isopen = FALSE;
+ HANDLE modFile;
+ DWORD BytesToRead;
+ DWORD BytesRead = 0;
+ WCHAR namstr[MAX_PATH];
+ WCHAR* name = namstr;
+ wcscpy (name, TEXT("mods.d\\"));
+ wcscat (name, confName);
+ BytesToRead = sizeof(longstr)-1;
+ modFile = CreateFile(name, GENERIC_READ, FILE_SHARE_READ,
+ NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (INVALID_HANDLE_VALUE == modFile) {
+ MessageBox::Show("Sorry, I can't seem to read files in your mods.d directory. Do you have a mods.d directory where you put me?", "Process Failed",
+ MessageBoxButtons::OK);
+ Application::Exit();
+ }
+ // read the entire .conf file into our buffer - biggest I know of
+ // now is a 5k .conf, so I've gone for a 10,000 byte buffer ....
+ isopen = ReadFile(modFile, &longstr, BytesToRead, &BytesRead, NULL);
+ // TODO we ought to check for success 'if isopen' and do something
+ if (modFile){
+ CloseHandle(modFile);
+ modFile = NULL;
+ }
+ pathstr = stristr (longstr, "DataPath=.");
+ if (!pathstr){
+ MessageBox::Show("Failed to make string match for DataPath=.", "Leaving now",
+ MessageBoxButtons::OK);
+ Application::Exit();
+ }
+ pathstr+=10; // move pointer to end of 'DataPath=.'
+ strcpy (modulePath, "");// this will need to be the swordPath
+ int i = 0;
+ int p = (strlen(modulePath));
+ p--;
+ while (*(pathstr+i) != 10 && *(pathstr+i) != 13) { // some confs have cr/lf and some only lf (why?)
+ *(modulePath+p++) = *(pathstr+i);
+ i++;
+ }
+// --p; // if we don't want trailing slash
+ *(modulePath+p) = 0; // at end of trailing slash in pathstring
+ // TODO - lexdicts are handled differently in pathing
+ char *tmp = modulePath;
+ while (*(tmp++))if (*tmp == 47) *tmp = 92; // change '/' into '\'
+ tmp = &outBuffer;
+ strcpy (tmp, modulePath);
+}
+
+void deleteCEFiles (LPCWSTR CEPath) { // delete all files in mobile device directory then delete directory
+ TCHAR ThisFile[MAX_PATH];
+ DWORD foundCount;
+ LPCE_FIND_DATA findDataArray;
+
+ wcscpy_s(ThisFile, CEPath);
+ wcscat_s(ThisFile, L"*");
+ if(!CeFindAllFiles(ThisFile, FAF_ATTRIBUTES | FAF_NAME, &foundCount, &findDataArray)) {
+ // _tprintf( TEXT("*** CeFindAllFiles failed. ***\n"));
+ return;
+// TODO needs error MessageBox here and bomb out
+ }
+ if(!foundCount) return;
+// TODO needs error MessageBox here and bomb out
+ WCHAR newPath[MAX_PATH];
+ for(UINT i = 0; i < foundCount; i++) {
+ wcscpy_s(newPath, CEPath);
+ wcscat_s(newPath, findDataArray[i].cFileName);
+ CeDeleteFile(newPath);
+ } // for(UINT i = 0; i </
+ // now delete the directory
+ CeRemoveDirectory(CEPath);
+}
+
+void removeModule (LPCWSTR moduleConf) { // come here with name of .conf file
+ char mPath[MAX_PATH];
+ TCHAR ThisFile[MAX_PATH];
+ TCHAR WmPath[MAX_PATH];
+
+ copyconfs ((WCHAR*)moduleConf); // get the .conf file from the mobile
+ getModulePath (moduleConf, *mPath); // read the module files path
+ mbstowcs( WmPath, mPath, strlen(mPath)+1); // convert char to WCHAR
+ wcscpy_s (ThisFile, swordPath) ;
+ wcscat_s (ThisFile, WmPath);
+ deleteCEFiles (ThisFile); // delete all the module files and directory
+ wcscpy_s (ThisFile, swordPath) ;
+ wcscat_s (ThisFile, TEXT("mods.d\\"));
+ wcscat_s (ThisFile, moduleConf) ;
+ CeDeleteFile(ThisFile); // now delete the .conf file
+}
+
+
+const char* doInstall() {
+ char swPath[MAX_PATH];
+ const char* swordPathString = swPath;
+ HANDLE hFile; // Handle to directory
+ HANDLE modDir;
+ WIN32_FIND_DATA FileInformation; // File information
+ WIN32_FIND_DATA modFileInformation; // File information
+ char mPath[MAX_PATH];
+ char *modulePath = mPath;
+ char m2Path[MAX_PATH];
+ char *modName = m2Path;
+ TCHAR wszSrcFile[MAX_PATH];
+ WCHAR tszCEDestFile[MAX_PATH];
+ WCHAR* oldConfs[1000]; // array of pointers to oldConf files before Install Manager
+ WCHAR* newConfs[1000]; // array of pointers to Conf files after Install Manager session
+ if (fileExists("Sword.exe")) {
+ MessageBox::Show("I'm shutting down because there is a copy \
+of sword.exe in this directory. You must NOT run this installer \
+in your Sword directory.", "Process Failed", MessageBoxButtons::OK);
+ Application::Exit();
+ }
+ RAPIINIT ri = { sizeof(RAPIINIT) };
+ if ( SUCCEEDED(CeRapiInitEx(&ri))) {
+ // wait for 10 seconds for the connection...
+ if ( (WaitForSingleObject(ri.heRapiInit, 10000) == WAIT_OBJECT_0) &&
+ SUCCEEDED(ri.hrRapiInit) ) {
+ // CreateDirectory does not have a problem if the directory
+ // named exists already
+ Directory::CreateDirectory( "mods.d" );
+ Directory::CreateDirectory( "modules" );
+ TCHAR* swordPath = PrintDirectory( L"\\", 0);
+ if (*swordPath != NULL)
+ swordPathString = wstrtostr(swordPath);
+ // we now should have TCHAR *swordPath and char *swordPathString
+ // both holding the full sword path from the mobile device
+ // and the mods.d directory on the pc is now containing copies
+ // of all the mods.d files that are on the mobile device
+ // *plus* we definitely have a mods.d and modules directory as
+ // these are not checked for by InstallManager (It bombs out!).
+ // now put all the mods.d names into an array
+ hFile = FindFirstFile(TEXT("mods.d\\*.conf"), &FileInformation);
+ if(hFile == INVALID_HANDLE_VALUE) {
+ MessageBox::Show("Sorry, I can't seem to open \
+the files in local mods.d directory", "Process Failed",
+ MessageBoxButtons::OK);
+ Application::Exit();
+ }
+ // START this pass storing .conf file names *ok* (see second pass)
+ int n=0;
+ do {
+ // store the conf names (LPCWSTR FileInformation.cFileName) in an array
+ int len = wcslen(FileInformation.cFileName) + 1; // how much space is needed
+ TCHAR *newSpace = new WCHAR[len]; // allocate with new
+// copy to new space
+ wcscpy_s (newSpace, len, FileInformation.cFileName);
+ oldConfs[n] = newSpace; // save pointer
+ n++; // TODO don't forget to delete new items later
+ }while(FindNextFile(hFile, &FileInformation) == TRUE);
+ oldConfs[n] = 0;
+ if (hFile){
+ FindClose(hFile);
+ hFile = NULL;
+ }
+ // END this pass - *ok* (see second pass)
+ STARTUPINFO si;
+ PROCESS_INFORMATION pi;
+ ZeroMemory( &si, sizeof(si) );
+ si.cb = sizeof(si);
+ ZeroMemory( &pi, sizeof(pi) );
+ // Start the child process - InstallManager.
+ if( !CreateProcess( TEXT("InstallManager.exe"), TEXT(\
+"Install Manager.exe"), // Command line.
+ NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi )) {
+ MessageBox::Show("Sorry, I could not activate \
+InstallManager", "Process Failed",
+ MessageBoxButtons::OK);
+ Application::Exit();
+ }
+ // Wait until InstallManager exits.
+ WaitForSingleObject( pi.hProcess, INFINITE );
+ // Close process and thread handles.
+ CloseHandle( pi.hProcess );
+ CloseHandle( pi.hThread );
+ // Form1::textBox1->Clear();// Text = "*WORKING*";
+
+ n=0;
+ hFile = FindFirstFile(TEXT("mods.d\\*.conf"), &FileInformation);
+ if(hFile != INVALID_HANDLE_VALUE)
+ {
+ do { // each .conf file in mods.d comes here with name etc
+ // START this pass storing .conf file name *NOT* ok while
+ // debugging - but OK outside debugger also at end of debug
+ // when testing with MessageBox - problem in debugger???
+ // TODO - nothing unless bug reports say otherwise!!!!
+ int len = wcslen(FileInformation.cFileName) + 1; // how much space is needed
+ TCHAR *newSpace = new WCHAR[len]; // allocate with new
+ // copy to new space
+ wcscpy_s (newSpace, len, FileInformation.cFileName);
+ newConfs[n] = newSpace; // save pointer
+ n++; // TODO don't forget to delete new items later
+ // END this pass - *NOT ok* (see first pass)
+ getModulePath (FileInformation.cFileName, *mPath);
+ String^ ptr = System::Runtime::InteropServices::Marshal::PtrToStringAnsi((IntPtr)modulePath);
+ // I don't have a clue how the above line works, but it does!
+ // better method used in MessageBox below TODO ... change?
+ if (Directory::Exists(ptr)) {
+ // if there is no directory under 'modules' skip this
+ strcat (modulePath, "*");
+ int len = strlen(modulePath)+1;
+ wchar_t *wText = new wchar_t[len];
+ memset(wText,0,len);
+ ::MultiByteToWideChar(CP_ACP, NULL, modulePath, -1, wText,len);
+ modDir = FindFirstFile(wText, &modFileInformation);
+ if(modDir == INVALID_HANDLE_VALUE){
+ MessageBox::Show("Sorry, I can't seem to read files \
+from your newly downloaded module.", "Process Failed",
+ MessageBoxButtons::OK);
+ Application::Exit();
+ }
+ len = wcslen (wText);
+ len --;
+ *(wText+len) = 0;
+ len = strlen(modulePath);
+ *(modulePath +len - 1) = 0;
+ do { // copy each of module files onto mobile device followed by .conf
+ // create the path on the mobile device here
+ wcscpy_s (tszCEDestFile, swordPath);
+ wcscat_s (tszCEDestFile, wText); // full path to create
+ CeCreateDirectory(tszCEDestFile, 0);
+ // TODO - should do a check for creation here
+ // file copy will fail else
+ wcscpy_s(wszSrcFile, wText);
+ wcscat_s(wszSrcFile, modFileInformation.cFileName);
+ char destMP[MAX_PATH];
+ char *destModPath = destMP;
+ strcpy (destModPath, swordPathString);
+ strcat (destModPath, modulePath);
+ len = strlen(destModPath) + 1;
+ wchar_t *wDestFile = new wchar_t[len];
+ memset(wDestFile,0,len); // does this need delete?
+ // TODO check above ........ new wchar_t[ ....
+ ::MultiByteToWideChar(CP_ACP, NULL, destModPath, -1, wDestFile,len);
+ wcscpy_s( tszCEDestFile, wDestFile);
+ wcscat_s( tszCEDestFile, modFileInformation.cFileName);
+ if(!(modFileInformation.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { // directory found
+ CopyOver (wszSrcFile, tszCEDestFile);
+ } // if(!(modFileInformation.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY
+ }while(FindNextFile(modDir, &modFileInformation) == TRUE);
+ if (modDir){
+ FindClose (modDir);
+ modDir = NULL;
+ }
+ // now copy over the module .conf file
+ wcscpy_s (tszCEDestFile, swordPath);
+ wcscat_s (tszCEDestFile, TEXT("mods.d\\"));
+ wcscat_s (tszCEDestFile, FileInformation.cFileName);
+ wcscpy_s (wszSrcFile, TEXT("mods.d\\"));
+ wcscat_s (wszSrcFile, FileInformation.cFileName);
+ CopyOver (wszSrcFile, tszCEDestFile);
+
+ } // if (Directory::Exists(ptr
+ delete ptr;
+ }while(FindNextFile(hFile, &FileInformation) == TRUE);
+ newConfs[n] = 0;
+ }
+/*
+ // debug only code
+ // save this code - it shows WCHAR string in MessageBox
+n = -1;
+while (newConfs[n++]) {
+ // Convert to a System::String
+ // String ^systemstring = gcnew String((char *)newConfs[n]);
+ // TODO note that the above shows exactly what showed in SwordReader
+ // MessageBox when using renderText ....... REVISIT
+ String ^systemstring = gcnew String(newConfs[n]);
+ systemstring += " is the current module .conf file";
+ MessageBox::Show(systemstring, "This is the new .conf file",
+ MessageBoxButtons::OK);
+ delete systemstring;}
+ // end debug code
+*/
+// removeModule (TEXT("phillips.conf")); // for debug
+ int Old = 0;
+ int New = 0;
+ do { // loop through all .conf files. If one is missing from
+ // the start, the user wants to delete this module
+ bool moduleDeleted = TRUE;
+ while (newConfs[New]){ // for each Old module
+ if (!wcscmp (oldConfs[Old], newConfs[New++])) {
+ moduleDeleted = FALSE; // this one is still there
+ }
+ }
+ if (moduleDeleted) { // this one is missing after Install MGR
+ removeModule (oldConfs[Old]); // so delete from mobile
+ }
+ New = 0;
+ } while (oldConfs[++Old]); // keep going till all have been checked
+ if (modDir){
+ FindClose (modDir);
+ modDir = NULL;
+ } // Close handles
+ if (hFile){
+ FindClose(hFile);
+ hFile = NULL;
+ }
+ CeRapiUninit();
+ // TODO delete the two Conf arrays
+ // now remove all the files from the pc
+ Directory::Delete( "mods.d", true );
+ Directory::Delete( "modules", true );
+ return (swordPathString);
+ } // if ( (WaitForSingleObject(ri.heRapiInit .....
+ else {
+ MessageBox::Show("Sorry, I could not connect to your mobile \
+device.", "CeRapiInit failed", MessageBoxButtons::OK);
+ CeRapiUninit();
+ Application::Exit();
+ }
+ if ( CeRapiInit() != E_FAIL ) {
+ }
+ else {
+ MessageBox::Show("Sorry, I could not connect to your mobile \
+device", "CeRapiInit failed", MessageBoxButtons::OK);
+ CeRapiUninit();
+ Application::Exit();
+ }
+ } // if ( SUCCEEDED(CeRapiInitEx
+Application::Exit();
+return(0); // can't get here - but avoids warning
+}
+
Added: trunk/src/Installer - VC2005/doInstall.h
===================================================================
--- trunk/src/Installer - VC2005/doInstall.h (rev 0)
+++ trunk/src/Installer - VC2005/doInstall.h 2008-01-18 17:04:43 UTC (rev 90)
@@ -0,0 +1,3 @@
+// doInstall.h
+
+const char* doInstall();
\ No newline at end of file
Added: trunk/src/Installer - VC2005/resource.h
===================================================================
--- trunk/src/Installer - VC2005/resource.h (rev 0)
+++ trunk/src/Installer - VC2005/resource.h 2008-01-18 17:04:43 UTC (rev 90)
@@ -0,0 +1,3 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by app.rc
Added: trunk/src/Installer - VC2005/stdafx.cpp
===================================================================
--- trunk/src/Installer - VC2005/stdafx.cpp (rev 0)
+++ trunk/src/Installer - VC2005/stdafx.cpp 2008-01-18 17:04:43 UTC (rev 90)
@@ -0,0 +1,7 @@
+// stdafx.cpp : source file that includes just the standard includes
+// SRInstallMGR.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+
Added: trunk/src/Installer - VC2005/stdafx.h
===================================================================
--- trunk/src/Installer - VC2005/stdafx.h (rev 0)
+++ trunk/src/Installer - VC2005/stdafx.h 2008-01-18 17:04:43 UTC (rev 90)
@@ -0,0 +1,6 @@
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+#pragma once
+
+// TODO: reference additional headers your program requires here
More information about the sword-cvs
mailing list