OK this is what I want you to do.
****if there are any errors during any of this do not continue the process. Let me know what the error is that you have received***
create a macro and add the python script action to it.
paste the code below into the script
Code: Select all
import os
import shutil
import subprocess
import threading
def do():
print 'This may take a while to run.'
print 'Please be patient and do not close EG'
print 'or any command prompt windows that open'
def check_net():
command = 'PowerShell -ExecutionPolicy ByPass -Command "[environment]::Version"'
proc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = proc.communicate()
out = list(line for line in out.split('\r\n') if line.strip())
err = list(line for line in err.split('\r\n') if line.strip())
if err:
print '\n'.join(err)
return None
return int(out[2].split(' ', 1)[0])
print 'Checking .NET version attached to PowerShell'
net_ver = check_net()
if net_ver is None:
print 'exiting backup'
eg.globals.backup_thread = None
return
if net_ver != 4:
ans = raw_input(
'PowerShell is using .NET version {0},\n'
'we need it to be running version 4\n\n'
'Would you like to upgrade it to .NET\n'
'version 4? (y, n)'.format(net_ver)
)
if ans.lower() == 'n':
eg.globals.backup_thread = None
print 'exiting backup'
return
power_shell_cfg =[
'<?xml version="1.0"?>',
'<configuration>',
' <startup useLegacyV2RuntimeActivationPolicy="true">',
' <supportedRuntime version="v4.0.30319"/>',
' <supportedRuntime version="v2.0.50727"/>',
' </startup>',
'</configuration>'
]
power_shell_cfg = '\r\n'.join(power_shell_cfg)
ps_path = r'C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.Exe.Config'
if os.path.exists(ps_path):
os.rename(ps_path, ps_path + '.backup')
with open(ps_path, 'w') as f:
f.write(power_shell_cfg)
print 'Verifying that .NET version change was sucessful'
net_ver = check_net()
if net_ver is None:
print 'exiting backup'
eg.globals.backup_thread = None
return
if net_ver != 4:
print 'ERROR: unable to upgrade to .net version 4'
print 'exiting backup'
eg.globals.backup_thread = None
return
print 'PowerShell .NET version change sucessful'
else:
print 'PowerShell .NET version is 4'
print 'Copying files'
eg.config.Save()
output_path = os.path.expandvars(r'%userprofile%\desktop\eventghost_backup')
if os.path.exists(output_path):
print 'temp file path already exists', output_path
print 'exiting backup'
eg.globals.backup_thread = None
return
os.mkdir(output_path)
eg.document.Save()
app_dst = os.path.join(output_path, 'application')
appdata_dst = os.path.join(output_path, 'appdata')
programdata_dst = os.path.join(output_path, 'programdata')
save_file_dst = os.path.join(output_path, os.path.split(eg.document.filePath)[-1])
app_src = eg.mainDir
appdata_src = eg.configDir
programdata_src = os.path.abspath(os.path.join(eg.localPluginDir, '..'))
save_file_src = eg.document.filePath
print app_src, ' --> ', app_dst
shutil.copytree(app_src, app_dst)
print app_src, ' --> ', app_dst, 'COMPLETE'
print appdata_src, ' --> ', appdata_dst
shutil.copytree(appdata_src, appdata_dst)
print appdata_src, ' --> ', appdata_dst, 'COMPLETE'
print programdata_src, ' --> ', programdata_dst
shutil.copytree(programdata_src, programdata_dst)
print programdata_src, ' --> ', programdata_dst, 'COMPLETE'
print save_file_src, ' --> ', save_file_dst
shutil.copyfile(save_file_src, save_file_dst)
print save_file_src, ' --> ', save_file_dst, 'COMPLETE'
print 'Compressing files'
zip_file = os.path.abspath(
os.path.join(output_path, '..')
)
zip_file = os.path.join(zip_file, 'eg_backup.zip')
if os.path.exists(zip_file):
ans = raw_input(
'a backup file already exists ({0})\n\n'
'Would you like to overwright the file (y/n)?'.format(zip_file)
)
if ans.lower() == 'n':
shutil.rmtree(output_path)
print 'exiting backup'
eg.globals.backup_thread = None
return
os.remove(zip_file)
print output_path, ' --> ', zip_file
command = (
'PowerShell '
'-ExecutionPolicy ByPass '
'-Command "'
'Add-Type -Path C:\\Windows\\Microsoft.NET\\assembly\\GAC_MSIL\\System.IO.Compression\\v4.0_4.0.0.0__b77a5c561934e089\\System.IO.Compression.dll;\r\n'
'Add-Type -Path C:\\Windows\\Microsoft.NET\\assembly\\GAC_MSIL\\System.IO.Compression.FileSystem\\v4.0_4.0.0.0__b77a5c561934e089\\System.IO.Compression.FileSystem.dll;\r\n'
'Add-Type -Path C:\\Windows\\Microsoft.NET\\assembly\\GAC_MSIL\\System.IO.Compression.ZipFile\\v4.0_4.0.0.0__b77a5c561934e089\\System.IO.Compression.ZipFile.dll;\r\n'
"[System.IO.Compression.ZipFile]::CreateFromDirectory('{0}', '{1}', [System.IO.Compression.CompressionLevel]::Optimal, $false);".format(output_path, zip_file)
)
proc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = proc.communicate()
out = list(line for line in out.split('\r\n') if line.strip())
err = list(line for line in err.split('\r\n') if line.strip())
if err:
print '\n'.join(err)
shutil.rmtree(output_path)
print output_path, ' --> ', zip_file, 'FAILED'
print 'FAILED'
else:
print '\n'.join(out)
shutil.rmtree(output_path)
print 'backup is located', zip_file
print 'FINISHED'
eg.globals.backup_thread = None
eg.globals.backup_thread = getattr(eg.globals, 'backup_thread', None)
if eg.globals.backup_thread is not None:
print 'backup already running'
print 'exiting'
eg.Exit()
eg.globals.backup_thread = threading.Thread(target=do)
eg.globals.backup_thread.start()
click on the apply button then click on the test button.
this is going to backup eventghost. It will backup all of it. It is going to make a file on your desktop called eg_backup.zip.
once that is finished (it can take a while) close EG
Verify the backup exists. open the zip file and make sure you see 3 folders and your save file in there. you can navigate the zip file to make sure it backed up everything if you like.
Once the backup has been verified go to
Start --> Control Panel --> Add Remove Programs
locate EventGhost and uninstall it.
Once it is finished doing the uninstall we are going to do some cleanup.
open up File Explorer (Windows Explorer)
in the address bar type in
press enter
If there is a folder "EventGhost" I want you to delete it.
In the address bar type in
press enter
If there is a folder "EventGhost " I want you to delete it
in the address bar type in
If there is a folder "EventGhost " I want you to delete it
This has completely removed EventGhost from your system.
I now want you to download EventGhost from the link below and install it.
https://github.com/EventGhost/EventGhos ... v0.5.0-rc6
once that is finished then download the WinUSB addon and install it.
http://www.eventghost.net/downloads/Eve ... Add-on.zip
Start EventGhost.
create a new save file
File --> New
Then save the empty save file
File --> Save As
Close EventGhost
open a command prompt
type in the command below
Code: Select all
xcopy "c:\program files (x86)\eventghost\drivers" %programdata%\eventghost\drivers\ /E/H
Once that has finished then open up EventGhost again.
Install the plugin. Any errors you get while the plugin is installing please paste them to me.
This is going to set up a baseline for us to make sure that there is nothing that could be causing a problem anywhere.
Rest assured there is a backup and we can always restore that backup in whole or parts of it if necessary.