.bat launcher for ImgBurn...

Discuss anything related to portable freeware here.

Moderators: usdcs, Andrew Lee, webfork

Post Reply
Message
Author
Onesimus Prime
Posts: 130
Joined: Wed Sep 05, 2007 8:42 pm

.bat launcher for ImgBurn...

#1 Post by Onesimus Prime » Mon Mar 15, 2010 4:47 pm

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: Select all

@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.)

Ruby
Posts: 324
Joined: Sat Sep 05, 2009 6:35 pm

Re: .bat launcher for ImgBurn...

#2 Post by Ruby » Mon Mar 15, 2010 10:02 pm

Hey Onesimus Prime, are you aware that ImgBurn does not need the '/portable' parameter, as long as the file ImgBurn.ini
contains:

Code: Select all

[Settings]
PortableMode=1
and is in the same folder as ImgBurn.exe.

Onesimus Prime
Posts: 130
Joined: Wed Sep 05, 2007 8:42 pm

Re: .bat launcher for ImgBurn...

#3 Post by Onesimus Prime » Mon Mar 15, 2010 10:25 pm

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?

User avatar
guinness
Posts: 4118
Joined: Mon Aug 27, 2007 2:00 am
Contact:

Re: .bat launcher for ImgBurn...

#4 Post by guinness » Mon Mar 15, 2010 11:00 pm

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: Select all

[Settings]
PortableMode=1
FILELOCATIONS_GraphDataFiles=.\Graph Data Files\
FILELOCATIONS_ImageFiles=.\Documents\
FILELOCATIONS_LogFiles=.\Log Files\
FILELOCATIONS_ProjectFiles=.\Project Files\
FILELOCATIONS_QueueFiles=.\Queue Files\
Last edited by guinness on Mon Mar 15, 2010 11:40 pm, edited 1 time in total.
Added 179 Applications: Portable

Ruby
Posts: 324
Joined: Sat Sep 05, 2009 6:35 pm

Re: .bat launcher for ImgBurn...

#5 Post by Ruby » Mon Mar 15, 2010 11:21 pm

I should have been a little more specific; starting with a blank ImgBurn.ini
except for:

Code: Select all

[Settings]
PortableMode=1

User avatar
guinness
Posts: 4118
Joined: Mon Aug 27, 2007 2:00 am
Contact:

Re: .bat launcher for ImgBurn...

#6 Post by guinness » Mon Mar 15, 2010 11:39 pm

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: Select all

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

Ruby
Posts: 324
Joined: Sat Sep 05, 2009 6:35 pm

Re: .bat launcher for ImgBurn...

#7 Post by Ruby » Tue Mar 16, 2010 12:06 am

OK just tested it, and it appears that if you start ImgBurn with a blank ini containg:

Code: Select all

[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.

Ruby
Posts: 324
Joined: Sat Sep 05, 2009 6:35 pm

Re: .bat launcher for ImgBurn...

#8 Post by Ruby » Tue Mar 16, 2010 11:05 am

guinness, I noticed in your code above you have:

Code: Select all

FILELOCATIONS_ImageFiles=.\Documents\
This will more than likely create a Documents folder in ImgBurn's folder.
The default created by ImgBurn is:

Code: Select all

FILELOCATIONS_ImageFiles=.\Image Files\

User avatar
guinness
Posts: 4118
Joined: Mon Aug 27, 2007 2:00 am
Contact:

Re: .bat launcher for ImgBurn...

#9 Post by guinness » Tue Mar 16, 2010 12:00 pm

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

Ruby
Posts: 324
Joined: Sat Sep 05, 2009 6:35 pm

Re: .bat launcher for ImgBurn...

#10 Post by Ruby » Tue Mar 16, 2010 12:26 pm

Like I stated in a previous post, if you delete everything in the ImgBurn.ini except for:

Code: Select all

[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.

User avatar
Lupo73
Posts: 1011
Joined: Mon Mar 19, 2007 8:55 am
Location: Italy
Contact:

Re: .bat launcher for ImgBurn...

#11 Post by Lupo73 » Fri Mar 26, 2010 7:46 am

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.

Onesimus Prime
Posts: 130
Joined: Wed Sep 05, 2007 8:42 pm

Re: .bat launcher for ImgBurn...

#12 Post by Onesimus Prime » Fri Mar 26, 2010 9:18 am

"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:

Post Reply