Das Forum

[script] SolidWorks 2007

Autor Antworten
NSLW Wednesday 14 October 2009 at 19:01
NSLW

Hello,
I wrote script which installs SolidWorks 2007. Installation of Service Pack isn't possible
Wine version : 1.1.31
Distribution : Fedora
Distribution Version : 11 (32 bit)
Graphics card : Nvidia, GeForce 9xxx
Drivers of the graphics card : 190.36

Icon for the game:


#!/bin/bash
# Date : (2009-10-14 18-00)
# Last revision : (2009-10-14 18-00)
# Wine version used : 1.1.31
# Distribution used to test : Fedora 11
# Author : NSLW
# Licence : Retail
 
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"

#fetching PROGRAMFILES environmental variable
PROGRAMFILES=`wine cmd /c echo "%ProgramFiles%"`
PROGRAMFILES=${PROGRAMFILES:3}

TYTUL="SolidWorks 2007"
PREFIX="SW2007"

#procedure for patching SolidWorks
patch_SW2007()
{
POL_SetupWindow_browse "Select service pack file" "$TYTUL" ""
POL_SetupWindow_wait_next_signal "Installation in progress..." "$TYTUL"
wine "$APP_ANSWER"
POL_SetupWindow_detect_exit
POL_SetupWindow_message "$LNG_PATCHSUCCES" "$TYTUL"
}

POL_SetupWindow_make_icon_for_shortcut()
{
convert "$HOME/.local/share/icons/$2" -geometry 32X32 "$REPERTOIRE/icones/32/$1"
}

Get_Latest_Wine_Version()
{
cd "$REPERTOIRE/tmp"
POL_SetupWindow_download "Downloading Wine versions list" "$TYTUL" "http://mulx.playonlinux.com/wine/linux-i386/LIST"
if [ ! -e LIST ]; then
	echo "--reset"
else
	xyz=`cat "$REPERTOIRE/tmp/LIST" | sed -e 's/\\.//g' | cut -d';' -f2 | sort -n | tail -n1`
	echo "$(echo $xyz | cut -c1-1).$(echo $xyz | cut -c2-2).$(echo $xyz | cut -c3-4)"
fi
}


wget http://upload.wikimedia.org/wikipedia/en/thumb/f/f1/SolidWorks_logo.png/200px-SolidWorks_logo.png --output-document="$REPERTOIRE/tmp/leftnotscaled.jpeg"
convert "$REPERTOIRE/tmp/leftnotscaled.jpeg" -scale 150x109\\! "$REPERTOIRE/tmp/left.jpeg"
POL_SetupWindow_Init "" "$REPERTOIRE/tmp/left.jpeg"

POL_SetupWindow_presentation "$TYTUL" "Dassault Systèmes" "www.3ds.com" "NSLW" "$PREFIX" 

select_prefix "$REPERTOIRE/wineprefix/$PREFIX"

#asking about service pack
#if [ -e "$REPERTOIRE/configurations/installed/$TYTUL" ]; then
#POL_SetupWindow_menu "What do you want to do?" "Actions" "Apply service pack" "~"

#if [ "$APP_ANSWER" == "Apply service pack" ]; then
#	patch_SW2007
#fi

#POL_SetupWindow_Close
#exit
#fi

#determining which Version is the latest
LATESTVERSION=$(Get_Latest_Wine_Version)
CHOSENWINEVERSION="$LATESTVERSION"
POL_SetupWindow_install_wine "$CHOSENWINEVERSION"
Use_WineVersion "$CHOSENWINEVERSION"

POL_SetupWindow_message "Please insert $TYTUL media into your disk drive."
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "swlauncher.exe"

POL_SetupWindow_prefixcreate

mkdir "$HOME/.winetrickscache"
cd "$HOME/.winetrickscache"
# checking if mfc42 is in wine tricks cache if not then download
if [ ! -e "vc6redistsetup_enu.exe" ]
then
POL_SetupWindow_download "PlayOnLinux is downloading Visual C++ 6 runtime libraries" "Visual C++ 6" "http://download.microsoft.com/download/vc60pro/update/1/w9xnt4/en-us/vc6redistsetup_enu.exe"
fi

# checking if mfc40 is in wine tricks cache if not then download
if [ ! -e "ole2v.exe" ]
then
POL_SetupWindow_download "PlayOnLinux is downloading MFC40" "MFC40" "http://download.microsoft.com/download/ole/ole2v/3.5/w351/en-us/ole2v.exe"
fi

