It is currently Tue Sep 30, 2014 4:04 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: .bat launcher for ImgBurn...
PostPosted: Mon Mar 15, 2010 4:47 pm 
Offline

Joined: Wed Sep 05, 2007 8:42 pm
Posts: 126
Here's a simple .bat launcher for ImgBurn. Its advantage is that, not only does it launch ImgBurn with the "/portable" parameter, but you can associate filetypes with the .bat (like *.iso, etc.) using eXpresso/C.A.F.E./Coffee and it can still portably launch ImgBurn...

Code:
@echo off
cls
Title ImgBurn portable launcher

IF "%~x1" == "" (start /D "%~dp0App" ImgBurn.exe /portable) ELSE (start /D "%~dp0App" ImgBurn.exe /portable /mode write /src "%~f1")

(where ImgBurn and all its files/folders are in an "App" subfolder, to make it less likely for the user to accidentally click on the .exe instead of the .bat launcher...
You can replace the word "App" the two times it happens in the above script with your own folder name, or remove it entirely if you want to keep the .bat in the same folder as ImgBurn.)


Top
 Profile  
 
 Post subject: Re: .bat launcher for ImgBurn...
PostPosted: Mon Mar 15, 2010 10:02 pm 
Offline

Joined: Sat Sep 05, 2009 6:35 pm
Posts: 318
Hey Onesimus Prime, are you aware that ImgBurn does not need the '/portable' parameter, as long as the file ImgBurn.ini
contains:
Code:
[Settings]
PortableMode=1
and is in the same folder as ImgBurn.exe.


Top
 Profile  
 
 Post subject: Re: .bat launcher for ImgBurn...
PostPosted: Mon Mar 15, 2010 10:25 pm 
Offline

Joined: Wed Sep 05, 2007 8:42 pm
Posts: 126
guinness disupted this in the program's comments, but Hydaral just posted an answer there which I think may be correct (but the next question is - how much has to be done manually?). Perhaps one of the 'regulars' here has got some testing to do to get a definitive answer!

Thanks for bringing it up, Ruby!

*edit* - without the other switches implemented in the batch file (/mode write /src "%~f1"), I'm not sure portable file association would work with a normally-launched, but portable, ImgBurn.exe?


Top
 Profile  
 
 Post subject: Re: .bat launcher for ImgBurn...
PostPosted: Mon Mar 15, 2010 11:00 pm 
Offline
User avatar

Joined: Mon Aug 27, 2007 2:00 am
Posts: 4069
OK, so my testing of Applications has got better so I thought I would try again.

With the INI file (as suggested by Ruby and in the Database Entry) it wrote log files to %APPDATA%\ImgBurn. I then deleted this folder and started again with the \portable CLI switch and it wrote log files again, weird. So I then edited the INI and substituted %APPDATA\ImgBurn plus other folder names to a relative format by adding a "." and launched without the parameter. All folders were created in the Application folder! :)

TESTED: Portable

So in a new INI paste the following.
Code:
[Settings]
PortableMode=1
FILELOCATIONS_GraphDataFiles=.\Graph Data Files\
FILELOCATIONS_ImageFiles=.\Documents\
FILELOCATIONS_LogFiles=.\Log Files\
FILELOCATIONS_ProjectFiles=.\Project Files\
FILELOCATIONS_QueueFiles=.\Queue Files\

_________________
Added 179 Applications: Portable and an AutoIt Developer
SoftwareSpot - Portable Apps


Last edited by guinness on Mon Mar 15, 2010 11:40 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: .bat launcher for ImgBurn...
PostPosted: Mon Mar 15, 2010 11:21 pm 
Offline

Joined: Sat Sep 05, 2009 6:35 pm
Posts: 318
I should have been a little more specific; starting with a blank ImgBurn.ini
except for:
Code:
[Settings]
PortableMode=1


Top
 Profile  
 
 Post subject: Re: .bat launcher for ImgBurn...
PostPosted: Mon Mar 15, 2010 11:39 pm 
Offline
User avatar

Joined: Mon Aug 27, 2007 2:00 am
Posts: 4069
Uh! That's what I did, but when it writes the settings to the INI on the first run the following (below) use an absolute path (C:\Documents and Settings\Username\Application Data\USERNAME\ImgBurn\" not a relative. So these should be pasted in the empty INI file too.
Code:
FILELOCATIONS_GraphDataFiles=.\Graph Data Files\
FILELOCATIONS_ImageFiles=.\Documents\
FILELOCATIONS_LogFiles=.\Log Files\
FILELOCATIONS_ProjectFiles=.\Project Files\
FILELOCATIONS_QueueFiles=.\Queue Files\


