Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit 8c1e552

Browse files
Merge pull request #5 from thecreativeone91/DVDFabAutoRip2.2beta2
Update DVDFab.ps1
2 parents 6595387 + 9c7a5f3 commit 8c1e552

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

DVDFab.ps1

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
### DVDFab AutoCloning Script ###
2-
### Update 7/14/2021 ###
1+
### DVDFab AutoCloning Script v2.2 Final ###
2+
### Updated 8/15/2021 ###
33
### Requires DVDFab and a UHD Friendly Drive to Clone Blu ray Discs ###
44
### ".\DVDFab.ps1 - Install" must be running as administrator to Install ###
55
### Be Sure to Set the DVDFab Variables for your enviroment ###
@@ -10,7 +10,8 @@
1010
###
1111
Param(
1212
#[Parameter(Mandatory=$false)]
13-
[Switch]$Install
13+
[Switch]$Install,
14+
[Switch]$LiveUpdate
1415
)
1516
if($Install){
1617
Write-Host 'Please Wait.. Installing DVDFabAutoRip Service'
@@ -42,6 +43,16 @@ Start-Sleep -Seconds .5
4243
& $nssm status $ServiceName
4344
Write-Host 'Service is now installed'
4445
Return}
46+
if($LiveUpdate){
47+
#kill LiveUpdate.exe which will prevent process from looping if an update is found
48+
Start-Sleep -Seconds 45
49+
Write-Host "Ending Liveupdate.exe"
50+
Stop-Process -Name LiveUpdate
51+
#Delay incase we missed LiveUpdate the first try
52+
Start-Sleep -Seconds 60
53+
Write-Host "Ending Liveupdate.exe"
54+
Stop-Process -Name LiveUpdate
55+
Return}
4556
#Normal Script
4657
#loop
4758
While($true)
@@ -63,10 +74,11 @@ $DVDLabel= Get-Volume -DriveLetter D| % FileSystemLabel
6374
#Set Destination Folder
6475
$Dest="`"E:\Videos\Movies\$DVDLabel.iso`""
6576
#Check If DVD is in Drive and start DVDFab Cloning, waiting for process to end
66-
6777
If ($Media -eq $true) {
6878
#Print That Drive is Ripping, Lauch DVDFab and Wait for DVDFab to close
6979
Write-Host 'Media is in Drive, Starting DVDFab Rip';
80+
## Launch Script with switch to end LiveUpdate, in it's own session
81+
Start-Process Powershell.exe -Argumentlist "-file $PSScriptRoot\DVDFab.ps1 -LiveUpdate"
7082
## Close Staticly set, not a Variable as the process will not work automacitly if DVDFab is not ending it's process
7183
### It's also required to be able to run as a service, as we can no longer interact with applications running as a service
7284
Start-Process $DVDFab -Wait -ArgumentList ('/Mode',$Mode,'/SRC',$DVD,'/DEST',$Dest,'/CLOSE')

0 commit comments

Comments
 (0)