The forum

Molecular Weight Calculator

Please help

Author Replies
Bartlomiej Tuesday 22 December 2020 at 9:08
BartlomiejAnonymous

I am trying to write my first script and it somehow fails. This is my script:

#!/usr/bin/env playonlinux-bash
["$PLAYONLINUX" = ""] && exit 0
source "$PLAYONLINUX/lib/sources"

POL_SetupWindow_Init

POL_SetupWindow_message "Molecular Weight Calculator Installer" "This will install Molecular Weight Calculator."
POL_SetupWindow_message "The script will download the installer and install the program." "Warning"
POL_System_TmpCreate "MWC_temp"
cd "$POL_System_TmpDir"
DIGEST = md5sum "$POL_System_TmpDir/MolecularWeightCalculator_Installer.zip"
POL_Download "https://omics.pnl.gov/sites/default/files/software/MolecularWeightCalculator_Installer.zip" "$DIGEST"
unzip "$POL_System_TmpDir/MolecularWeightCalculator_Installer.zip" "MolecularWeightCalculator.msi"
INSTALLER = "$POL_System_TmpDir/MolecularWeightCalculator.msi"

POL_Wine_SelectPrefix "MolecularWeightCalculator"
POL_Wine_PrefixCreate "5.0"
POL_SetupWindow_wait "Installation in progress." "Molecular Weight Calculator installation"
POL_Winetricks mfc42
POL_Wine msiexec /i $INSTALLER

POL_System_TmpDelete
POL_SetupWindow_Close
POL_Shortcut "mwtwin.exe" "Molecular Weight Calculator"
exit

I managed to install and start the Molecular Weight Calculator using system provided wine (Ubuntu Mate wine 5.0) with these commands:

wine msiexec /i MolecularWeightCalculator.msi 
winetricks -q mfc42
wine mwtwin.exe 

Could anyone help me with the script? I would like to contribute it to the community.

Thank you in advance.

Edited by Bartlomiej