SetOutPath "$INSTDIR\Server\usr\afs\bin"
File "${AFS_SERVER_BUILDDIR}\afskill.exe"
File "${AFS_SERVER_BUILDDIR}\afssvrcfg.exe"
+ File "${AFS_SERVER_BUILDDIR}\asetkey.exe"
File "${AFS_SERVER_BUILDDIR}\bosctlsvc.exe"
File "${AFS_SERVER_BUILDDIR}\bosserver.exe"
File "${AFS_SERVER_BUILDDIR}\buserver.exe"
SetOutPath "$INSTDIR\Server\usr\afs\bin"
File "${AFS_SERVER_BUILDDIR}\afskill.pdb"
File "${AFS_SERVER_BUILDDIR}\afssvrcfg.pdb"
+ File "${AFS_SERVER_BUILDDIR}\asetkey.pdb"
File "${AFS_SERVER_BUILDDIR}\bosctlsvc.pdb"
File "${AFS_SERVER_BUILDDIR}\bosserver.pdb"
File "${AFS_SERVER_BUILDDIR}\buserver.pdb"
GUID netGuid;
HDEVINFO hDeviceInfo = INVALID_HANDLE_VALUE;
SP_DEVINFO_DATA DeviceInfoData;
- TCHAR* deviceDesc;
DWORD index = 0;
BOOL found = FALSE;
DWORD size = 0;
if (hDeviceInfo == INVALID_HANDLE_VALUE)
return GetLastError();
- deviceDesc = (TCHAR *)malloc(MAX_PATH*sizeof(TCHAR));
// enumerate the driver info list
- while (SetupDiEnumDeviceInfo(hDeviceInfo, index, &DeviceInfoData))
+ while (TRUE)
{
+ TCHAR * deviceHwid;
+
+ ok = SetupDiEnumDeviceInfo(hDeviceInfo, index, &DeviceInfoData);
+
+ if(!ok)
+ {
+ if(GetLastError() == ERROR_NO_MORE_ITEMS)
+ break;
+ else
+ {
+ index++;
+ continue;
+ }
+ }
+
// try to get the DeviceDesc registry property
- ok = SetupDiGetDeviceRegistryProperty(hDeviceInfo, &DeviceInfoData,
- SPDRP_DEVICEDESC,
- NULL, (PBYTE)deviceDesc,
- MAX_PATH * sizeof(TCHAR), &size);
+ ok = SetupDiGetDeviceRegistryProperty(hDeviceInfo,
+ &DeviceInfoData,
+ SPDRP_HARDWAREID,
+ NULL,
+ NULL,
+ 0,
+ &size);
if (!ok)
{
ret = GetLastError();
- if (ret != ERROR_INSUFFICIENT_BUFFER)
- break;
- // if the buffer is too small, reallocate
- free(deviceDesc);
- deviceDesc = (TCHAR *)malloc(size);
+ if (ret != ERROR_INSUFFICIENT_BUFFER) {
+ index++;
+ continue;
+ }
+
+ deviceHwid = (TCHAR *)malloc(size);
ok = SetupDiGetDeviceRegistryProperty(hDeviceInfo,
&DeviceInfoData,
- SPDRP_DEVICEDESC,
- NULL, (PBYTE)deviceDesc,
- size, NULL);
- if (!ok)
- break;
- }
+ SPDRP_HARDWAREID,
+ NULL,
+ (PBYTE)deviceHwid,
+ size,
+ NULL);
+ if (!ok) {
+ free(deviceHwid);
+ deviceHwid = NULL;
+ index++;
+ continue;
+ }
+ } else {
+ // something is wrong. This shouldn't have worked with a NULL buffer
+ ReportMessage(0, "GetDeviceRegistryProperty succeeded with a NULL buffer", NULL, NULL, 0);
+ index++;
+ continue;
+ }
- // case insensitive comparison
- _tcslwr(deviceDesc);
- if( _tcsstr(deviceDesc, DRIVER))
- {
- found = TRUE;
- break;
- }
+ for (TCHAR *t = deviceHwid; t && *t && t < &deviceHwid[size / sizeof(TCHAR)]; t += _tcslen(t) + 1)
+ {
+ if(!_tcsicmp(DRIVERHWID, t)) {
+ found = TRUE;
+ break;
+ }
+ }
+
+ if (deviceHwid) {
+ free(deviceHwid);
+ deviceHwid = NULL;
+ }
+ if (found)
+ break;
+
index++;
}
- free(deviceDesc);
-
if (found == FALSE)
{
ret = GetLastError();
ret = GetLastError();
goto cleanup;
}
+
ok = SetupDiCallClassInstaller(DIF_REMOVE, hDeviceInfo, &DeviceInfoData);
if (!ok)
{
goto cleanup;
}
+ ret = 0;
+
cleanup:
// clean up the device info set
if (hDeviceInfo != INVALID_HANDLE_VALUE)
BOOL IsLoopbackInstalled(void)
{
- TCHAR * hwid = _T("*MSLOOP");
HDEVINFO DeviceInfoSet;
SP_DEVINFO_DATA DeviceInfoData;
DWORD i,err;
//
found = FALSE;
DeviceInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
- for (i=0; SetupDiEnumDeviceInfo(DeviceInfoSet,i,&DeviceInfoData); i++)
+ for (i=0; ;i++)
{
+ BOOL ok;
DWORD DataT;
TCHAR *p, *buffer = NULL;
DWORD buffersize = 0;
+
+ ok = SetupDiEnumDeviceInfo(DeviceInfoSet, i, &DeviceInfoData);
+
+ if(!ok) {
+ if(GetLastError() == ERROR_NO_MORE_ITEMS)
+ break;
+ else
+ continue;
+ }
//
// We won't know the size of the HardwareID buffer until we call
// use the required buffer size to Alloc the nessicary space.
// Keep calling we have success or an unknown failure.
//
- while (!SetupDiGetDeviceRegistryProperty(DeviceInfoSet,&DeviceInfoData,SPDRP_HARDWAREID,&DataT,(PBYTE)buffer,buffersize,&buffersize))
+ while (!SetupDiGetDeviceRegistryProperty(DeviceInfoSet,
+ &DeviceInfoData,
+ SPDRP_HARDWAREID,
+ &DataT,
+ (PBYTE)buffer,
+ buffersize,
+ &buffersize))
{
if (GetLastError() == ERROR_INVALID_DATA)
{
}
else
{
+ if (buffer)
+ LocalFree(buffer);
goto cleanup_DeviceInfo;
- }
+ }
}
- if (GetLastError() == ERROR_INVALID_DATA)
+ if (GetLastError() == ERROR_INVALID_DATA) {
+ if (buffer)
+ LocalFree(buffer);
continue;
+ }
// Compare each entry in the buffer multi-sz list with our hwid.
for (p=buffer; *p && (p < &buffer[buffersize]); p += _tcslen(p)+1)
{
- if (!_tcsicmp(hwid,p))
+ if (!_tcsicmp(DRIVERHWID,p))
{
found = TRUE;
break;
}
}
- if (buffer) LocalFree(buffer);
- if (found) break;
+ if (buffer)
+ LocalFree(buffer);
+ if (found)
+ break;
}
// Cleanup.
// if we successfully find the hardware ID and it turns out to
// be the one for the loopback driver, then we are done.
- if(SetupDiGetDriverInfoDetail(hDeviceInfo,
+ if (SetupDiGetDriverInfoDetail(hDeviceInfo,
&DeviceInfoData,
&DriverInfoData,
pDriverInfoDetail,
sizeof(detailBuf),
- NULL) &&
- !_tcsicmp(pDriverInfoDetail->HardwareID, DRIVERHWID)) {
-
- found = TRUE;
- break;
+ NULL)) {
+ TCHAR * t;
+
+ // pDriverInfoDetail->HardwareID is a MULTISZ string. Go through the
+ // whole list and see if there is a match somewhere.
+ t = pDriverInfoDetail->HardwareID;
+ while (t && *t && t < (TCHAR *) &detailBuf[sizeof(detailBuf)/sizeof(detailBuf[0])]) {
+ if (!_tcsicmp(t, DRIVERHWID))
+ break;
+
+ t += _tcslen(t) + 1;
+ }
+
+ if (t && *t && t < (TCHAR *) &detailBuf[sizeof(detailBuf)/sizeof(detailBuf[0])]) {
+ found = TRUE;
+ break;
+ }
}
index++;
+# Copyright 2004, OpenAFS.ORG and others.
+# All Rights Reserved.
+#
+# This software has been released under the terms of the IBM Public
+# License. For details, see the LICENSE file in the top-level source
+# directory or online at http://www.openafs.org/dl/license10.html
+
RELDIR=WINNT\install\wix
!INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME)
!INCLUDE ..\..\..\config\NTMakefile.version
lang:: lang_clean $(MSIFILE)
+uninst:
+ $(CD) uninstall
+ $(MAKE) /f NTMakefile /nologo install
+ $(CD) ..
+
customactions:
$(CD) custom
$(MAKE) /f NTMakefile /nologo install
$(CD) ..
-install: customactions languages
+install: uninst customactions languages
$(MSIFILE): $(WIXOBJ)
light -nologo -out $(MSIFILE) \
$(CD) custom
$(MAKE) /f NTMakefile /nologo clean
$(CD) ..
+ $(CD) uninstall
+ $(MAKE) /f NTMakefile /nologo clean
+ $(CD) ..
lang_clean:
-$(DEL) $(WIXOBJ)
Title="OpenAFS">
<ComponentRef Id="efl_desktop_INI" />
<ComponentRef Id="efl_replace_afs_CMD" />
+ <ComponentRef Id="efl_uninstall_EXE" />
<Feature Id="feaClient" AllowAdvertise="no" Description="$(loc.StrAFSClientLongDesc)" Display="expand"
InstallDefault="followParent" Level="30" Title="$(loc.StrAFSClientDesc)">
<ComponentRef Id="cmf_volserver_EXE" />
<ComponentRef Id="cmf_afskill_EXE" />
<ComponentRef Id="cmf_afssvrcfg_EXE" />
+ <ComponentRef Id="cmf_asetkey_EXE" />
<ComponentRef Id="cmf_bosctlsvc_EXE" />
<ComponentRef Id="cmf_bosserver_EXE" />
<ComponentRef Id="cmf_buserver_EXE" />
<Component Id="efl_replace_afs_CMD" Guid="C9C93F3E-EEBA-4056-9669-5EF78D748D50">
<File Id="filreplace_afs_CMD" Name="replafs.cmd" LongName="replace_afs.cmd" KeyPath="yes" DiskId="1" src="$(var.SrcDir)\WINNT\install\wix\replace_afs.cmd" />
</Component>
+ <Component Id="efl_uninstall_EXE" Guid="8B99B979-03F4-4AB5-9CE8-1DA97DB6613A">
+ <File Id="filuninstall_EXE" Name="uninst.exe" LongName="uninstall.exe" KeyPath="yes" DiskId="1" src="$(var.ClientDir)\uninstall.exe">
+ <Shortcut Id="scUninstall" Directory="dirShortCut" Name="Uninst.lnk" LongName="Uninstall OpenAFS.lnk" Description="$(loc.StrUninstallDesc)" Icon="ico_OpenAFS" IconIndex="0" Show="normal" />
+ </File>
+ </Component>
<Directory Id="dirCommon" Name="Common">
<Component Id="cmp_CommonDir" Guid="C86B03A1-AE97-48B1-A77B-1B2395F1E117" KeyPath="yes">
<Environment Id="envCommon" Name="PATH" Action="create" System="yes" Permanent="no" Part="last" Separator=";" Value="[AFSDIR]Common" />
<Shortcut Id="scSvrCfgWizard" Directory="dirShortCut" Name="SvrCfgWz.lnk" LongName="Server Configuration Wizard.lnk" Description="$(loc.StrCfgWzdDesc)" Arguments="/wizard" Icon="ico_afssvrcfg" IconIndex="0" Show="normal" WorkingDirectory="dirCommon" />
</File>
</Component>
+ <Component Id="cmf_asetkey_EXE" Guid="9B7694A2-DCAE-4DBA-84F2-09DC796C20B2">
+ <File Id="fileasetkey_EXE" Name="asetk.exe" LongName="asetkey.exe" KeyPath="yes" DiskId="1" />
+ </Component>
<Component Id="cmf_bosctlsvc_EXE" Guid="8F6F62A8-BB6D-46C1-BA80-4F207AA24F0D">
<File Id="filebosctlsvc_EXE" Name="bosct.exe" LongName="bosctlsvc.exe" KeyPath="yes" DiskId="1" />
<ServiceControl Id="TransarcAFSServer" Name="TransarcAFSServer" Stop="both" Remove="both" Wait="yes" />
<File Id="filevolserver_PDB" Name="volse.pdb" LongName="volserver.pdb" DiskId="1" />
<File Id="fileafskill_PDB" Name="afski.pdb" LongName="afskill.pdb" DiskId="1" />
<File Id="fileafssvrcfg_PDB" Name="afssv.pdb" LongName="afssvrcfg.pdb" DiskId="1" />
+ <File Id="fileasetkey_PDB" Name="asetk.pdb" LongName="asetkey.pdb" DiskId="1" />
<File Id="filebosctlsvc_PDB" Name="bosct.pdb" LongName="bosctlsvc.pdb" DiskId="1" />
<File Id="filebosserver_PDB" Name="bosse.pdb" LongName="bosserver.pdb" DiskId="1" />
<File Id="filebuserver_PDB" Name="buser.pdb" LongName="buserver.pdb" DiskId="1" />
<String Id="ActRemoveNsisInstallation">Removing existing installation of OpenAFS</String>
<String Id="StrNsisAbortReason">Installation of OpenAFS for Windows was prematurely terminated because OpenAFS [NSISVERSION] was already installed.</String>
-
+ <String Id="StrUninstallDesc">Uninstall OpenAFS from the local machine.</String>
</WixLocalization>
<Icon Id="ico_Help" src="Icon\ico_Help.ico" />
<Icon Id="ico_ServerManager" src="Icon\ico_ServerManager.ico" />
<Icon Id="ico_afssvrcfg" src="Icon\ico_afssvrcfg.ico" />
+ <Icon Id="ico_OpenAFS" src="Icon\ico_OpenAFS.ico" />
</Include>
--- /dev/null
+# Copyright 2004, OpenAFS.ORG and others.
+# All Rights Reserved.
+#
+# This software has been released under the terms of the IBM Public
+# License. For details, see the LICENSE file in the top-level source
+# directory or online at http://www.openafs.org/dl/license10.html
+
+RELDIR=WINNT\install\wix\uninstall
+!INCLUDE ..\..\..\..\config\NTMakefile.$(SYS_NAME)
+!INCLUDE ..\..\..\..\config\NTMakefile.version
+
+UNINSTALL = $(DESTDIR)\root.client\usr\vice\etc\uninstall.exe
+
+OBJECTS = $(OUT)\uninstall.obj
+
+$(OBJECTS): $$(@B).c
+ $(C2OBJ) $**
+
+$(OUT)\uninstall.res: uninstall.rc AFS_component_version_number.h
+
+$(UNINSTALL): $(OBJECTS) $(OUT)\uninstall.res
+ $(EXECONLINK) msi.lib
+ $(EXEPREP)
+
+install: $(UNINSTALL)
+
+# Cleanup
+clean::
+ -$(DEL) AFS_component_version_number.h
+ -$(DEL) $(OUT)\uninstall.obj
+ -$(DEL) $(OUT)\uninstall.res
+ -$(DEL) $(UNINSTALL)
--- /dev/null
+#define _WIN32_MSI 200
+#include <windows.h>
+#include <msi.h>
+
+#define OAFW_UPGRADE_CODE TEXT("{6823EEDD-84FC-4204-ABB3-A80D25779833}")
+int main(void)
+{
+ UINT rc = ERROR_SUCCESS;
+ DWORD iProduct = 0;
+ CHAR szProductCode[39];
+
+ MsiSetInternalUI(INSTALLUILEVEL_PROGRESSONLY, NULL);
+
+ do {
+ rc = MsiEnumRelatedProducts(OAFW_UPGRADE_CODE, 0, iProduct, szProductCode);
+ if ( rc == ERROR_SUCCESS ) {
+ MsiConfigureProduct(szProductCode, 0 /* ignored */, INSTALLSTATE_ABSENT);
+ iProduct++;
+ }
+ } while ( rc == ERROR_SUCCESS );
+
+ return (rc == ERROR_NO_MORE_ITEMS ? 0 : 1);
+}
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+/* Define VERSIONINFO resource */
+
+#define AFS_VERINFO_FILE_DESCRIPTION "AFS Uninstall Command"
+#define AFS_VERINFO_NAME "uninstall"
+#define AFS_VERINFO_FILENAME "uninstall.exe"
+
+#include "AFS_component_version_number.h"
+#include "..\..\..\..\config\NTVersioninfo.rc"
+
+100 ICON DISCARDABLE "..\Icon\ico_OpenAFS.ico"
\ No newline at end of file
! IF (!EXIST($(OJT)\WINNT\install\wix\custom))
$(MKDIR) $(OJT)\WINNT\install\wix\custom
! ENDIF
+! IF (!EXIST($(OJT)\WINNT\install\wix\uninstall))
+ $(MKDIR) $(OJT)\WINNT\install\wix\uninstall
+! ENDIF
! IF (!EXIST($(OJT)\WINNT\install\Win9x))
$(MKDIR) $(OJT)\WINNT\install\Win9x
! ENDIF