Skip to content
Browse files

new flowchart, changed errors slightly, improved readme, added licens…

…es, tweaked installer to include licenses,
  • Loading branch information...
1 parent 335752b commit d672bfa0b6bf2e99158872a887791039c20b7e96 David Middlecamp committed Jul 6, 2011
View
8 csharp/Azavea.NijPredictivePolicing.AcsImporter/Main.cs
@@ -97,10 +97,10 @@ static int Main(string[] args)
DisplayOptions();
}
-#if DEBUG
- _log.Debug("Done! Press ANY KEY to Quit");
- Console.ReadKey();
-#endif
+//#if DEBUG
+// _log.Debug("Done! Press ANY KEY to Quit");
+// Console.ReadKey();
+//#endif
return 0;
}
View
350 csharp/Azavea.NijPredictivePolicing.Common/Config.cs
@@ -1,172 +1,178 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.IO;
-using Newtonsoft.Json;
-using log4net;
-using Newtonsoft.Json.Linq;
-
-namespace Azavea.NijPredictivePolicing.Common
-{
- /// <summary>
- /// A super basic config class
- /// </summary>
- public class Config
- {
- private static ILog _log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
-
- protected Dictionary<string, object> _data = null;
- protected string _filename;
-
- public Config()
- {
- _data = new Dictionary<string, object>();
- }
-
- public Config(string filename)
- {
- Load(filename);
- }
-
- public bool Load(string filename)
- {
- _filename = filename;
- _data = null;
- if (File.Exists(filename))
- {
- string fileContents = File.ReadAllText(filename);
- if (!string.IsNullOrEmpty(fileContents))
- {
- JsonSerializerSettings s = new JsonSerializerSettings();
- s.TypeNameHandling = TypeNameHandling.All;
- s.TypeNameAssemblyFormat = System.Runtime.Serialization.Formatters.FormatterAssemblyStyle.Simple;
-
- _data = (Dictionary<string, object>)JsonConvert.DeserializeObject(fileContents, s);
-
- return (_data != null) && (_data is Dictionary<string, object>);
- }
- else
- {
- _log.ErrorFormat("File was empty: {0}", filename);
- }
- }
- else
- {
- _log.ErrorFormat("Could not find file: {0}", filename);
- }
-
- return false;
- }
-
- public bool Save()
- {
- return Save(string.Empty);
- }
-
- public bool Save(string filename)
- {
- try
- {
- if (!string.IsNullOrEmpty(filename))
- {
- _filename = filename;
- }
-
- if (File.Exists(filename))
- {
- File.Delete(filename);
- }
-
- JsonSerializerSettings s = new JsonSerializerSettings();
- s.TypeNameHandling = TypeNameHandling.All;
- s.TypeNameAssemblyFormat = System.Runtime.Serialization.Formatters.FormatterAssemblyStyle.Simple;
-
- string fileContents = JsonConvert.SerializeObject(this._data, Formatting.Indented, s);
- File.WriteAllText(_filename, fileContents);
- return true;
- }
- catch (Exception ex)
- {
- _log.Error("Error saving configuration", ex);
- }
- return false;
- }
-
- public string SaveToMemory()
- {
- try
- {
- return JsonConvert.SerializeObject(this._data, Formatting.Indented);
- }
- catch (Exception ex)
- {
- _log.Error("Error saving configuration", ex);
- }
- return string.Empty;
- }
-
- public T Get<T>(string key, T ifEmpty)
- {
- if ((_data != null) && (_data.ContainsKey(key)))
- {
- return Utilities.GetAs<T>(_data[key], ifEmpty);
- }
- return ifEmpty;
- }
-
- public List<object> GetList(string key)
- {
-
- if (_data != null) //&& (_data.ContainsKey(key)))
- {
- var o = _data[key];
-
- //if (o is JArray)
- //{
- //return (o as JArray);
- return new List<object>(o as IEnumerable<object>);
- //}
- //else if (o is Array)
- //{
- // return new List<object>(o as IEnumerable<object>);
- //}
- }
- return null;
- }
-
- public object this[string key]
- {
- get
- {
- return this.Get<object>(key, null);
- }
- }
-
- public void Set<T>(string key, T value)
- {
- if (_data == null)
- {
- _data = new Dictionary<string, object>();
- }
-
- if (_data != null)
- {
- _data[key] = value;
- }
- }
-
- public Dictionary<string, object>.KeyCollection Keys
- {
- get
- {
- return (_data != null) ? _data.Keys : null;
- }
- }
-
- public bool IsEmpty()
- {
- return ((_data == null) || (_data.Count == 0));
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.IO;
+using Newtonsoft.Json;
+using log4net;
+using Newtonsoft.Json.Linq;
+
+namespace Azavea.NijPredictivePolicing.Common
+{
+ /// <summary>
+ /// A super basic config class
+ /// </summary>
+ public class Config
+ {
+ private static ILog _log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
+ protected Dictionary<string, object> _data = null;
+ protected string _filename;
+
+ public Config()
+ {
+ _data = new Dictionary<string, object>();
+ }
+
+ public Config(string filename)
+ {
+ Load(filename);
+ }
+
+ public bool Load(string filename)
+ {
+ _filename = filename;
+ _data = null;
+ if (File.Exists(filename))
+ {
+ string fileContents = File.ReadAllText(filename);
+ if (!string.IsNullOrEmpty(fileContents))
+ {
+ JsonSerializerSettings s = new JsonSerializerSettings();
+ s.TypeNameHandling = TypeNameHandling.All;
+ s.TypeNameAssemblyFormat = System.Runtime.Serialization.Formatters.FormatterAssemblyStyle.Simple;
+
+ _data = (Dictionary<string, object>)JsonConvert.DeserializeObject(fileContents, s);
+
+ return (_data != null) && (_data is Dictionary<string, object>);
+ }
+ else
+ {
+ _log.ErrorFormat("File was empty: {0}", filename);
+ }
+ }
+ else
+ {
+ _log.ErrorFormat("Could not find file: {0}", filename);
+ }
+
+ return false;
+ }
+
+ public bool Save()
+ {
+ return Save(string.Empty);
+ }
+
+ public bool Save(string filename)
+ {
+ try
+ {
+ if (!string.IsNullOrEmpty(filename))
+ {
+ _filename = filename;
+ }
+
+ if (File.Exists(filename))
+ {
+ File.Delete(filename);
+ }
+
+ JsonSerializerSettings s = new JsonSerializerSettings();
+ s.TypeNameHandling = TypeNameHandling.All;
+ s.TypeNameAssemblyFormat = System.Runtime.Serialization.Formatters.FormatterAssemblyStyle.Simple;
+
+ string fileContents = JsonConvert.SerializeObject(this._data, Formatting.Indented, s);
+ File.WriteAllText(_filename, fileContents);
+ return true;
+ }
+ catch (UnauthorizedAccessException cantWriteEx)
+ {
+ _log.Error("The importer couldn't write its config file. Please run this application as an Administrator");
+ _log.Fatal("The importer cannot continue, exiting.");
+ Environment.Exit(-1);
+ }
+ catch (Exception ex)
+ {
+ _log.Error("Error saving configuration", ex);
+ }
+ return false;
+ }
+
+ public string SaveToMemory()
+ {
+ try
+ {
+ return JsonConvert.SerializeObject(this._data, Formatting.Indented);
+ }
+ catch (Exception ex)
+ {
+ _log.Error("Error saving configuration", ex);
+ }
+ return string.Empty;
+ }
+
+ public T Get<T>(string key, T ifEmpty)
+ {
+ if ((_data != null) && (_data.ContainsKey(key)))
+ {
+ return Utilities.GetAs<T>(_data[key], ifEmpty);
+ }
+ return ifEmpty;
+ }
+
+ public List<object> GetList(string key)
+ {
+
+ if (_data != null) //&& (_data.ContainsKey(key)))
+ {
+ var o = _data[key];
+
+ //if (o is JArray)
+ //{
+ //return (o as JArray);
+ return new List<object>(o as IEnumerable<object>);
+ //}
+ //else if (o is Array)
+ //{
+ // return new List<object>(o as IEnumerable<object>);
+ //}
+ }
+ return null;
+ }
+
+ public object this[string key]
+ {
+ get
+ {
+ return this.Get<object>(key, null);
+ }
+ }
+
+ public void Set<T>(string key, T value)
+ {
+ if (_data == null)
+ {
+ _data = new Dictionary<string, object>();
+ }
+
+ if (_data != null)
+ {
+ _data[key] = value;
+ }
+ }
+
+ public Dictionary<string, object>.KeyCollection Keys
+ {
+ get
+ {
+ return (_data != null) ? _data.Keys : null;
+ }
+ }
+
+ public bool IsEmpty()
+ {
+ return ((_data == null) || (_data.Count == 0));
+ }
+ }
+}
View
5 csharp/Azavea.NijPredictivePolicing.Common/Constants.cs
@@ -19,8 +19,9 @@ public enum ExitCodes
public const string Warning_MissingProjection = @"
*********************
IMPORTANT!:
- You have not specified an output projection, meaning the resulting shapefile will
-be in unprojected WGS84. Your filtering geometries, envelope, grid cell sizes,
+ You have not specified an output projection!
+This means any exported shapefile will be in unprojected WGS84.
+Your filtering geometries, envelope, grid cell sizes,
and all other parameters must match that projection.
*********************";
View
BIN doc/ACS_Importer_Flowchart.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
295 doc/README.txt
@@ -1,125 +1,170 @@
--------------------------------------------------------------------------------
-ACS Importer Readme
--------------------------------------------------------------------------------
-
-
-Introduction
--------------------------------------
-
- The ACS Importer is a tool that can help you extract specific portions of the
-American Community Survey. Specifically this version targets the 2005-2009
-ACS 5-year data release at the block group level.
-
-Getting Started
--------------------------------------
-
- Installing the ACS Importer from the install file should be relatively
-quick. Just run the ACSImporter.exe file, and select the location where
-you'd like the program to be. From there you'll want to open a command
-prompt to the install location.
-
-1. Click on [Start]->[Run]->
-2. Paste in: cmd /k "cd C:\Program Files\ACS Importer"
-3. You should now have a command prompt in the same folder as the importer.
-
-Getting help
--------------------------------------
-
- If you need a quick list of available commands, just enter the program name
-without any arguments.
-
-C:\...> AcsDataImporter.exe
-
-
-Getting the data you Want
--------------------------------------
-
- The American Community Survey probably has more data points than you are
-interested in all at once. The first step is starting to get the data you
-are interested in.
-
-1. To see what states are available, use the following command.
-
-C:\...> AcsDataImporter.exe -listStateCodes
-
-2. When you know which state you'd like to use, you can pre-download the
-unfiltered state data files by using:
-
-C:\...> AcsDataImporter.exe -s Wyoming
-
-
-Summary Levels
--------------------------------------
-
- Variable summaries are grouped into a number of levels. The importer
-will require a summary level specified by code, These can be listed by typing:
-
-C:\...> AcsDataImporter.exe -listSummaryLevels
-
-
-Variable Files
--------------------------------------
-
- Each data point for the ACS is represented by a unique variable ID.
-These are available here:
-http://www2.census.gov/acs2009_5yr/summaryfile/ACS2009_5-Year_TableShells.xls
-From this file, select up to 100 Unique ID's per export job you'd like,
-and save these to your variable file in the following format. For example:
-
-B01001001,TOTALPOP
-B01001002,TOTALMALE
-B01001026,TOTALFEMALE
-
-C:\...> AcsDataImporter.exe -s Wyoming -e 150 -v myVariablesFile.txt
-
-Naming your export
--------------------------------------
-
- The importer utility will name jobs based on the state, and date, unless
-you provide a specific name you'd like.
-
--jobName DesiredNameHere
-
-A more thorough example
--------------------------------------
-
- Here is an example export using what was discussed so far:
-
-C:\...> AcsDataImporter.exe -s Wyoming -e 150 -v myVariablesFile.txt -jobName Test01
-
-This command will make sure all necessary files are downloaded for Wyoming,
-and import the selected variables into an internal database named "Test01".
-The variable values were at the block group summary level. From here you
-can export your results into a shapefile using the summary geography, or
-using a grid 'fishnet.'
-
-Exporting to a Shapefile
--------------------------------------
-
- When you're ready to run your full export, you can send everything to
-a Shapefile. "-exportToShape" will cause your data to be saved to a
-shapefile in the given output projection (see below) with the name provided
-by 'jobName.'
-
-C:\...> AcsDataImporter.exe -s Wyoming -e 150 -v myVariablesFile.txt -jobName Test01 -exportToShape
-C:\...> dir Test01.*
-
-Test01.dbf
-Test01.prj
-Test01.shp
-Test01.shx
-
-Setting an Output Projection
--------------------------------------
-
- The ACS data and summary levels are all in WGS84NAD83 degrees.
-If you know the projection you'd like to be working in, you can specify
-either a SRID, or a filename containing the WKT of your desired projection,
-and the importer will reproject the data into your projection when exporting.
-
-C:\...> AcsDataImporter.exe -s Wyoming -e 150 -v myVariablesFile.txt -jobName Test01 -exportToShape -outputProjection myproj.prj
-
-
-Frequently Asked Questions
--------------------------------------
-
+-------------------------------------------------------------------------------
+ACS Importer Readme
+-------------------------------------------------------------------------------
+
+
+Introduction
+-------------------------------------
+
+ The ACS Importer is a tool that can help you extract specific portions of the
+American Community Survey. Specifically this version targets the 2005-2009
+ACS 5-year data release at the block group level.
+
+ This tool benefits from the use of several other open source projects, please
+jump to the bottom of this readme for more information on those projects.
+
+Getting Started
+-------------------------------------
+
+ Installing the ACS Importer from the install file should be relatively
+quick. Just run the ACSImporter.exe file, and select the location where
+you'd like the program to be. From there you'll want to open a command
+prompt to the install location. The importer will be downloading files
+to the working directory or output directory, so make sure you're
+running it as an Administrator. If you're not, you'll see errors if it
+will be a problem.
+
+On Windows 7 or Windows Vista:
+1. Right->Click on [Start]->[Programs]->[Acs Importer]->[Acs Importer]
+2. Select Properties -> Advanced -> Run As Administrator
+3. Click on [Start]->[Programs]->[Acs Importer]->[Acs Importer]
+
+You should now have a command prompt in the same folder as the importer.
+
+On Windows XP (no run as admin):
+1. Click on [Start]->[Programs]->[Acs Importer]->[Acs Importer]
+
+
+Getting help
+-------------------------------------
+
+ If you need a quick list of available commands, just enter the program name
+without any arguments.
+
+C:\...> AcsDataImporter.exe
+
+
+Getting the data you Want
+-------------------------------------
+
+ The American Community Survey probably has more data points than you are
+interested in all at once. The first step is starting to get the data you
+are interested in.
+
+1. To see what states are available, use the following command.
+
+C:\...> AcsDataImporter.exe -listStateCodes
+
+2. When you know which state you'd like to use, you can pre-download the
+unfiltered state data files by using:
+
+C:\...> AcsDataImporter.exe -s Wyoming
+
+
+Summary Levels
+-------------------------------------
+
+ Variable summaries are grouped into a number of levels. The importer
+will require a summary level specified by code, These can be listed by typing:
+
+C:\...> AcsDataImporter.exe -listSummaryLevels
+
+
+Variable Files
+-------------------------------------
+
+ Each data point for the ACS is represented by a unique variable ID.
+These are available here:
+http://www2.census.gov/acs2009_5yr/summaryfile/ACS2009_5-Year_TableShells.xls
+From this file, select up to 100 Unique ID's per export job you'd like,
+and save these to your variable file in the following format. For example:
+
+B01001001,TOTALPOP
+B01001002,TOTALMALE
+B01001026,TOTALFEMALE
+
+C:\...> AcsDataImporter.exe -s Wyoming -e 150 -v myVariablesFile.txt
+
+Naming your export
+-------------------------------------
+
+ The importer utility will name jobs based on the state, and date, unless
+you provide a specific name you'd like.
+
+-jobName DesiredNameHere
+
+A more thorough example
+-------------------------------------
+
+ Here is an example export using what was discussed so far:
+
+C:\...> AcsDataImporter.exe -s Wyoming -e 150 -v myVariablesFile.txt -jobName Test01
+
+This command will make sure all necessary files are downloaded for Wyoming,
+and import the selected variables into an internal database named "Test01".
+The variable values were at the block group summary level. From here you
+can export your results into a shapefile using the summary geography, or
+using a grid 'fishnet.'
+
+Exporting to a Shapefile
+-------------------------------------
+
+ When you're ready to run your full export, you can send everything to
+a Shapefile. "-exportToShape" will cause your data to be saved to a
+shapefile in the given output projection (see below) with the name provided
+by 'jobName.'
+
+C:\...> AcsDataImporter.exe -s Wyoming -e 150 -v myVariablesFile.txt -jobName Test01 -exportToShape
+C:\...> dir Test01.*
+
+Test01.dbf
+Test01.prj
+Test01.shp
+Test01.shx
+
+Setting an Output Projection
+-------------------------------------
+
+ The ACS data and summary levels are all in WGS84NAD83 degrees.
+If you know the projection you'd like to be working in, you can specify
+either a SRID, or a filename containing the WKT of your desired projection,
+and the importer will reproject the data into your projection when exporting.
+
+C:\...> AcsDataImporter.exe -s Wyoming -e 150 -v myVariablesFile.txt -jobName Test01 -exportToShape -outputProjection myproj.prj
+
+
+Frequently Asked Questions
+-------------------------------------
+
+
+Open Source Libraries Used
+-------------------------------------
+
+ Special Thanks to those amazing open source libraries that are so useful!
+Please see the /Licenses folder for the licenses for each respective project,
+and see below for links to each project. Apologies if these links are
+incorrect or out-of-date.
+
+ * log4net!
+ * http://logging.apache.org/log4net/
+ * GeoApi!
+ * http://geoapi.codeplex.com/
+ * NetTopologySuite!
+ * http://code.google.com/p/nettopologysuite/
+ * PowerCollections!
+ * http://powercollections.codeplex.com/
+ * ProjNET!
+ * http://projnet.codeplex.com/
+ * Ionic.Zip!
+ * http://dotnetzip.codeplex.com/
+ * Newtonsoft.Json!
+ * http://james.newtonking.com/pages/json-net.aspx
+ * System.Data.SQLite!
+ * http://system.data.sqlite.org
+ * Spatialite!
+ * http://www.gaia-gis.it/spatialite/
+ * Sqlite!
+ * http://www.sqlite.org/
+ * ExcelBinaryReader!
+ * http://exceldatareader.codeplex.com/
+
View
BIN lib/Shelllink/Plugins/ShellLink.dll
Binary file not shown.
View
8 scripts/installer/README.txt
@@ -0,0 +1,8 @@
+1.) Switch to 'Debug' mode, with CPU type set to 'x86' (Important!)
+2.) Manually delete the data folder if you'be been debugging:
+C:\projects\Temple_Univ_NIJ_Predictive_Policing\csharp\Azavea.NijPredictivePolicing.AcsImporter\bin\x86\Debug\Data
+
+3.) Rebuild
+4.) compile installer
+5.) install on non-developer machine 32bit, and 64 bit
+6.) test basic download, import (this will test spatialite, which is the most nitpicky)
View
306 scripts/installer/acsinstaller.nsi
@@ -1,133 +1,173 @@
-# Auto-generated by EclipseNSIS Script Wizard
-# Jun 6, 2011 4:54:19 PM
-
-Name "ACS Importer"
-
-# General Symbol Definitions
-!define REGKEY "SOFTWARE\$(^Name)"
-!define VERSION 1.0.0
-!define COMPANY Azavea
-!define URL http://www.azavea.com
-
-# MUI Symbol Definitions
-!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install-blue.ico"
-!define MUI_FINISHPAGE_NOAUTOCLOSE
-!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
-!define MUI_STARTMENUPAGE_NODISABLE
-!define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
-!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup
-!define MUI_STARTMENUPAGE_DEFAULTFOLDER "ACS Importer"
-!define MUI_FINISHPAGE_SHOWREADME $INSTDIR\README.txt
-!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall-colorful.ico"
-!define MUI_UNFINISHPAGE_NOAUTOCLOSE
-
-# Included files
-!include Sections.nsh
-!include MUI2.nsh
-
-# Variables
-Var StartMenuGroup
-
-# Installer pages
-!insertmacro MUI_PAGE_WELCOME
-!insertmacro MUI_PAGE_DIRECTORY
-!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup
-!insertmacro MUI_PAGE_INSTFILES
-!insertmacro MUI_PAGE_FINISH
-!insertmacro MUI_UNPAGE_CONFIRM
-!insertmacro MUI_UNPAGE_INSTFILES
-
-# Installer languages
-!insertmacro MUI_LANGUAGE English
-
-# Installer attributes
-OutFile ACSInstaller.exe
-InstallDir "$PROGRAMFILES\ACS Importer"
-CRCCheck on
-XPStyle on
-ShowInstDetails show
-VIProductVersion 1.0.0.0
-VIAddVersionKey ProductName "ACS Importer"
-VIAddVersionKey ProductVersion "${VERSION}"
-VIAddVersionKey CompanyName "${COMPANY}"
-VIAddVersionKey CompanyWebsite "${URL}"
-VIAddVersionKey FileVersion "${VERSION}"
-VIAddVersionKey FileDescription ""
-VIAddVersionKey LegalCopyright ""
-InstallDirRegKey HKLM "${REGKEY}" Path
-ShowUninstDetails show
-
-# Installer sections
-Section -Main SEC0000
- SetOutPath $INSTDIR
- SetOverwrite on
- File /r C:\projects\Temple_Univ_NIJ_Predictive_Policing\csharp\Azavea.NijPredictivePolicing.AcsImporter\bin\x86\Debug\*
- ;File /r C:\projects\Temple_Univ_NIJ_Predictive_Policing\csharp\Azavea.NijPredictivePolicing.AcsImporter\bin\Debug\*
- File C:\projects\Temple_Univ_NIJ_Predictive_Policing\doc\README.txt
- SetOutPath $SMPROGRAMS\$StartMenuGroup
- CreateShortcut "$SMPROGRAMS\$StartMenuGroup\ACS Importer.lnk" $INSTDIR
- WriteRegStr HKLM "${REGKEY}\Components" Main 1
-SectionEnd
-
-Section -post SEC0001
- WriteRegStr HKLM "${REGKEY}" Path $INSTDIR
- SetOutPath $INSTDIR
- WriteUninstaller $INSTDIR\uninstall.exe
- !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
- SetOutPath $SMPROGRAMS\$StartMenuGroup
- CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" $INSTDIR\uninstall.exe
- !insertmacro MUI_STARTMENU_WRITE_END
- WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)"
- WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "${VERSION}"
- WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Publisher "${COMPANY}"
- WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}"
- WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\uninstall.exe
- WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe
- WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1
- WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1
-SectionEnd
-
-# Macro for selecting uninstaller sections
-!macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID
- Push $R0
- ReadRegStr $R0 HKLM "${REGKEY}\Components" "${SECTION_NAME}"
- StrCmp $R0 1 0 next${UNSECTION_ID}
- !insertmacro SelectSection "${UNSECTION_ID}"
- GoTo done${UNSECTION_ID}
-next${UNSECTION_ID}:
- !insertmacro UnselectSection "${UNSECTION_ID}"
-done${UNSECTION_ID}:
- Pop $R0
-!macroend
-
-# Uninstaller sections
-Section /o -un.Main UNSEC0000
- Delete /REBOOTOK $INSTDIR\README.txt
- RmDir /r /REBOOTOK $INSTDIR
- DeleteRegValue HKLM "${REGKEY}\Components" Main
-SectionEnd
-
-Section -un.post UNSEC0001
- DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
- Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk"
- Delete /REBOOTOK $INSTDIR\uninstall.exe
- DeleteRegValue HKLM "${REGKEY}" StartMenuGroup
- DeleteRegValue HKLM "${REGKEY}" Path
- DeleteRegKey /IfEmpty HKLM "${REGKEY}\Components"
- DeleteRegKey /IfEmpty HKLM "${REGKEY}"
- RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup
- RmDir /REBOOTOK $INSTDIR
-SectionEnd
-
-# Installer functions
-Function .onInit
- InitPluginsDir
-FunctionEnd
-
-# Uninstaller functions
-Function un.onInit
- ReadRegStr $INSTDIR HKLM "${REGKEY}" Path
- !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup
- !insertmacro SELECT_UNSECTION Main ${UNSEC0000}
-FunctionEnd
-
+# Auto-generated by EclipseNSIS Script Wizard
+# Jun 6, 2011 4:54:19 PM
+
+Name "ACS Importer"
+
+# General Symbol Definitions
+!define REGKEY "SOFTWARE\$(^Name)"
+!define VERSION 1.0.0
+!define COMPANY Azavea
+!define URL http://www.azavea.com
+
+# MUI Symbol Definitions
+!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install-blue.ico"
+!define MUI_FINISHPAGE_NOAUTOCLOSE
+!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
+!define MUI_STARTMENUPAGE_NODISABLE
+!define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
+!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup
+!define MUI_STARTMENUPAGE_DEFAULTFOLDER "ACS Importer"
+!define MUI_FINISHPAGE_SHOWREADME $INSTDIR\README.txt
+!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall-colorful.ico"
+!define MUI_UNFINISHPAGE_NOAUTOCLOSE
+
+# Included files
+!include Sections.nsh
+!include MUI2.nsh
+#!include ShellLink.nsh
+
+# Variables
+Var StartMenuGroup
+
+# Installer pages
+!insertmacro MUI_PAGE_WELCOME
+!insertmacro MUI_PAGE_DIRECTORY
+!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup
+!insertmacro MUI_PAGE_INSTFILES
+!insertmacro MUI_PAGE_FINISH
+!insertmacro MUI_UNPAGE_CONFIRM
+!insertmacro MUI_UNPAGE_INSTFILES
+
+# Installer languages
+!insertmacro MUI_LANGUAGE English
+
+# Installer attributes
+OutFile ACSInstaller.exe
+InstallDir "$PROGRAMFILES\ACS Importer"
+CRCCheck on
+XPStyle on
+ShowInstDetails show
+VIProductVersion 1.0.0.0
+VIAddVersionKey ProductName "ACS Importer"
+VIAddVersionKey ProductVersion "${VERSION}"
+VIAddVersionKey CompanyName "${COMPANY}"
+VIAddVersionKey CompanyWebsite "${URL}"
+VIAddVersionKey FileVersion "${VERSION}"
+VIAddVersionKey FileDescription ""
+VIAddVersionKey LegalCopyright ""
+InstallDirRegKey HKLM "${REGKEY}" Path
+ShowUninstDetails show
+
+!define SHORTCUTFILE "$SMPROGRAMS\$StartMenuGroup\ACS Importer.lnk"
+
+# Installer sections
+Section -Main SEC0000
+ SetOutPath $INSTDIR
+ SetOverwrite on
+ File /r C:\projects\Temple_Univ_NIJ_Predictive_Policing\csharp\Azavea.NijPredictivePolicing.AcsImporter\bin\x86\Debug\*
+ ;File /r C:\projects\Temple_Univ_NIJ_Predictive_Policing\csharp\Azavea.NijPredictivePolicing.AcsImporter\bin\Debug\*
+ File C:\projects\Temple_Univ_NIJ_Predictive_Policing\doc\README.txt
+ File C:\projects\Temple_Univ_NIJ_Predictive_Policing\doc\Install.doc
+ File C:\projects\Temple_Univ_NIJ_Predictive_Policing\doc\Manual.doc
+ File C:\projects\Temple_Univ_NIJ_Predictive_Policing\doc\ACS_Importer_Flowchart.jpg
+
+ #Licenses#
+ SetOutPath $INSTDIR\Licenses
+ SetOutPath $INSTDIR\Licenses\Ionic
+ File C:\projects\Temple_Univ_NIJ_Predictive_Policing\lib\dotnetzip\License.txt
+ File C:\projects\Temple_Univ_NIJ_Predictive_Policing\lib\dotnetzip\PleaseDonate.txt
+ File C:\projects\Temple_Univ_NIJ_Predictive_Policing\lib\dotnetzip\Readme.txt
+ SetOutPath $INSTDIR\Licenses\exceldatareader
+ File C:\projects\Temple_Univ_NIJ_Predictive_Policing\lib\excelDataReader\license.txt
+ SetOutPath $INSTDIR\Licenses\geoapi
+ File C:\projects\Temple_Univ_NIJ_Predictive_Policing\lib\geoapi\lgpl-2.1.txt
+ SetOutPath $INSTDIR\Licenses\json
+ File C:\projects\Temple_Univ_NIJ_Predictive_Policing\lib\json\readme.txt
+ SetOutPath $INSTDIR\Licenses\log4net
+ File C:\projects\Temple_Univ_NIJ_Predictive_Policing\lib\log4net\LICENSE.txt
+ File C:\projects\Temple_Univ_NIJ_Predictive_Policing\lib\log4net\NOTICE.txt
+ File C:\projects\Temple_Univ_NIJ_Predictive_Policing\lib\log4net\README.txt
+ SetOutPath $INSTDIR\Licenses\nettopologysuite
+ File C:\projects\Temple_Univ_NIJ_Predictive_Policing\lib\nettopologysuite\License.txt
+ File C:\projects\Temple_Univ_NIJ_Predictive_Policing\lib\nettopologysuite\lgpl-3.0.txt
+ File C:\projects\Temple_Univ_NIJ_Predictive_Policing\lib\nettopologysuite\lgpl-2.1.txt
+ File C:\projects\Temple_Univ_NIJ_Predictive_Policing\lib\nettopologysuite\Iesi.Collections.License.txt
+ File C:\projects\Temple_Univ_NIJ_Predictive_Policing\lib\nettopologysuite\Rtools.Util.License.txt
+ SetOutPath $INSTDIR\Licenses\spatialite
+ File C:\projects\Temple_Univ_NIJ_Predictive_Policing\lib\spatialite\lgpl-v3.txt
+ SetOutPath $INSTDIR\Licenses\sqlite
+ File C:\projects\Temple_Univ_NIJ_Predictive_Policing\lib\sqlite\license.txt
+
+ SetOutPath $SMPROGRAMS\$StartMenuGroup
+
+ CreateShortcut "${SHORTCUTFILE}" "cmd" "/k cd $INSTDIR"
+ ShellLink::SetRunAsAdministrator "${SHORTCUTFILE}"
+ Pop $0
+ ShellLink::SetShortCutWorkingDirectory "${SHORTCUTFILE}" $INSTDIR
+ Pop $0
+
+ WriteRegStr HKLM "${REGKEY}\Components" Main 1
+SectionEnd
+
+Section -post SEC0001
+ WriteRegStr HKLM "${REGKEY}" Path $INSTDIR
+ SetOutPath $INSTDIR
+ WriteUninstaller $INSTDIR\uninstall.exe
+ !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
+ SetOutPath $SMPROGRAMS\$StartMenuGroup
+ CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" $INSTDIR\uninstall.exe
+ !insertmacro MUI_STARTMENU_WRITE_END
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)"
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "${VERSION}"
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Publisher "${COMPANY}"
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}"
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\uninstall.exe
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe
+ WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1
+ WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1
+SectionEnd
+
+# Macro for selecting uninstaller sections
+!macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID
+ Push $R0
+ ReadRegStr $R0 HKLM "${REGKEY}\Components" "${SECTION_NAME}"
+ StrCmp $R0 1 0 next${UNSECTION_ID}
+ !insertmacro SelectSection "${UNSECTION_ID}"
+ GoTo done${UNSECTION_ID}
+next${UNSECTION_ID}:
+ !insertmacro UnselectSection "${UNSECTION_ID}"
+done${UNSECTION_ID}:
+ Pop $R0
+!macroend
+
+# Uninstaller sections
+Section /o -un.Main UNSEC0000
+ Delete /REBOOTOK $INSTDIR\README.txt
+ RmDir /r /REBOOTOK $INSTDIR
+ DeleteRegValue HKLM "${REGKEY}\Components" Main
+SectionEnd
+
+Section -un.post UNSEC0001
+ DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
+ Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk"
+ Delete /REBOOTOK $INSTDIR\uninstall.exe
+ DeleteRegValue HKLM "${REGKEY}" StartMenuGroup
+ DeleteRegValue HKLM "${REGKEY}" Path
+ DeleteRegKey /IfEmpty HKLM "${REGKEY}\Components"
+ DeleteRegKey /IfEmpty HKLM "${REGKEY}"
+ RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup
+ RmDir /REBOOTOK $INSTDIR
+SectionEnd
+
+# Installer functions
+Function .onInit
+ InitPluginsDir
+FunctionEnd
+
+# Uninstaller functions
+Function un.onInit
+ ReadRegStr $INSTDIR HKLM "${REGKEY}" Path
+ !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup
+ !insertmacro SELECT_UNSECTION Main ${UNSEC0000}
+FunctionEnd
+

0 comments on commit d672bfa

Please sign in to comment.
Something went wrong with that request. Please try again.