// Junk Spy V3 installation file

// Variable usage
// A Program and documentation
// B Create objects
// C Overwrite clue database
// D Run wizard
// E Extended error messages
// G temp var for create shadow
// H True on Warp 4
// I
// J Busy copy
// K Existing copy
// L Overwrite copy
// M Ask if you use dial-up
// N Ask if you get mail through dial-up
// O Doesn't Have Netscape
// P PR Check flag


@option         B:      H: "version >= 240"

//Netscape Check

@getini         A:      * Netscape 4.6 7
@option         A:      O: "null:%7"
@getini         (AO):    *       Netscape 4.0 7
@option         A:      O:      "null:%7"
@getini         (AO):     *       Netscape 2.02 7
@option         A:      O:      "null:%7"
@messagebox         O:  "The Installer did not find Netscape... so will attempt to use another browser to display documentation when necessary."

// Check for existing version
@option         A:      K: "exists:%1\junkspy.exe"
@option         K:      L: "ask:Update the installed copy of Junk Spy?"
@errorexit      (K!L):  "Install not attempted."

// check for prerelease existance
@option         B:      P: "object:<JUNKSPYPR>"
@message:       (BP):   "Junk Spy PreRelease version appears installed on system."
@xwps           (BP):   "<JUNKSPYPR>"

@option         B:      P: "object:<KIWIPR>"
@message:       (BP):   "Junk Spy PreRelease version appears installed on system."
@xwps           (BP):   "<KIWIPR>"

//Check for running copy
@option         A:      J: "busy:%1\junkspy.exe"
@option         J:      L: "ask:The copy of Junk Spy in the installation directory appears to be running.  If Junk Spy is running close it before proceeding.  Try to install anyway?"
@errorexit      (J!L):  "Install not attempted"

// turn on extended errors
@poo    E:      OE

// setup program result codes
@prm            ABCD:   1       "Portions of the zip file were not processed."
@prm            ABCD:   2       "The zip file is damaged."
@prm            ABCD:   3       "The zip file is badly damaged."
@prm            ABCD:   9       "The zip file was not found."
@prm            ABCD:   50      "A file cannot be copied (file is in use or there is not enough disk space)."
@prm            ABCD:   51      "The end of the zip file was encountered prematurely."
@prm            ABCD:   81      "The zip file was not processed."


// create directory if necessary
@directory      A:      %1
@cd             A:      %1

// copy all files
@pgm            A:      3 %0\unzip -o %0\program.zip

// save installation path
@setini A: * JunkSpy INSTALLATIONPATH %1

// Copy DLLs
@pgm            A:      3 %0\unzip -o %0\DLL.zip

// Database
@pgm            A:     3 %0\unzip -o %0\spec.zip
@copy           (AC)(A!K):              %1\specnew.db %1\spec.db
@copy           (AC)(A!K):              %1\detnew.db %1\detect.db
@del           (AC)(A!K):               %1\init.upd

// Merge
@messagebox     (AK!C):      "About to start the database update process.  In some cases, this may take a minute or two."
@message        (AK!C):      "Merging database"
@copy           (AK!C):      %0\packdb.exe %1\packdb.exe
@cd             (AK!C):      %1
@pgm            (AK!C):      1 packdb
@copy           (AK!C):      %1\spec.dbb %1\spec.db1
@pgm            (AK!C):      3 %0\mergedb %1\specdel.db %1\spec.db
@copy           (AK!C):      %0\packdb.exe %1\packdb.exe
@cd             (AK!C):      %1
@pgm            (AK!C):      1 packdb
@del            (AK!C):      packdb.exe
@cd             (AK!C)       %0
@pgm            (AK!C):      3 %0\mergedb %1\specnew.db %1\spec.db
@pgm            (AK!C):      3 %0\mergedet %1\detnew.db %1\detect.db
@cd             (AK!C):         %1
@pgm            (AK!C):         1 %0\extdet.exe
@cd             (AK!C):         %0


// Cleanup
@del            A:              %1\specnew.db
@del            A:              %1\detnew.db

// Copy uninstall stuff
@copy           A:      %0\install.exe  %1\uinstall.exe
@copy           A:      %0\uinstall.lst %1\uinstall.lst
@copy           A:      %0\uinstall.1   %1\uinstall.1
@copy           A:      %0\uinstall.dat %1\uinstall.cmd



// create objects
@var:           B:      <JUNKSPY_FOLDER> 5
@var:           B:      REPLACE 6
@wps:           B:
WPFolder
"Junk Spy"
OBJECTID=%5;
<WP_DESKTOP>
%6