if [ ! -e "wine_gecko-1.0.0-x86.cab" ]
then
POL_SetupWindow_download "PlayOnLinux is downloading Gecko HTML Engine" "Gecko HTML Engine" "http://downloads.sourceforge.net/wine/wine_gecko-1.0.0-x86.cab"
fi

#downloading .NET Framework 2.0
if [ ! -e "$HOME/.winetrickscache/dotnet20/dotnetfx.exe" ]
then
mkdir "$HOME/.winetrickscache/dotnet20"
cd "$HOME/.winetrickscache/dotnet20"
POL_SetupWindow_download "PlayOnLinux is downloading .NET Framework" ".NET Framework 2.0" "http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe"
POL_SetupWindow_download "PlayOnLinux is downloading .NET Framework" ".NET Framework 2.0" "http://kegel.com/wine/l_intl.nls"
fi

cd "$REPERTOIRE/ressources/"
#downloading winetricks
if [ "`sha1sum < winetricks | sed 's/ .*//'`" != "1bc6af44c8584f01d8e3db0abce6ae869b55e1e4" ]; then
wget http://winezeug.googlecode.com/svn/trunk/winetricks --output-document=winetricks
fi

#installing mfc42
POL_SetupWindow_wait_next_signal "Installing Visual C++ 6 runtime libraries..." "$TYTUL"
bash winetricks -q mfc42 mfc40 fontsmooth-enable
POL_SetupWindow_detect_exit

#installing mfc42
POL_SetupWindow_wait_next_signal "Installing MFC40" "$TYTUL"
bash winetricks -q mfc40 fontsmooth-enable
POL_SetupWindow_detect_exit

bash winetricks -q fontsmooth-enable

#installing .NET Framework 2.0
POL_SetupWindow_wait_next_signal "Installing .NET Framework 2.0..." "$TYTUL"
bash winetricks -q dotnet20
POL_SetupWindow_detect_exit

#installing ie6
POL_SetupWindow_wait_next_signal "$LNG_DOWNLOADINGANDINSTALLING Internet Explorer 6\\n\\nPlease be patient ca. 12 MB is being downloaded." "$TYTUL"
bash winetricks -q ie6
POL_SetupWindow_detect_exit

#taking icon from the application
convert "$CDROM/sw.ico" -geometry 32X32 "$REPERTOIRE/icones/32/$TYTUL"

#starting installation
POL_SetupWindow_wait_next_signal "Installation in progress..." "$TYTUL"
cd "$CDROM"
wine "swlauncher.exe"
POL_SetupWindow_message "Click \\"Next\\" when installation will finish." "$TYTUL"

#making shortcut
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/SolidWorks/" "swspmanager.exe" "" "$TYTUL" "" ""
Set_WineVersion_Assign "$CHOSENWINEVERSION" "$TYTUL"
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/SolidWorks/setup/i386" "swlmwiz.exe" "" "$TYTUL - SolidNetWork License Administrator" "" ""
Set_WineVersion_Assign "$CHOSENWINEVERSION" "$TYTUL - SolidNetWork License Administrator"
POL_SetupWindow_make_icon_for_shortcut "$TYTUL - SolidNetWork License Administrator" "bb89_swlmwizard.0.xpm"
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/SolidWorks/setup/i386" "reginfo.exe" "" "$TYTUL - Registration Wizard" "" ""
Set_WineVersion_Assign "$CHOSENWINEVERSION" "$TYTUL - Registration Wizard"
POL_SetupWindow_make_icon_for_shortcut "$TYTUL - Registration Wizard" "bb89_reginfo_d0220928af1811d3aea400c04f79fcdd.0.png"
#cleaning temp
cd "$WINEPREFIX/drive_c/windows/temp/"
rm -rf *
#asking about service pack
#POL_SetupWindow_question "Do you want to apply service pack?" "$TYTUL"
#if [ "$APP_ANSWER" == "TRUE" ] ;then
#patch_SW2007
#fi

POL_SetupWindow_reboot
POL_SetupWindow_message "$TYTUL has been installed successfully" "$TYTUL"

POL_SetupWindow_Close
exit
kvip Friday 11 December 2009 at 18:23
kvipAnonymous

Man so much thanks for that!
I finally managed to run SolidWorks on Linux
and btw it didn't run on friggin vista

Keep up the excellent work!