Menu

Batch file to set Win95 version lie.

2023-06-25
2023-06-25
  • dippy dipper

    dippy dipper - 2023-06-25

    Not directly related to Dxwnd but seeing as many old CD-ROM game installers require Windows 95 version lie to work I gobbled up this batch file. On Windows 10 and 11 it seems to be especially troublesome since simply setting the full win95 comp layer from the exe properties no longer seems to work.

    Full credit to these posts from where I got the samples:
    https://stackoverflow.com/questions/4051883/batch-script-how-to-check-for-admin-rights
    https://stackoverflow.com/questions/15885132/file-folder-chooser-dialog-from-a-windows-batch-script

    The batch file checks whether it is run with admin rights and exists if not. So you need to right click on it and select "Run as Admin" (admin rights are necessary for the win95 version lie to function in all circumstances). It then opens a file dialog and you can navigate to the setup.exe of the old installer you want to run. Then it should enable the Win95 version lie and allow the setup to run.

    For example this should work with regular 32-bit installers and 16-bit installers that are run through otvdm (winevdm).

    This is also probably useful only for current Windows versions (Win10 and 11).

    <# : win95lie.cmd
    :: launches a File... Open sort of file chooser and outputs choice(s) to the console
    
    @echo off
    setlocal
    
    color 3F
    
    TITLE Run with Windows 95 version lie ACT layer
    
    goto check_Permissions
    
    :check_Permissions
    echo Administrative permissions required. Detecting permissions...
    
    net session >nul 2>&1
    if %errorLevel% == 0 (
        echo Success: Administrative permissions confirmed.
    ) else (
        echo Failure: Current permissions inadequate.
        pause
        exit
    )
    
    for /f "delims=" %%I in ('powershell -noprofile "iex (${%~f0} | out-string)"') do (
        set __COMPAT_LAYER=Layer_Win95VersionLie
        start %%~I
    )
    goto :EOF
    
    : end Batch portion / begin PowerShell hybrid chimera #>
    
    Add-Type -AssemblyName System.Windows.Forms
    $f = new-object Windows.Forms.OpenFileDialog
    $f.InitialDirectory = [Environment]::GetFolderPath('MyDocuments')
    $f.Filter = "Executable Files (*.exe)|*.exe|All Files (*.*)|*.*"
    $f.ShowHelp = $true
    $f.Multiselect = $true
    [void]$f.ShowDialog()
    if ($f.Multiselect) { $f.FileNames } else { $f.FileName }
    

    edit: Set the InitialDirectory to MyDocuments instead of the default that was the System32 folder.

    edit2: Layer_Win95VersionLie not Win95 typo fixed.

     

    Last edit: dippy dipper 2023-06-25
  • BEEN_Nath_58

    BEEN_Nath_58 - 2023-06-25

    Windows 10 in most cases won't even need this, I probably documented it in 2020, but Win11 is more difficult to use. On Win11, tried with InstallShied games that need the Windows 95 setting from control panel, crashes...

    Note that the direct Windows 95 compatibility layer, set using _COMPAT_LAYER=Win95

    will crash InstallShield installers on Win11.

    Edit: Oh I see you used that, its not gonna help Win11 anyways.

     

    Last edit: BEEN_Nath_58 2023-06-25
    • dippy dipper

      dippy dipper - 2023-06-25

      Note that the direct Windows 95 compatibility layer, set using _COMPAT_LAYER=Win95

      will crash InstallShield installers on Win11.

      Damnit... "Layer_Win95VersionLie" is what was supposed to read there. Typo fixed.

      Windows 10 in most cases won't even need this

      Windows 10 needs it here. I think some of the updates changed it.

       

      Last edit: dippy dipper 2023-06-25
      • BEEN_Nath_58

        BEEN_Nath_58 - 2023-06-25

        Damnit... "Layer_Win95VersionLie" is what was supposed to read there. Typo fixed.

        Great, this one works. Actually WineVDM already does this, I asked for it last year and it was granted

        https://github.com/otya128/winevdm/issues/1259

        Windows 10 needs it here. I think some of the updates changed it.

        What I devised was, to have Windows 95 compatibility from Properties on the Autorun program, since they were made for those times and would work, then I would launch setup from there since compatibility modes are inheerited in son processes.

        This one is better than the isfix link I posted, that won't run applications such as the Hellbender setup.

        It works on Win7 too, so it should work on WinVista as well I suppose

         

        Last edit: BEEN_Nath_58 2023-06-25
        • dippy dipper

          dippy dipper - 2023-06-25

          Great, this one works. Actually WineVDM already does this, I asked for it last year and it was granted

          One could also install custom "Layer_Win95VersionLie" ACT fixes for otvdm.exe and otvdmw.exe for a more "permanent" solution. This could also be automated for winevdm by supplying it with .sdb file together with an installer and uninstaller batch file. At first glance the "installshieldfix" seems to me like a rather complicated solution when the MS ACT Fixes can manage the situation. But I did not look into it too much...

          edit:
          Oh! I see the installshieldfix for winevdm/otvdm does more by fixing some possible install program hang issue. So I guess it needs to be more complex then.

           

          Last edit: dippy dipper 2023-06-25
  • dippy dipper

    dippy dipper - 2023-06-25

    Of course the set __COMPAT_LAYER=Layer_Win95VersionLie line can be edited as needed. Combinations of layers is also possible separated by spaces. It's the same as running the commands manually through the cmd prompt.

     

Log in to post a comment.