Ruby please Test with out the following additions and see if it was just my machine.

_________________
Added 179 Applications: Portable and an AutoIt Developer
SoftwareSpot - Portable Apps


Top
 Profile  
 
 Post subject: Re: .bat launcher for ImgBurn...
PostPosted: Tue Mar 16, 2010 12:06 am 
Offline

Joined: Sat Sep 05, 2009 6:35 pm
Posts: 318
OK just tested it, and it appears that if you start ImgBurn with a blank ini containg:
Code:
[Settings]
PortableMode=1

it doesn't write to the registry but it does indeed create a folder in %appdata%, and restarting with /portable does not correct this behaviour, however if you start with a blank ini containing the 2 lines of code and pass the /portable parameter it saves everything in ImgBurn's folder.
Also in the UI settings it will show the full absolute path but in the ini they are indeed relative.
So in conclusion the /portable parameter is only needed on first run to set the paths relative to ImgBurn.


Top
 Profile  
 
 Post subject: Re: .bat launcher for ImgBurn...
PostPosted: Tue Mar 16, 2010 11:05 am 
Offline

Joined: Sat Sep 05, 2009 6:35 pm
Posts: 318
guinness, I noticed in your code above you have:
Code:
FILELOCATIONS_ImageFiles=.\Documents\
This will more than likely create a Documents folder in ImgBurn's folder.
The default created by ImgBurn is:
Code:
FILELOCATIONS_ImageFiles=.\Image Files\


Top
 Profile  
 
 Post subject: Re: .bat launcher for ImgBurn...
PostPosted: Tue Mar 16, 2010 12:00 pm 
Offline
User avatar

Joined: Mon Aug 27, 2007 2:00 am
Posts: 4069
Weird, because mine was "%APPDATA%\My Documents" but I deleted the "My" and replaced the %APPDATA% location with "."

But I agree .\Image Files\ seems more appropriate considering the name of the the INI Key.

_________________
Added 179 Applications: Portable and an AutoIt Developer
SoftwareSpot - Portable Apps


Top
 Profile  
 
 Post subject: Re: .bat launcher for ImgBurn...
PostPosted: Tue Mar 16, 2010 12:26 pm 
Offline

Joined: Sat Sep 05, 2009 6:35 pm
Posts: 318
Like I stated in a previous post, if you delete everything in the ImgBurn.ini except for:
Code:
[Settings]
PortableMode=1
and then start ImgBurn with the /portable parameter all the paths will bet set relative in the ini.
Note: The UI Tools> Settings> File Locations will still show absolute paths.
Once set, the /portable parameter is no longer needed.


Top
 Profile  
 
 Post subject: Re: .bat launcher for ImgBurn...
PostPosted: Fri Mar 26, 2010 7:46 am 
Offline
User avatar

Joined: Mon Mar 19, 2007 8:55 am
Posts: 994
Location: Italy
But so the bat file is still needed or not?

I think a good solution could be also to use a unique setting folder like this:

[Settings]
PortableMode=1
FILELOCATIONS_GraphDataFiles=.\Settings\Graphics\
FILELOCATIONS_ImageFiles=.\Settings\Images\
FILELOCATIONS_LogFiles=.\Settings\Logs\
FILELOCATIONS_ProjectFiles=.\Settings\Projects\
FILELOCATIONS_QueueFiles=.\Settings\Queues\

_________________
Lupo PenSuite: all-in-one and completely free selection of portable programs and games.
DropIt: personal assistant to automatically manage your files.
ArcThemALL!: application to multi-archive your files and folders.


Top
 Profile  
 
 Post subject: Re: .bat launcher for ImgBurn...
PostPosted: Fri Mar 26, 2010 9:18 am 
Offline

Joined: Wed Sep 05, 2007 8:42 pm
Posts: 126
"But so the bat file is still needed or not?"

As implied in one of my posts above (thread post #3), I think that if you want to use portable file association via eXpresso/Coffee/C.A.F.E., associating CD image files with the bat is still the way to go as it would pass the necessary parameters to ImgBurn. But I wouldn't mind being proven wrong! :lol:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group