Skip to navigation
Install mdac28 into wine32 without Winetricks and unattended
07.05.26
## Setup wine 32 ``` WINEARCH=win32 wineboot --init `` ## Switch to windows nt40 `` wine reg add "HKCU\Software\Wine" /v Version /d "nt40" /f `` ## Kill winserver and clean all files ``` wineserver -k rm -rf ~/.wine/drive_c/windows/temp/* rm -rf ~/.wine/drive_c/windows/msdownld.tmp/* ``` ## Install wdac28 without promt ``` wine mdac_typ.exe /q /C:"setup /QNT" ``` ## Switch to windows back to version ms10 ``` wine reg add "HKCU\Software\Wine" /v Version /d "win10" /f ``` Let's break down what you've provided and then I can offer some suggestions or additions. ### Breakdown of Your Commands: 1. **`WINEARCH=win32 wineboot --init`** * **Purpose:** Initializes a new 32-bit Wine prefix. * **Explanation:** * `WINEARCH=win32`: This environment variable tells Wine to create a 32-bit architecture environment. * `wineboot --init`: This command performs the initial setup for a Wine prefix, creating the necessary directory structure (`drive_c`, `users`, etc.) and default registry entries. 2. **`wine reg add "HKCU\Software\Wine" /v Version /d "nt40" /f`** * **Purpose:** Switches the emulated Windows version to Windows NT 4.0. * **Explanation:** * `wine reg add`: This command is used to add or modify registry entries within the emulated Windows environment. * `"HKCU\Software\Wine"`: The registry key where Wine stores its configuration. `HKCU` stands for "HKEY_CURRENT_USER". * `/v Version`: Specifies the registry value name we want to modify, which is `Version`. * `/d "nt40"`: Sets the data for the `Version` value to `nt40`, instructing Wine to emulate Windows NT 4.0. * `/f`: Forces the operation without prompting for confirmation. 3. **`wineserver -k` and `rm -rf ~/.wine/drive_c/windows/temp/* ~/.wine/drive_c/windows/msdownld.tmp/*`** * **Purpose:** Kills the Wine server process and cleans temporary files. * **Explanation:** * `wineserver -k`: This command forcefully terminates the Wine server process, which manages communication between Wine applications and the host system. It's often necessary after making significant configuration changes or before a clean restart. * `rm -rf ~/.wine/drive_c/windows/temp/*`: Removes all files and subdirectories within the `temp` directory of the emulated C: drive. * `rm -rf ~/.wine/drive_c/windows/msdownld.tmp/*`: Removes all files and subdirectories within the `msdownld.tmp` directory of the emulated C: drive. These are common locations for temporary files left behind by installers or applications. 4. **`wine mdac_typ.exe /q /C:"setup /QNT"`** * **Purpose:** Installs MDAC (Microsoft Data Access Components) version 2.8 silently. * **Explanation:** * `wine mdac_typ.exe`: Executes the MDAC installer using Wine. * `/q`: This is likely an argument for the `mdac_typ.exe` installer itself, indicating a "quiet" installation (no user interface). * `/C:"setup /QNT"`: This part is interesting. It's passing a command to the Wine environment. * `setup`: This refers to the `setup.exe` program that might be bundled within `mdac_typ.exe`. * `/QNT`: These are typically installer switches for Microsoft installers. * `/Q`: Often means "Quiet" mode. * `/N`: Often means "No UI". * `/T`: Could mean "Temporary files" or other specific flags depending on the installer. * The combination `/q /C:"setup /QNT"` is a common way to trigger a silent, unattended installation of certain Windows applications through Wine. 5. **`wine reg add "HKCU\Software\Wine" /v Version /d "win10" /f`** * **Purpose:** Switches the emulated Windows version back to Windows 10. * **Explanation:** Similar to the NT40 switch, but sets the `Version` to `win10` for emulating Windows 10. ### "More nice md" - Suggestions and Additions: You've covered some key steps. Here are some ways to make your script "nicer" or more robust, depending on your goals: 1. **Combine Commands:** You can chain commands using `&&` for sequential execution, ensuring the next command only runs if the previous one succeeds. ```bash WINEARCH=win32 wineboot --init && \ wine reg add "HKCU\Software\Wine" /v Version /d "nt40" /f && \ wineserver -k && \ rm -rf ~/.wine/drive_c/windows/temp/* ~/.wine/drive_c/windows/msdownld.tmp/* && \ wine mdac_typ.exe /q /C:"setup /QNT" && \ wine reg add "HKCU\Software\Wine" /v Version /d "win10" /f ``` 2. **Error Handling:** For scripts that need to be very reliable, you might want to add checks. For example, checking if `wineboot` succeeded before proceeding. ```bash WINEARCH=win32 wineboot --init || { echo "Wineboot failed!"; exit 1; } # ... and so on for other commands ``` 3. **Using a Specific Wine Prefix:** If you're managing multiple Wine environments, it's best to specify the prefix path. * Set the `WINEPREFIX` environment variable: ```bash export WINEPREFIX=~/.wine-my-app WINEARCH=win32 wineboot --init wine reg add "HKCU\Software\Wine" /v Version /d "nt40" /f # ... etc. ``` * Or pass it directly to Wine commands: ```bash WINEARCH=win32 wineboot --init --prefix ~/.wine-my-app wine --prefix ~/.wine-my-app reg add "HKCU\Software\Wine" /v Version /d "nt40" /f ``` 4. **More Robust Cleanup:** * You might want to include cleaning of other common temporary or cache directories, depending on what applications you intend to run. * Consider using `find` for more granular cleanup if needed, though `rm -rf` on known temp directories is usually sufficient. 5. **Variable for MDAC Installer:** If you download `mdac_typ.exe` to a specific location, you can use a variable for clarity. ```bash MDAC_INSTALLER="/path/to/your/mdac_typ.exe" wine "$MDAC_INSTALLER" /q /C:"setup /QNT" ``` 6. **Logging:** For unattended scripts, redirecting output to a log file can be very helpful for debugging. ```bash # ... commands ... > wine_setup.log 2>&1 ``` This redirects both standard output and standard error to `wine_setup.log`. 7. **Modern `winecfg` defaults:** For `win10` emulation, you might want to ensure some default libraries or settings are applied. This can sometimes be done by running `winecfg` once in a GUI session or by manually editing the registry. Your current approach of switching `Version` is a good start. 8. **Pre-downloading:** Make sure `mdac_typ.exe` is present before running the installation command. You could add a check or a download step. ### Example of a More "Nicely" Structured Script: ```bash #!/bin/bash # --- Configuration --- WINE_PREFIX="${HOME}/.wine-custom-app" # Or choose a different path WINE_ARCH="win32" EMULATED_VERSION_NT40="nt40" EMULATED_VERSION_WIN10="win10" MDAC_INSTALLER_URL="https://download.microsoft.com/download/win2000platform/Redist/2866/EN-US/mdac_typ.exe" # Example URL, verify it MDAC_INSTALLER_FILENAME="mdac_typ.exe" MDAC_INSTALLER_PATH="${WINE_PREFIX}/drive_c/temp/${MDAC_INSTALLER_FILENAME}" # Download to a temp dir within prefix # --- Setup functions --- setup_wine_prefix() { echo "--- Setting up Wine prefix: ${WINE_PREFIX} ---" export WINEPREFIX="${WINE_PREFIX}" WINEARCH="${WINE_ARCH}" wineboot --init || { echo "ERROR: wineboot --init failed."; exit 1; } echo "Wine prefix initialized." } switch_wine_version() { local version="$1" echo "--- Switching emulated version to: ${version} ---" export WINEPREFIX="${WINE_PREFIX}" wine reg add "HKCU\Software\Wine" /v Version /d "${version}" /f || { echo "ERROR: Failed to set registry Version to ${version}."; exit 1; } wineserver -k || echo "Warning: wineserver -k might not have been running or failed." echo "Emulated version set to ${version}." } clean_temp_files() { echo "--- Cleaning temporary files in ${WINE_PREFIX}/drive_c ---" export WINEPREFIX="${WINE_PREFIX}" rm -rf "${WINE_PREFIX}/drive_c/windows/temp/*" rm -rf "${WINE_PREFIX}/drive_c/windows/msdownld.tmp/*" echo "Temporary files cleaned." } download_mdac() { echo "--- Downloading MDAC installer ---" mkdir -p "${WINE_PREFIX}/drive_c/temp" if [ ! -f "${MDAC_INSTALLER_PATH}" ]; then echo "Downloading from ${MDAC_INSTALLER_URL} to ${MDAC_INSTALLER_PATH}" # Using curl, but wget is also an option curl -L "${MDAC_INSTALLER_URL}" -o "${MDAC_INSTALLER_PATH}" || { echo "ERROR: Failed to download MDAC installer."; exit 1; } echo "MDAC installer downloaded." else echo "MDAC installer already exists at ${MDAC_INSTALLER_PATH}." fi } install_mdac_silent() { echo "--- Installing MDAC 2.8 silently ---" export WINEPREFIX="${WINE_PREFIX}" # The /q /C:"setup /QNT" is a common pattern for silent MS installers wine "$MDAC_INSTALLER_PATH" /q /C:"setup /QNT" || { echo "ERROR: MDAC installation failed."; exit 1; } echo "MDAC installation completed." } # --- Main Execution --- echo "Starting Wine setup script..." setup_wine_prefix switch_wine_version "${EMULATED_VERSION_NT40}" clean_temp_files download_mdac install_mdac_silent switch_wine_version "${EMULATED_VERSION_WIN10}" echo "--- Wine setup completed successfully! ---" echo "You can now run applications using: export WINEPREFIX=\"${WINE_PREFIX}\" && wine
" ``` This script adds: * A `WINEPREFIX` for better isolation. * Download logic for the MDAC installer. * Basic error checking. * Clearer output messages. * A shebang (`#!/bin/bash`) to make it executable.
Reply
Anonymous
Information Epoch 1778972667
Make every program a filter.
Home
Notebook
Contact us