Jump to content
Sign in to follow this  
stiddlefix

How to run Dune Emperor Windows 10 with mounted iso

Recommended Posts

stiddlefix    0

Hi
I want to share how I  get Dune Emperor Running without swapping CD's using Windows 10

Its a little advanced as I am gong to explain how to mount .iso file's  using a script so that all the work to setup is one time

and you can then just play the game anytime you want  (it will mount all 4 disks and update the resource file correctly)

 First properly install dune onto windows 10
1. get the Install Fix patch from the fed2k site and use it to fully install Dune Emperor - do not change the location it installs (c:\westwood) just leave it to install how it wants to
You will be using Windows 10 built in support for mounting virtual disks (earlier windows versions may work) .
2. You will need to make an .iso image from all the four disks (windows 10 cant do this - so use free 'infraRecorder' to do it   (find it on google) (hint :- Actions menu,Copy Disc,To Disc image will do the job)
Name each image file name exactly these following names respectively for disks 1 to 4
Emperor1.iso
Atreides2.iso
Harkonnen3.iso
Ordos4.iso

they must be named exactly that  - put all the 4 .iso files in one folder. in the same folder  open notepad and save with the filename    start emperor.ps1  this can be any name as long as it ends in .ps1

 paste the following script into   start emperor.ps1 and save it in the same folder as the .iso files

Paste the following into notepad : -

  

#first sort out the working Directory of this script in case its launched from a shortcut i still want it to work
$ThisFolder =Split-Path -Parent -Path $MyInvocation.MyCommand.Definition
CD $ThisFolder
# this function will dismount ISO images provided. upon a succesful dismount it will check if another copy of the same is mounted and dismount that one too. (this will continue for a max of 10 dismounts of the same image) 
# it will exit once there are no matching images to dismount or if it has tried more than 10 times.
cd|Convert-Path .
function dismountThis($imagetoeject){
$ismounted = "true"
$maxtries = 0
Do{
if ((Get-DiskImage -ErrorAction SilentlyContinue -ImagePath $imagetoeject).DevicePath) {dismount-diskimage -imagepath $imagetoeject} else {$ismounted = "false"}
$maxtries = $maxtries +1
sleep -Milliseconds 100
if ($maxtries -gt 10) { $ismounted = "false"}
}
until( $ismounted -eq "false")
}
#------------------------------------------------------------------ end of functions -----------------------------------------------------------------------------
# first lets dismount all four of the Emperor disk images - this script needs to be in the same folder as the ISO's
$ThisFolder = Convert-Path .
dismountThis($ThisFolder + "\Emperor1.iso")
dismountThis($ThisFolder + "\Atreides2.iso")
dismountThis($ThisFolder + "\Harkonnen3.iso")
dismountThis($ThisFolder + "\Ordos4.iso")
# now mount all four of the Emperor disk images
sleep -Milliseconds 250
mount-diskimage  -imagepath ($ThisFolder + "\Emperor1.iso")
sleep -Milliseconds 250
mount-diskimage  -imagepath ($ThisFolder + "\Harkonnen3.iso")
sleep -Milliseconds 250
mount-diskimage  -imagepath ($ThisFolder + "\Atreides2.iso")
sleep -Milliseconds 250
mount-diskimage  -imagepath ($ThisFolder + "\Ordos4.iso")

#edit the resource file with the drive that has been mounted
$installfolder = "C:\Westwood\Emperor\"
$resourcecfg=$installfolder+"resource.cfg"
#The following function edits the resource.cfg file of Dune Emperor changing the Cd and movie paths to 
# the drive letter of the correct virtual CDROM that has been previously mounted 
Function updatefile { 
param ([array]$EmpMount,[string]$CDd,[string]$Md)
$drive=$EmpMount[0].DeviceID
#now $drive contains the previously mounted emperor disk - we will now replace the correct CD path with this
$seekMe='(?m)(.*)^'+$CDd+'[\r\n]+.:.'
$Replaceme=$CDd+[char][int]13+[char][int]10+$drive+"\"
(get-content -raw $resourcecfg) |foreach-object {$_ -replace $seekMe,$Replaceme} |set-content $resourcecfg
# and lastly the Movie path
$seekMe='(?m)(.*)^'+$Md+'[\r\n]+.:.'
$Replaceme=$Md+[char][int]13+[char][int]10+$drive+"\"
(get-content -raw $resourcecfg) |foreach-object {$_ -replace $seekMe ,$Replaceme} |set-content $resourcecfg 
Write-Host "We replaced" $drive "into " $CDd "and " $Md $lines
}
#lets do disk 1 first
$CDdrive="CD1"
$Mdrive="MOVIES1"
$EmpMounts=(Get-WmiObject Win32_LogicalDisk -filter "VolumeName='Emperor1'")
if ($EmpMounts -ne $null) {
updatefile $EmpMounts $CDdrive $Mdrive
}
#now disk 2
$CDdrive="CD2"
$Mdrive="MOVIES2"
$EmpMounts=(Get-WmiObject Win32_LogicalDisk -filter "VolumeName='Emperor2'")
if ($EmpMounts -ne $null) {
updatefile $EmpMounts $CDdrive $Mdrive
}
#and disk 3
$CDdrive="CD3"
$Mdrive="MOVIES3"
$EmpMounts=(Get-WmiObject Win32_LogicalDisk -filter "VolumeName='Emperor3'")
if ($EmpMounts -ne $null) {
updatefile $EmpMounts $CDdrive $Mdrive
}
#final edit is disk 4
$CDdrive="CD4"
$Mdrive="MOVIES4"
$EmpMounts=(Get-WmiObject Win32_LogicalDisk -filter "VolumeName='Emperor4'")
if ($EmpMounts -ne $null) {
updatefile $EmpMounts $CDdrive $Mdrive
}
# tidy up the resource file length
foreach ($LINE in $(Get-Content $resourcecfg))  {  if ("$LINE$LAST_LINE" -ne "") {$filestring=$filestring+$LINE+"`r`n"} ; $LAST_LINE = $LINE}
set-content $filestring -path $resourcecfg
Write-Host "Here we go"
Remove-Variable filestring
Remove-Variable EmpMounts
Remove-Variable CDdrive
Remove-Variable Mdrive

#Run the game
$installfolder = "C:\Westwood\Emperor\"
$executablefile = "EMPEROR.EXE"
&($installfolder+$executablefile)

As said before save this file as start emperor.ps1 and save it in the same folder as the .iso files

Thats all the installation complete

 

RUNNING THE GAME
 Open the folder with the iso's and find the start emperor.ps1 file using windows explorer,  Right click the start emperor.ps1 file and select 'run with powershell'

you will see each .iso disk get unmounted then mounted as  4 new drives, the resource editing will briefly report progress to the script window that opens and the game will then start

the game will now run without requests for disk mounts

(This script is all my own work)

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×