|
|
Welcome to the Invelos forums. Please read the forum
rules before posting.
Read access to our public forums is open to everyone. To post messages, a free
registration is required.
If you have an Invelos account, sign in to post.
|
|
|
|
Invelos Forums->DVD Profiler: Desktop Technical Support |
Page:
1 Previous Next
|
BUG: Opening another database may cause data corruption |
|
|
|
Author |
Message |
Registered: March 14, 2007 | Reputation: | Posts: 1,029 |
| Posted: | | | | Using Tools -> Options after opening another database will loose track of the newly opened database and may cause corrupted data.
Scenario:
Assume "DB_1" was the database last used. Launch DVD Profiler. This will open the "DB_1" database and will indicate so in the status bar. Click File -> Open Database to open another database "DB_2". Click Tools -> Options. You don't need to change any options, just click OK in the Options dialog. The status bar will revert to "DB_1".
Now it becomes really dangerous.
Some operations, like editing cover images, will now affect "DB_1". Other operations, like editing profiles, will now affect "DB_2".
The only way to be on the safe side is to always exit and restart DVD Profiler after switching databases. | | | Matthias | | | Last edited: by goodguy |
| Registered: March 13, 2007 | Reputation: | Posts: 2,217 |
| Posted: | | | | Quoting goodguy: Quote: Using Tools -> Options after opening another database will loose track of the newly opened database and may cause corrupted data. Confirmed, I can reproduce this. cya, Mithi | | | Mithi's little XSLT tinkering - the power of XML --- DVD-Profiler Mini-Wiki |
| Registered: March 14, 2007 | Reputation: | Posts: 1,029 |
| Posted: | | | | Quoting goodguy: Quote: Using Tools -> Options after opening another database will loose track of the newly opened database and may cause corrupted data. To follow up on my first post. Not only will this happen with the menu command File -> Open Database, but also if the database is opened via a command file. Therefore creating shortcuts to DVD Profiler with various command files to open different databases is currently not a good idea. It may severly mess up your data. | | | Matthias |
| Registered: March 14, 2007 | Reputation: | Posts: 1,029 |
| Posted: | | | | The following script will allow you to safely use shortcuts for starting DVD Profiler with different databases. The script changes the registry setting that indicates the previously used DB *before* launching DVD Profiler and therefore neither needs a command file, nor is it affected by the bug described above. The script does nothing if DVD Profiler is already running. Save the script code as OpenDVDPro.js and create shortcuts to this file (on the Desktop, the Quick Launch Bar, the Start Menu, or wherever you want) for each database you want to open. Change the command line for each shortcut to include the DB name, e.g. c:\MyDir\OpenDVDPro.js Default c:\MyDir\OpenDVDPro.js AnotherDB Quote:
//<SCRIPT>// Turn on syntax colors /* Safely open a database in DVD Profiler. Usage: OpenDVDProDB.js <dbname> You can create shortcuts to this for all your databases. Modifies DVD Profiler's registry settings to point to the desired DB prior to launching the program. This will avoid possible data corruption by a bug in DVD Profiler. It also avoids the start-exit-restart sequence that would be necessary to safely switch to a different database via command file.
See http://www.invelos.com/Forums.aspx?task=viewtopic&topicID=243357 for a description of the bug. Copyright (c) 2008 Matthias Wolf, Germany AKA goodguy */
// Globals var g_szDProReg = "HKCU\\Software\\Invelos Software\\DVD Profiler\\"; var g_szDProTitle = "Invelos Software DVD Profiler"; var g_oWS = new ActiveXObject("WScript.Shell");
main(); function main() { var szDBName, szApp; // Testing for app activation by title *should* be sufficient to detect an already // running DVDPro. if (g_oWS.AppActivate(g_szDProTitle)) abort("DVD Profiler is already running."); if (WScript.Arguments.length != 1) abort("Invalid or missing parameter."); szDBName = String(WScript.Arguments(0)); // Get exe path from registry. If this fails somehow, you have to hardcode it. szApp = g_oWS.RegRead(g_szDProReg + "AppPath"); if (szApp == null || szApp == "") abort("DVD Profiler program path not found."); if (szApp.slice(-1) != "\\") szApp += "\\"; szApp += "dvdpro.exe"; // Write the new DB name to the registry g_oWS.RegWrite(g_szDProReg + "CurrentDatabase", szDBName); // Launch DVDPro g_oWS.Run("\"" + szApp + "\"", 1, false); // 1=WshNormalFocus, nowait }
function abort(sz) { // Display message and die WScript.Echo("*** " + sz); WScript.Quit(255); }
| | | Matthias |
| Registered: March 13, 2007 | Posts: 2,692 |
| Posted: | | | | nice one. Your hard work is Appreciated | | | Paul |
| Registered: June 2, 2007 | Posts: 4 |
| Posted: | | | | Quoting goodguy: Quote: The following script will allow you to safely use shortcuts for starting DVD Profiler with different databases.
The script changes the registry setting that indicates the previously used DB *before* launching DVD Profiler and therefore neither needs a command file, nor is it affected by the bug described above.
The script does nothing if DVD Profiler is already running.
Save the script code as OpenDVDPro.js and create shortcuts to this file (on the Desktop, the Quick Launch Bar, the Start Menu, or wherever you want) for each database you want to open. Change the command line for each shortcut to include the DB name, e.g.
c:\MyDir\OpenDVDPro.js Default c:\MyDir\OpenDVDPro.js AnotherDB
Quote:
//<SCRIPT>// Turn on syntax colors /* Safely open a database in DVD Profiler. Usage: OpenDVDProDB.js <dbname> You can create shortcuts to this for all your databases. Modifies DVD Profiler's registry settings to point to the desired DB prior to launching the program. This will avoid possible data corruption by a bug in DVD Profiler. It also avoids the start-exit-restart sequence that would be necessary to safely switch to a different database via command file.
See http://www.invelos.com/Forums.aspx?task=viewtopic&topicID=243357 for a description of the bug. Copyright (c) 2008 Matthias Wolf, Germany AKA goodguy */
// Globals var g_szDProReg = "HKCU\\Software\\Invelos Software\\DVD Profiler\\"; var g_szDProTitle = "Invelos Software DVD Profiler"; var g_oWS = new ActiveXObject("WScript.Shell");
main(); function main() { var szDBName, szApp; // Testing for app activation by title *should* be sufficient to detect an already // running DVDPro. if (g_oWS.AppActivate(g_szDProTitle)) abort("DVD Profiler is already running."); if (WScript.Arguments.length != 1) abort("Invalid or missing parameter."); szDBName = String(WScript.Arguments(0)); // Get exe path from registry. If this fails somehow, you have to hardcode it. szApp = g_oWS.RegRead(g_szDProReg + "AppPath"); if (szApp == null || szApp == "") abort("DVD Profiler program path not found."); if (szApp.slice(-1) != "\\") szApp += "\\"; szApp += "dvdpro.exe"; // Write the new DB name to the registry g_oWS.RegWrite(g_szDProReg + "CurrentDatabase", szDBName); // Launch DVDPro g_oWS.Run("\"" + szApp + "\"", 1, false); // 1=WshNormalFocus, nowait }
function abort(sz) { // Display message and die WScript.Echo("*** " + sz); WScript.Quit(255); }
Hello, I was directed here by someone else and am trying to have your script work. Unfortunately, I'm not very familiar with Javascript to be able to debug on my own. I've created three databases and created three shortcuts. When I try to run the shortcut I get "Invalid or missing parameter." Any assistance you can provide would be great. Thanks |
| Registered: March 18, 2007 | Reputation: | Posts: 6,463 |
| Posted: | | | | (1) Goodguy has left the Invelos forums. (2) You no longer need this script. Starting DVD Profiler with a specific database is now a command line option. From the HELP Menu (you are not the only one that has overlooked this valuable resource ) Quote:
Startup Parameters DVD Profiler can be launched with one or more of the below startup parameters. To add startup parameters to your DVD Profiler icon, right-click on the icon in the Windows Start menu or Desktop and select "Properties". Enter the desired parameters after the last quote in the "Target" field. Example:
"C:\Program Files\DVD Profiler\dvdpro.exe" /NoSplash
DVD Profiler recognizes the following startup parameters:
/NoSplash Starts DVD Profiler without the splash screen. /CloseExisting Attempts to close any existing running copy of DVD Profiler before launching. /CommandFile=[FileName] Opens and executes commands from the designated file name. See Command Files for details. Example: "C:\Program Files\DVD Profiler\dvdpro.exe" /CommandFile=C:\Commands.txt
Quote:
Command Files Command files are simple text files with a sequential list of commands for DVD Profiler to perform tasks such as backing up your database.
Command files may be executed via either the File->Run Command File... command or by using the startup parameter "/CommandFile".
Command files can be created in any text editor, such as Notepad. Enter one command per line and DVD Profiler will execute each in turn when the command file is run. The following is a list of recognized commands, with associated parameters:
MenuCommand [Command] Executes the main menu command designated by [Command]. Example:
OpenDatabase [Database Name] Opens the selected database by name. Example: OpenDatabase Default
| | | Thanks for your support. Free Plugins available here. Advanced plugins available here. Hey, new product!!! BDPFrog. | | | Last edited: by mediadogg |
| Registered: June 2, 2007 | Posts: 4 |
| Posted: | | | | Quoting mediadogg: Quote: (1) Goodguy has left the Invelos forums. (2) You no longer need this script. Starting DVD Profiler with a specific database is now a command line option.
From the HELP Menu (you are not the only one that has overlooked this valuable resource )
Quote:
Startup Parameters DVD Profiler can be launched with one or more of the below startup parameters. To add startup parameters to your DVD Profiler icon, right-click on the icon in the Windows Start menu or Desktop and select "Properties". Enter the desired parameters after the last quote in the "Target" field. Example:
"C:\Program Files\DVD Profiler\dvdpro.exe" /NoSplash
DVD Profiler recognizes the following startup parameters:
/NoSplash Starts DVD Profiler without the splash screen. /CloseExisting Attempts to close any existing running copy of DVD Profiler before launching. /CommandFile=[FileName] Opens and executes commands from the designated file name. See Command Files for details. Example: "C:\Program Files\DVD Profiler\dvdpro.exe" /CommandFile=C:\Commands.txt
Quote:
Command Files Command files are simple text files with a sequential list of commands for DVD Profiler to perform tasks such as backing up your database.
Command files may be executed via either the File->Run Command File... command or by using the startup parameter "/CommandFile".
Command files can be created in any text editor, such as Notepad. Enter one command per line and DVD Profiler will execute each in turn when the command file is run. The following is a list of recognized commands, with associated parameters:
MenuCommand [Command] Executes the main menu command designated by [Command]. Example:
OpenDatabase [Database Name] Opens the selected database by name. Example: OpenDatabase Default
I did see it, but wasn't sure about it at first. Thank you for clarifying these details. I'll definitely explore this. Much appreciated |
|
|
Invelos Forums->DVD Profiler: Desktop Technical Support |
Page:
1 Previous Next
|
|
|
|
|
|
|
|
|