0

I'd like to know how I can set up a way to verify that the installation directory is FAT/FAT32/exFAT/any USB without USN Journal.

I assume it's something here: Image

I couldn't find any documentation on what I'm trying to do. I'd try to add some support in my program directly, but by doing the check, it may cause issues.

πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190
Cryptoman
  • 63
  • 1
  • 6
  • Did the battle with the file system go well? NTFS seems to be the file system where everything is possible and nothing is (all that) easy. – Stein Åsmul Aug 02 '18 at 20:43

1 Answers1

0

First things first: Visual Studio Setup Projects are quite limited, you might be better off looking for a more capable deployment tool / framework: Application setup.


NTFS Only: That sounds pretty exotic. It isn't even possible to install Windows on anything but NTFS nowadays? From superuser.com: "Windows Vista and higher will not install on a FAT32 partition and can only be installed on an NTFS partition. This is probably due to the use of symlinks (which are not supported in FAT32)." I don't have an MSDN link for you to verify, but I am pretty sure the above is correct.


Built-In MSI Feature: It is possible that there is a built in property in MSI that will be set to the system drive's file system. I am not familiar with any such properties.

Custom Action: If you are on Windows XP, I suppose you need a custom action and then a call to either WMI or directly via the Win32 API to determine what the file system really is.

Win32: An answer with some sample mock-up code for a Win32 check of file system: Determine what filesystem a partition is of. An inline version tested with VS2017, C++ console project:

#include "stdafx.h"
#include "Windows.h"
#define WIN32_LEAN_AND_MEAN // Exclude rarely used stuff from Windows.h (Crypto stuff?)

int main()
{
    WCHAR FSType[512];

    if (GetVolumeInformationW(L"C:\\", NULL, 0, NULL, NULL, NULL, FSType, ARRAYSIZE(FSType))) {
        MessageBox(NULL, FSType, L"File System:", MB_OK); 
        // TEXT("File System:") instead of L"File System:" if need be?
    }
}

WMI: You should be able to get the information from Win32_LogicalDisk:

SELECT FileSystem FROM Win32_LogicalDisk WHERE DeviceID='C:'

FileSystemObject: I forgot that the COM scripting runtime can be used:

Set fso = CreateObject("Scripting.FileSystemObject")
Set drive = fso.GetDrive(fso.GetDriveName("C:"))
MsgBox drive.FileSystem
Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • I'm trying to prevent the installation from proceeding if the selected drive is NTFS. I don't support WinXP. – Cryptoman Aug 01 '18 at 23:58
  • @Cryptoman: You've got it backward. Not proceeding on NTFS will prevent you from using anything *except* Windows XP, because Vista and on **only use** NTFS. – Ken White Aug 02 '18 at 00:07
  • Seeing as NTFS is required for the system drive from Vista onwards, do you then install to a secondary partition? Or do you install to a USB drive? In the latter case I would think you don't really need an installer? Maybe just a zip? Or a custom EXE that writes the USB key specifically. – Stein Åsmul Aug 02 '18 at 00:07
  • @KenWhite I understand now. Either way, don't worry: my program will work on anything with USN Journal disabled. – Cryptoman Aug 02 '18 at 00:09
  • @SteinÅsmul Just install on a USB. We do need an installer. – Cryptoman Aug 02 '18 at 00:10
  • [**I would check the links this guy provides**](https://stackoverflow.com/a/27593415/129130). Maybe search [**github.com**](http://www.github.com) for an example using these calls. – Stein Åsmul Aug 02 '18 at 00:12