0

I want to add a backup functionality to my app in the sense that the app will allow users to create a self-contained environment (data + executable + autorun.inf file) on an external device (CD, CD-ROM or USB key) so that users can retrieve (in read only mode) their stored environment at a given point in time.

I've read here about making an auto-bootable USB (which I suspect will be the same for a CD or DVD).

edit I meant "auto-executing", not "auto-bootable"!

I know about IMAPI or other approaches that are now several years old. Is there any alternative/standard approach to create media this way? I'd like a generic way to create either CD/DVD or USB devices (non-bootable).

neggenbe
  • 1,697
  • 2
  • 24
  • 62

1 Answers1

1

You need to make sure to not confuse Booting and Windows Autorun.

auto-bootable USB

refers to an external USB drive from which you can boot your computer. I doubt that's what you are looking for, given the linked Stackexchange question. The information you already found is actually what you are looking for, and the advice given there seems pretty accurate.

What you need to do is:

  1. Create the media with your data. In case of USB sticks this is as easy as copying the data to the stick. Optical media (CD/DVD) need to be burned, and that can only be done using the Windows API, which has already be discussed here.
  2. If you want to use the Windows autorun feature (which I would ignore*), you'll need to create a file called Autorun.ini in the root directory of your media. You already have found the required content of that file here.

* Why I would skip the autorun feature.

First of all, there's no real alternative to the Windows autorun feature. It was controversial, at best, in earlier versions of Windows. Since USB sticks went mainstream, autorun became nothing more than an automatic virus installation feature. Soon after everyone started disabling it. Because of this recent versions of Windows seem to have dropped it or disable it by default.

An exception to this would be the Icon=diskicon.ico option, which allows you to change the icon of the drive. This might be still working, even if autorun is disabled.

r41n
  • 908
  • 7
  • 18
  • Thanks for the answer, helps a lot - and indeed, I got confused about "auto-bootable". I know about autorun being disabled but let's face it - the goal here is to make it a "plug-and-play" backup - if users need to open the folder and click on an icon, there's a big chance the will get something wrong... So no better option here?! Too bad! – neggenbe Jul 11 '17 at 13:39
  • To minimize the risk a user gets something wrong, you could "expose" just an executable on your backup-media. Try to set the `Hidden` flag of all other files, leave just the main executable visible. I'm not sure if this works on optical media, but it might be worth a try. – r41n Jul 11 '17 at 14:04