Well, I gess I am on the line of fire.
Please don't shoot now, let me offer theses lines of thinking
> > Last month, Saint-Denis posted [1] a patch to fix bug 787, which deals
> > with Windows installer issues. Again, this applies cleanly, so if
someone
> > with a windows machine is willing to test it, it can get committed.
>
> I looked at this patch closely, because I'd been working on fixing this
> same bug shortly before the patch was committed. I didn't commmit the
patch
> for two reasons:
> 1. I was never able to reproduce the stated problem (can't install to a
> drive other than c:)
I am using Windows95, the bug is very real to me and it must also be to the
person who posted the bug!
Are you using WindowsNT? At work, I shortly used a windowsNT and found
differences in behaviour with my Windows 95. Unfortunatly, at the time I did
not know of this mail, so I did not check this bug in particular.
The differences I noticed are :
- the Insert special characters dialog does not show the actuals characters
on 95 while it does on NT
- the fisrt part of bug #911 description can be reproduced on 95 and not on
NT. The solution lies in handling explicitly the Windows WM_ACTIVATE message
and returning 1 instead of 0, that is in file ap_Win32Dialog_Paragraph.cpp.
This is true, at least on Windows95.
- on that same Paragraph dialog, moving between controls with the tab key is
very limited on 95 and close to perfection on NT.
Theses differences where apparent on the AbiWord version 0.7.10
distribution.
> 2. Even after applying the patch, the install path used by and
displayed
> in the installer has double slashes in it if you select a drive other than
> c: (D:\\AbiWord, for example), which though it doesn't cause any problems
> doesn't look right.
Considering a difference in behavior between Windows95 and NT, I certainly
used a non portable way of checking for disk root directory. It must be due
to ANSI and Unicode handling. I was not aware of the pitfall. On Windows95
the patch
is effective and as you noticed it does not break anything on WindowsNT.
With some more work I could probably find a portable way to do it on both.
>
> I don't think I've ever seen anybody shoot down a patch, but in this
> case, as much as I hate to do so, I don't think this should be applied.
If
> somebody else can reproduce the stated problem and confirm that the patch
> fixes it, I'll commit it. A this point, however, I just don't see any
sense
> in doing so, as it doesn't seem to solve any problems for me.
I do not want to be the first one to be shot down and hope somebody with
Windows95 will take the time to confirm this. ;-)
>
> > Additionally, Saint-Denis made a few suggestions in his message for
fixing
> > bug 710, in which we blatantly disregard the actual terms of the GPL. I
> > like all of them, and will creat a patch if (s)he doesn't want to.
My first name is Gilles and I am a "he".
I have attached the same patch 787 but including patch to bugs 710 and 455
also. They all pertain to the installer program. The patch also include a
way for the user to bail out of the installation if he get caught into one
error. I also added a verification of the file date. When the user is
making the installation over an already installed AbiWord, he will be
warned of his installation containing a file newer that the one to be
installed.
I guess, I must be pretty confident that my original patch work, at least in
Windows95, to offer you an encore.
You can shoot at will now!
? abi/src/ask/gendata/win/ask_gendata_data_Win32.c
? abi/src/pkg/win/setup/setup.rc2
Index: abi/src/ask/gendata/win/Makefile
===================================================================
RCS file: /cvsroot/abi/src/ask/gendata/win/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- abi/src/ask/gendata/win/Makefile 2000/06/02 15:17:40 1.5
+++ abi/src/ask/gendata/win/Makefile 2000/09/09 14:57:13
@@ -22,7 +22,7 @@
include $(ABI_ROOT)/src/config/abi_defs.mk
-CSRCS= ask_gendata_main_Win32.c
+CSRCS= ask_gendata_main_Win32.c ask_gendata_data_Win32.c
PROGRAM= $(BINDIR)/ask_gendata.exe
@@ -37,6 +37,12 @@
GARBAGE= ask_gendata.map ask_gendata.pdb
TARGETS= $(PROGRAM)
+
+ifeq ($(OS_NAME), WIN32)
+INCLUDES= -I$(ABI_XX_ROOT)/src/ask/lib/xp
+else
+INCLUDES= -I$(ABI_ROOT)/src/ask/lib/xp
+endif
include $(ABI_ROOT)/src/config/abi_rules.mk
Index: abi/src/ask/gendata/win/ask_gendata_main_Win32.c
===================================================================
RCS file: /cvsroot/abi/src/ask/gendata/win/ask_gendata_main_Win32.c,v
retrieving revision 1.1
diff -u -r1.1 ask_gendata_main_Win32.c
--- abi/src/ask/gendata/win/ask_gendata_main_Win32.c 1999/05/11 21:47:34 1.1
+++ abi/src/ask/gendata/win/ask_gendata_main_Win32.c 2000/09/09 14:57:13
@@ -15,6 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#include <ask.h>
int main(int argc, char**argv)
{
Index: abi/src/ask/gendata/xp/ask_gendata.c
===================================================================
RCS file: /cvsroot/abi/src/ask/gendata/xp/ask_gendata.c,v
retrieving revision 1.4
diff -u -r1.4 ask_gendata.c
--- abi/src/ask/gendata/xp/ask_gendata.c 1999/05/15 02:37:06 1.4
+++ abi/src/ask/gendata/xp/ask_gendata.c 2000/09/09 14:57:15
@@ -442,6 +442,7 @@
fprintf(fpOut, "/* This file was automatically generated by the AbiSource
Setup Kit. */\n");
fprintf(fpOut, "#include \"ask.h\"\n\n");
+ ASK_PlatformSpecificInstructions(fpOut);
parseInputFile(argv[1], fpOut);
@@ -461,7 +462,7 @@
pCurrentSet = pFirstSet;
while (pCurrentSet)
{
- int iNumFilesInSet = 0;
+ long iNumFilesInSet = 0;
fprintf(fpOut, "\nASK_DataFile* _fileset%05d_files[] = {\n",
iSetNum);
{
struct data_file_list_node* pNode = pCurrentSet->pHead;
@@ -480,7 +481,7 @@
fprintf(fpOut, "\t\"%s\",\n", pCurrentSet->szDefaultPath);
fprintf(fpOut, "\t\"%s\",\n", pCurrentSet->szDirName);
fprintf(fpOut, "\t\"%s\",\n", pCurrentSet->szKeyword);
- fprintf(fpOut, "\t%d,\n", iNumFilesInSet);
+ fprintf(fpOut, "\t%ld,\n", iNumFilesInSet);
fprintf(fpOut, "\t%d,\n", pCurrentSet->bFixedPath);
fprintf(fpOut, "\t_fileset%05d_files\n", iSetNum);
fprintf(fpOut, "};\n");
Index: abi/src/ask/lib/win/ask_lib_Win32.c
===================================================================
RCS file: /cvsroot/abi/src/ask/lib/win/ask_lib_Win32.c,v
retrieving revision 1.9
diff -u -r1.9 ask_lib_Win32.c
--- abi/src/ask/lib/win/ask_lib_Win32.c 2000/04/13 23:55:06 1.9
+++ abi/src/ask/lib/win/ask_lib_Win32.c 2000/09/09 14:57:23
@@ -50,6 +50,8 @@
HFONT g_hfontMain;
+static int s_bInstallationSuccessfull = 0;
+
#define ID_PANE 1000
#define ID_BTN_NEXT 1001
#define ID_BTN_CANCEL 1002
@@ -163,9 +165,18 @@
DWORD iNumberOfFreeClusters;
DWORD iTotalNumberOfClusters;
DWORD iBytes;
+ int iResult;
if (g_pSet_BrowseDir->pszDirName &&g_pSet_BrowseDir->pszDirName[0])
{
+ /* The disk root directory path ends with '\' but deeper path do not */
+ int iPathLength = strlen(pszPath);
+ if(pszPath[iPathLength - 1] == '\\')
+ {
+ /* Eliminate the '\' as we will build the complete path again
+*/
+ pszPath[iPathLength - 1] = '\0';
+ }
+
sprintf(g_szBrowseDir, "%s/%s", pszPath, g_pSet_BrowseDir->pszDirName);
}
else
@@ -184,17 +195,30 @@
p++;
*p = 0;
- GetDiskFreeSpace(szBuf,
+ iResult = GetDiskFreeSpace(szBuf,
&iSectorsPerCluster,
&iBytesPerSector,
&iNumberOfFreeClusters,
&iTotalNumberOfClusters);
- iBytes = iNumberOfFreeClusters * iSectorsPerCluster * iBytesPerSector;
+ iBytes = (iResult != 0 ? iNumberOfFreeClusters : 0)
+ * iSectorsPerCluster * iBytesPerSector;
// and set it into the static text display
ASK_convertBytesToString(iBytes, szBuf);
SetWindowText(g_hwndStatic_DiskSpace, szBuf);
+
+ if(iResult == 0)
+ {
+ EnableWindow(g_hwndButtonNext, FALSE);
+ MessageBox(g_hwndMain,
+ "The selected disk is not available.", "Error",
+ MB_ICONEXCLAMATION | MB_OK);
+ }
+ else
+ {
+ EnableWindow(g_hwndButtonNext, TRUE);
+ }
}
static void _png_read(png_structp png_ptr, png_bytep data, png_size_t length)
@@ -334,7 +358,7 @@
{
g_iWhichButton = ID_BTN_CANCEL;
QuitEventLoop();
- return 0;
+ return 1;
}
else
{
@@ -380,7 +404,7 @@
bi.pidlRoot = pidlPrograms;
bi.pszDisplayName = lpBuffer;
bi.lpszTitle = "Please choose a folder";
- bi.ulFlags = 0;
+ bi.ulFlags = BIF_RETURNONLYFSDIRS;
bi.lpfn = NULL;
bi.lParam = 0;
@@ -422,7 +446,8 @@
}
else if (wParam == 27)
{
- return try_cancel();
+ try_cancel();
+ return 0;
}
else
{
@@ -439,7 +464,8 @@
case BN_CLICKED:
if (wID == ID_BTN_CANCEL)
{
- return try_cancel();
+ try_cancel();
+ return 0;
}
else if (wID == ID_BTN_NEXT)
{
@@ -467,6 +493,21 @@
return 0;
}
+
+ case WM_CLOSE:
+ {
+ if(s_bInstallationSuccessfull)
+ {
+ QuitEventLoop();
+ PostQuitMessage(0);
+ return 0;
+ }
+ else
+ {
+ return ! try_cancel();
+ }
+ }
+
case WM_DESTROY:
{
PostQuitMessage(0);
@@ -609,7 +650,7 @@
#define GRAPHIC_WIDTH 200
-int ASK_Win32_Init(HINSTANCE hInstance)
+int ASK_Win32_Init(HINSTANCE hInstance, long iIconId)
{
int iScreenWidth;
int iScreenHeight;
@@ -633,7 +674,7 @@
g_wndclassMain.cbClsExtra = 0;
g_wndclassMain.cbWndExtra = 0;
g_wndclassMain.hInstance = hInstance;
- g_wndclassMain.hIcon = LoadIcon(NULL, IDI_APPLICATION);
+ g_wndclassMain.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(iIconId));
g_wndclassMain.hCursor = LoadCursor(NULL, IDC_ARROW);
g_wndclassMain.hbrBackground = GetSysColorBrush(COLOR_BTNFACE);
g_wndclassMain.lpszMenuName = NULL;
@@ -701,7 +742,7 @@
g_hwndMain = CreateWindow("AbiSetup_MainWindow",
"AbiSetup",
- WS_BORDER | WS_VISIBLE |
WS_CLIPCHILDREN,
+ WS_BORDER | WS_VISIBLE |
+WS_CLIPCHILDREN | WS_SYSMENU,
(iScreenWidth - MAINWIN_WIDTH) / 2,
(iScreenHeight - MAINWIN_HEIGHT) /2,
MAINWIN_WIDTH,
@@ -957,6 +998,9 @@
int iHeight;
RECT r;
+ HCURSOR hcursorHourGlass;
+ HCURSOR hcursorPrev;
+
if (pSet->bFixedPath)
{
// just do the fixed default path, but check for special names
@@ -973,6 +1017,9 @@
return 1;
}
+ hcursorHourGlass = LoadCursor(NULL, IDC_WAIT);
+ hcursorPrev = SetCursor(hcursorHourGlass);
+
sprintf(buf, "Choose directory for \"%s\"", pSet->pszName);
SetWindowText(g_hwndMain, buf);
@@ -1057,13 +1104,13 @@
SendMessage(hwndStatic_Dir, WM_SETFONT, (WPARAM) g_hfontMain, 0);
SendMessage(hwndStatic_Space, WM_SETFONT, (WPARAM) g_hfontMain, 0);
- ASK_convertBytesToString(ASK_getFileSetTotalSizeInBytes(pSet), buf2);
+ ASK_convertBytesToString(ASK_getFileSetTotalSizeInBytesToCopy(pSet), buf2);
sprintf(buf,
"\r\nPlease select a directory where '%s' will be
installed.\r\n\r\nThe set '%s' contains %d files,\r\na total of %s.\r\n\r\n",
pSet->pszName,
pSet->pszName,
- pSet->iNumFilesInSet,
+ ASK_getFileSetTotalFilesToCopy(pSet),
buf2);
SetWindowText(hwndStatic_Top, buf);
@@ -1071,6 +1118,8 @@
g_hwndStatic_BrowseDir = hwndStatic_Dir;
g_hwndStatic_DiskSpace = hwndStatic_Space;
+ SetCursor(hcursorPrev);
+
_updateDirAndSpace(g_pSet_BrowseDir->pszDefaultPath);
result = DoEventLoop();
@@ -1105,8 +1154,8 @@
{
ASK_FileSet* pSet = ppSets[ndxSet];
- iTotalBytes += ASK_getFileSetTotalSizeInBytes(pSet);
- iTotalNumFiles += pSet->iNumFilesInSet;
+ iTotalBytes += ASK_getFileSetTotalSizeInBytesToCopy(pSet);
+ iTotalNumFiles += ASK_getFileSetTotalFilesToCopy(pSet);
}
ASK_convertBytesToString(iTotalBytes, buf2);
@@ -1151,7 +1200,8 @@
etc.
*/
- int result;
+ int bCopyCancelled = 0;
+ int bErrorOccured = 0;
int ndxSet;
int ndxFile;
@@ -1177,8 +1227,8 @@
{
ASK_FileSet* pSet = ppSets[ndxSet];
- iTotalBytes += ASK_getFileSetTotalSizeInBytes(pSet);
- iTotalNumFiles += pSet->iNumFilesInSet;
+ iTotalBytes += ASK_getFileSetTotalSizeInBytesToCopy(pSet);
+ iTotalNumFiles += ASK_getFileSetTotalFilesToCopy(pSet);
}
GetClientRect(g_hwndPane, &r);
@@ -1258,7 +1308,7 @@
);
SetWindowText(hwndStatic_Top, buf);
- for (ndxSet=0; ndxSet<iNumSets; ndxSet++)
+ for (ndxSet=0; ndxSet<iNumSets && bCopyCancelled == 0; ndxSet++)
{
ASK_FileSet* pSet = ppSets[ndxSet];
@@ -1269,81 +1319,119 @@
ASK_fixSlashes(pSet->szInstallPath);
ASK_verifyDirExists(pSet->szInstallPath);
- for (ndxFile=0; ndxFile<pSet->iNumFilesInSet; ndxFile++)
+ for (ndxFile=0; ndxFile<pSet->iNumFilesInSet && bCopyCancelled == 0;
+ndxFile++)
{
- ASK_DataFile* pFile = pSet->aFiles[ndxFile];
-
- iCurFile++;
-
- sprintf(buf, "Copying file %d of %d (%s)",
- iCurFile,
- iTotalNumFiles,
- pFile->pszFileName
- );
- SetWindowText(hwndStatic_CurFile, buf);
-
+ if(pSet->aFiles[ndxFile]->bNoCopy == 0)
{
- int err;
-
- if (pFile->pszRelPath)
- {
- char szRelDir[ASK_MAX_PATH + 1];
-
- sprintf(szRelDir, "%s/%s",
pSet->szInstallPath, pFile->pszRelPath);
- ASK_fixSlashes(szRelDir);
- ASK_verifyDirExists(szRelDir);
-
- sprintf(pFile->szInstallPath, "%s/%s/%s",
pSet->szInstallPath, pFile->pszRelPath, pFile->pszFileName);
- }
- else
- {
- sprintf(pFile->szInstallPath, "%s/%s",
pSet->szInstallPath, pFile->pszFileName);
- }
-
- ASK_fixSlashes(pFile->szInstallPath);
+ ASK_DataFile* pFile = pSet->aFiles[ndxFile];
- // TODO check to see if the file and/or its directory
exist.
+ iCurFile++;
- err = ASK_decompressAndWriteFile(pFile);
- if (err < 0)
+ sprintf(buf, "Copying file %d of %d (%s)",
+ iCurFile,
+ iTotalNumFiles,
+ pFile->pszFileName
+ );
+ SetWindowText(hwndStatic_CurFile, buf);
+
{
- char szErr[ASK_MAX_PATH+1];
+ int err;
+ int bKeepExistingFile = 0;
- sprintf(szErr, "Attempt to write file '%s'
failed", pFile->szInstallPath);
-
- MessageBox(g_hwndMain, szErr, "Error",
MB_ICONEXCLAMATION | MB_OK);
- }
+ if (pFile->pszRelPath)
+ {
+ char szRelDir[ASK_MAX_PATH + 1];
+
+ sprintf(szRelDir, "%s/%s",
+pSet->szInstallPath, pFile->pszRelPath);
+ ASK_fixSlashes(szRelDir);
+ ASK_verifyDirExists(szRelDir);
+
+ sprintf(pFile->szInstallPath,
+"%s/%s/%s", pSet->szInstallPath, pFile->pszRelPath, pFile->pszFileName);
+ }
+ else
+ {
+ sprintf(pFile->szInstallPath, "%s/%s",
+pSet->szInstallPath, pFile->pszFileName);
+ }
- if (
- !(pFile->bNoCopy)
- && !(pFile->bNoRemove))
- {
- ASK_addToRemoveFile(pFile->szInstallPath);
+ ASK_fixSlashes(pFile->szInstallPath);
+
+ if(ASK_isFileNewer(pFile->szInstallPath,
+pFile->iModTime))
+ {
+ sprintf(buf, "A file on your system is
+newer than the one supplied with this\r\n\
+installation. It is recommanded to keep the existing file.\r\n\
+\r\n\
+File name:\t'%s'\r\n\
+\r\n\
+Do you want to keep this file?",
+ pFile->szInstallPath);
+
+ if(IDYES == MessageBox(g_hwndMain,
+buf, "Version conflict",
+ MB_ICONEXCLAMATION | MB_YESNO))
+ {
+ bKeepExistingFile = 1;
+ iCurBytes +=
+pFile->iOriginalLength;
+ }
+ }
+
+ if(bKeepExistingFile == 0)
+ {
+ err =
+ASK_decompressAndWriteFile(pFile);
+ if (err < 0)
+ {
+ sprintf(buf, "Attempt to write
+file '%s' failed", pFile->szInstallPath);
+
+ bErrorOccured = 1;
+ if(IDCANCEL ==
+MessageBox(g_hwndMain, buf, "Error",
+ MB_ICONEXCLAMATION |
+MB_OKCANCEL))
+ {
+ if(bCopyCancelled =
+try_cancel())
+ {
+ break;
+ }
+ }
+ }
+ else
+ {
+ iCurBytes +=
+pFile->iOriginalLength;
+ }
+ }
+
+ sprintf(buf, "Processed %d of %d bytes
+(%d%%)",iCurBytes, iTotalBytes, (iCurBytes * 100 / iTotalBytes));
+ SetWindowText(hwndStatic_CurBytes, buf);
+
+ SendMessage(hwndProgress, PBM_SETPOS, (WPARAM)
+(iCurBytes * 100 / iTotalBytes), (LPARAM) 0);
+
+ if (
+ !(pFile->bNoCopy)
+ && !(pFile->bNoRemove))
+ {
+
+ASK_addToRemoveFile(pFile->szInstallPath);
+ }
}
}
-
- iCurBytes += pFile->iOriginalLength;
-
- sprintf(buf, "Copied %d of %d bytes (%d%%)",iCurBytes,
iTotalBytes, (iCurBytes * 100 / iTotalBytes));
- SetWindowText(hwndStatic_CurBytes, buf);
-
- SendMessage(hwndProgress, PBM_SETPOS, (WPARAM) (iCurBytes *
100 / iTotalBytes), (LPARAM) 0);
}
}
- sprintf(buf,
- "\r\nCopying is now complete. Click the 'Next' button below
to continue."
- );
- SetWindowText(hwndStatic_Top, buf);
-
- SetWindowText(g_hwndMain, "Done Copying Files");
- EnableWindow(g_hwndButtonCancel, FALSE);
+ if(bErrorOccured == 0)
+ {
+ sprintf(buf,
+ "\r\nCopying is now complete. Click the 'Next' button
+below to continue."
+ );
+ SetWindowText(hwndStatic_Top, buf);
- ShowWindow(hwndProgress, SW_HIDE);
-
- result = DoEventLoop();
+ SetWindowText(g_hwndMain, "Done Copying Files");
+ EnableWindow(g_hwndButtonCancel, FALSE);
- EnableWindow(g_hwndButtonCancel, TRUE);
+ ShowWindow(hwndProgress, SW_HIDE);
+
+ s_bInstallationSuccessfull = 1;
+ DoEventLoop();
+ }
+ else
+ {
+ EnableWindow(g_hwndButtonNext, FALSE);
+ EnableWindow(g_hwndButtonCancel, FALSE);
+ }
DestroyWindow(hwndStatic_Top);
DestroyWindow(hwndStatic_CurSet);
@@ -1351,7 +1439,7 @@
DestroyWindow(hwndStatic_CurBytes);
DestroyWindow(hwndProgress);
- return result;
+ return bErrorOccured;
}
int ASK_DoScreen_license(char* pszText)
@@ -1361,7 +1449,7 @@
HWND hwndStatic;
RECT r;
- SetWindowText(g_hwndMain, "You must accept this license in order to install
the software.");
+ SetWindowText(g_hwndMain, "GNU General Public License.");
GetClientRect(g_hwndPane, &r);
@@ -1392,12 +1480,9 @@
SendMessage(hwndStatic, WM_SETFONT, (WPARAM) g_hfontMain, 0);
SendMessage(hwndText, WM_SETFONT, (WPARAM) g_hfontMain, 0);
- SetWindowText(hwndStatic, "Do you accept the terms of this license?");
+ SetWindowText(hwndStatic, "Theses are the terms of the license");
SetWindowText(hwndText, pszText);
-
- SetWindowText(g_hwndButtonNext, "Yes");
- SetWindowText(g_hwndButtonCancel, "No");
result = DoEventLoop();
Index: abi/src/ask/lib/xp/ask.h
===================================================================
RCS file: /cvsroot/abi/src/ask/lib/xp/ask.h,v
retrieving revision 1.2
diff -u -r1.2 ask.h
--- abi/src/ask/lib/xp/ask.h 1999/05/15 02:37:08 1.2
+++ abi/src/ask/lib/xp/ask.h 2000/09/09 14:57:23
@@ -79,12 +79,17 @@
int ASK_decompressAndWriteFile(ASK_DataFile* pDataFile);
long ASK_getFileSetTotalSizeInBytes(ASK_FileSet* pFileSet);
+long ASK_getFileSetTotalSizeInBytesToCopy(ASK_FileSet* pFileSet);
+long ASK_getFileSetTotalFilesToCopy(ASK_FileSet* pFileSet);
void ASK_convertBytesToString(long n, char* pszStrings);
+int ASK_isFileNewer(char* pszFileName, unsigned int iModTime);
/*
Functions implemented in platform code
*/
+void ASK_createRemoveFile(char* pszName);
+void ASK_registerForRemove(void);
unsigned int ASK_getFileModTime(const char* pszFileName);
void ASK_setFileModTime(const char* pszFileName, unsigned int iModTime);
unsigned int ASK_getFileAttributes(const char* pszFileName);
@@ -108,6 +113,9 @@
int ASK_YesNo(char* pszTitle, char* pszMessage);
void ASK_PopulateStartMenu(char* pszGroupName, int iNumSets, ASK_FileSet** ppSets);
+
+void ASK_PlatformSpecificInstructions(FILE* fpOut);
+int lib_main(int argc, char** argv);
#endif /* ASK_H */
Index: abi/src/ask/lib/xp/ask_lib.c
===================================================================
RCS file: /cvsroot/abi/src/ask/lib/xp/ask_lib.c,v
retrieving revision 1.3
diff -u -r1.3 ask_lib.c
--- abi/src/ask/lib/xp/ask_lib.c 1999/05/14 01:29:22 1.3
+++ abi/src/ask/lib/xp/ask_lib.c 2000/09/09 14:57:24
@@ -225,6 +225,38 @@
return len;
}
+long ASK_getFileSetTotalSizeInBytesToCopy(ASK_FileSet* pFileSet)
+{
+ long len = 0;
+ int i;
+
+ for (i=0; i<pFileSet->iNumFilesInSet; i++)
+ {
+ if(pFileSet->aFiles[i]->bNoCopy == 0)
+ {
+ len += pFileSet->aFiles[i]->iOriginalLength;
+ }
+ }
+
+ return len;
+}
+
+long ASK_getFileSetTotalFilesToCopy(ASK_FileSet* pFileSet)
+{
+ long count = 0;
+ int i;
+
+ for (i=0; i<pFileSet->iNumFilesInSet; i++)
+ {
+ if(pFileSet->aFiles[i]->bNoCopy == 0)
+ {
+ count++;
+ }
+ }
+
+ return count;
+}
+
void ASK_convertBytesToString(long n, char* pszStrings)
{
if (n < 1024)
@@ -244,3 +276,18 @@
sprintf(pszStrings, "%4.1f MB", n / (1024 * 1024.0));
}
+int ASK_isFileNewer(char* pszFileName, unsigned int iModTime)
+{
+ if(ASK_fileExists(pszFileName))
+ {
+ if(ASK_getFileModTime(pszFileName) <= iModTime)
+ {
+ return 0;
+ }
+ else
+ {
+ return 1;
+ }
+ }
+ return 0;
+}
Index: abi/src/pkg/win/setup/setup.c
===================================================================
RCS file: /cvsroot/abi/src/pkg/win/setup/setup.c,v
retrieving revision 1.1
diff -u -r1.1 setup.c
--- abi/src/pkg/win/setup/setup.c 1999/05/11 21:47:44 1.1
+++ abi/src/pkg/win/setup/setup.c 2000/09/09 14:57:33
@@ -21,14 +21,16 @@
#include "ask.h"
-extern int ASK_Win32_Init(HINSTANCE hInstance);
+#include "setup.rc2"
+extern int ASK_Win32_Init(HINSTANCE hInstance, long iIconId);
+
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
int result;
- if (0 != ASK_Win32_Init(hInstance))
+ if (0 != ASK_Win32_Init(hInstance, AP_ICON_SETUP))
{
return -1;
}
@@ -99,7 +101,8 @@
if (err != 0)
{
- // TODO inform the user of the error
+ MessageBox(NULL, "Installation is not complete", "AbiSetup",
+MB_OK);
+ goto all_done;
}
}
Index: abi/src/pkg/win/setup/setup.rc
===================================================================
RCS file: /cvsroot/abi/src/pkg/win/setup/setup.rc,v
retrieving revision 1.1
diff -u -r1.1 setup.rc
--- abi/src/pkg/win/setup/setup.rc 1999/05/17 20:41:10 1.1
+++ abi/src/pkg/win/setup/setup.rc 2000/09/09 14:57:33
@@ -19,16 +19,4 @@
#include <windows.h>
-#ifdef RC_INVOKED
-
-#ifdef ABISOURCE_LICENSED_TRADEMARKS
-
-10000 ICON DISCARDABLE "setup_tm.ico"
-
-#else
-
-10000 ICON DISCARDABLE "setup.ico"
-
-#endif
-
-#endif
+#include <setup.rc2>
ask_gendata_data_Win32.c
setup.rc2