@wps:           B:
WPFolder
"Junk Spy|Documentation"
OBJECTID=<JUNKSPY_DOCFOLDER>
%5
%6

@wps:           B:
WPProgram
"Junk Spy"
EXENAME=%1//JUNKSPY.EXE;STARTUPDIR=%1;OBJECTID=<JUNKSPY_EXE>;
%5
%6

// warp 4 only
@wps:           (BH):
WPUrl
"Junk Spy|Home Page"
URL=http://www.junkspy.com/junkspyhome/;OBJECTID=<JUNKSPY_URL>;
%5
%6

// warp 3 only
@wps:           (B!H):
WPProgram
"Junk Spy|Home Page"
"EXENAME=NETSCAPE.EXE;PARAMETERS=http://www.junkspy.com/junkspyhome/;OBJECTID=<JUNKSPY_URL>;"
%5
%6

@wps:           B:
WPProgram
"Junk Spy|Uninstall"
"EXENAME=CMD.EXE;PARAMETERS=/C UINSTALL.CMD;STARTUPDIR=%1;MINIMIZED=YES;OBJECTID=<JUNKSPY_UINSTALL>;"
%5
%6

@wps:           B:
WPProgram
"Junk Spy|TCP/IP Wizard"
EXENAME=%1//TCPWIZ.EXE;STARTUPDIR=%1;OBJECTID=<JUNKSPY_CFG>;
%5
%6

// warp 4 only
@wps:           (BH):
WPUrl
"Junk Spy Users Guide"
URL=%1\manual\index.htm;OBJECTID=<JUNKSPY_USERSGUIDE_URL>;
<JUNKSPY_DOCFOLDER>
%6

// warp 3 only
@wps:           (B!H):
WPProgram
"Junk Spy Users Guide"
"EXENAME=NETSCAPE.EXE;PARAMETERS=%1\manual\index.htm;OBJECTID=<JUNKSPY_USERSGUIDE_URL>;"
<JUNKSPY_DOCFOLDER>
%6


@wps:           B:
WPFolder
"Email Getting|Started Guides"
OBJECTID=<JUNKSPY_EMAILDOCFOLDER>
<JUNKSPY_DOCFOLDER>
%6

@wps:           (BH):
WPUrl
"Getting Started|with Post Road Mailer"
URL=%1\manual\prm\install.htm;OBJECTID=<JUNKSPY_PRM_URL>;
<JUNKSPY_EMAILDOCFOLDER>
%6

@wps:           (BH):
WPUrl
"Getting Started|with PMMail"
URL=%1\manual\pmmail\install.htm;OBJECTID=<JUNKSPY_PMMAIL_URL>;
<JUNKSPY_EMAILDOCFOLDER>
%6

@wps:           (BH):
WPUrl
"Getting Started with|other email Programs"
URL=%1\manual\generic\install.htm;OBJECTID=<JUNKSPY_GENERIC_URL>;
<JUNKSPY_EMAILDOCFOLDER>
%6

@wps:           (BH):
WPUrl
"Getting Started|with Netscape 4.61"
URL=%1\manual\nets461\install.htm;OBJECTID=<JUNKSPY_NETSCAPE46_URL>;
<JUNKSPY_EMAILDOCFOLDER>
%6

@wps:           (BH):
WPUrl
"Getting Started|with Netscape 4.04"
URL=%1\manual\nets404\install.htm;OBJECTID=<JUNKSPY_NETSCAPE4_URL>;
<JUNKSPY_EMAILDOCFOLDER>
%6

@wps:           (BH):
WPUrl
"Getting Started|with Netscape 2.02"
URL=%1\manual\nets202\install.htm;OBJECTID=<JUNKSPY_NETSCAPE2_URL>;
<JUNKSPY_EMAILDOCFOLDER>
%6

@wps:           (BH):
WPUrl
"Getting Started|with MR/2 ICE"
URL=%1\manual\mr2\install.htm;OBJECTID=<JUNKSPY_MR2_URL>;
<JUNKSPY_EMAILDOCFOLDER>
%6

@wps:           (BH):
WPUrl
"Getting Started|with Mozilla"
URL=%1\manual\mozilla\install.htm;OBJECTID=<JUNKSPY_MOZILLA_URL>;
<JUNKSPY_EMAILDOCFOLDER>
%6

@wps:           (BH):
WPUrl
"Getting Started|with Polarbar Mailer"
URL=%1\manual\polarbar\install.htm;OBJECTID=<JUNKSPY_POLARBAR_URL>;
<JUNKSPY_EMAILDOCFOLDER>
%6

@wps:           (B!H):
WPProgram
"Getting Started|with Post Road Mailer"
"EXENAME=NETSCAPE.EXE;PARAMETERS=%1\manual\prm\install.htm;OBJECTID=<JUNKSPY_PRM_URL>;"
<JUNKSPY_EMAILDOCFOLDER>
%6

@wps:           (B!H):
WPProgram
"Getting Started|with PMMail"
"EXENAME=NETSCAPE.EXE;PARAMETERS=%1\manual\pmmail\install.htm;OBJECTID=<JUNKSPY_PMMAIL_URL>;"
<JUNKSPY_EMAILDOCFOLDER>
%6

@wps:           (B!H):
WPProgram
"Getting Started with|other email Programs"
"EXENAME=NETSCAPE.EXE;PARAMETERS=%1\manual\generic\install.htm;OBJECTID=<JUNKSPY_GENERIC_URL>;"
<JUNKSPY_EMAILDOCFOLDER>
%6

@wps:           (B!H):
WPProgram
"Getting Started|with Netscape 4.61"
"EXENAME=NETSCAPE.EXE;PARAMETERS=%1\manual\nets461\install.htm;OBJECTID=<JUNKSPY_NETSCAPE46_URL>;"
<JUNKSPY_EMAILDOCFOLDER>
%6

@wps:           (B!H):
WPProgram
"Getting Started|with Netscape 4.04"
"EXENAME=NETSCAPE.EXE;PARAMETERS=%1\manual\nets404\install.htm;OBJECTID=<JUNKSPY_NETSCAPE4_URL>;"
<JUNKSPY_EMAILDOCFOLDER>
%6

@wps:           (B!H):
WPProgram
"Getting Started|with Netscape 2.02"
"EXENAME=NETSCAPE.EXE;PARAMETERS=%1\manual\nets202\install.htm;OBJECTID=<JUNKSPY_NETSCAPE2_URL>"
<JUNKSPY_EMAILDOCFOLDER>
%6

@wps:           (B!H):
WPProgram
"Getting Started|with MR/2 ICE"
"EXENAME=NETSCAPE.EXE;PARAMETERS=%1\manual\mr2\install.htm;OBJECTID=<JUNKSPY_MR2_URL>;"
<JUNKSPY_EMAILDOCFOLDER>
%6

@wps:           (B!H):
WPProgram
"Getting Started|with Mozilla"
"EXENAME=NETSCAPE.EXE;PARAMETERS=%1\manual\mozilla\install.htm;OBJECTID=<JUNKSPY_MOZILLA_URL>;"
<JUNKSPY_EMAILDOCFOLDER>
%6

@wps:           (B!H):
WPProgram
"Getting Started|with jStreet Mailer"
"EXENAME=NETSCAPE.EXE;PARAMETERS=%1\manual\jstreet\install.htm;OBJECTID=<JUNKSPY_JSTREET_URL>;"
<JUNKSPY_EMAILDOCFOLDER>
%6

@wps:           B:
WPProgram
"License|Agreement"
EXENAME=E.EXE;STARTUPDIR=%1;PARAMETERS=LICENSE.TXT;OBJECTID=<JUNKSPY_LICENSE>;
<JUNKSPY_DOCFOLDER>
%6

@wps:           B:
WPProgram
"Read Me"
EXENAME=E.EXE;STARTUPDIR=%1;PARAMETERS=README.TXT;OBJECTID=<JUNKSPY_README>;
<JUNKSPY_DOCFOLDER>
%6


// Ask for shadow
@option         B:      G: "ask:Create shadow of Junk Spy in the Startup Folder so Junk Spy automatically runs each time you start your system?"

@WPS            (BG):
WPShadow
"Junk Spy"
ShadowID=<JUNKSPY_EXE>;OBJECTID=<SH_JUNKSPYEXE>;
<WP_START>
%6


@option         A:      M: "ask:Do you use a dial-up connection to retrieve your mail?"
@option         M:      N: "ask:Does your email program automatically check for mail even when you're disconnected from the Internet?"
@setini         (MN):      %1\Junkspy.ini Settings NetworkMonitorEnable 1
@setini         (MN):      %1\Junkspy.ini Settings NetworkMonitorInterval 30

@pgm            D:      3 CMD.exe /C "Start %1\TCPWIZ.exe"

