-1

I need to access a network share during the install process, and I also need to edit some registry keys. And finally, I'd like to add some shortcuts to a program that is over the network share.

To edit registry keys, I run the installer with elevated privileges. However, if I do that, I won't be able to see the network share as it is usually created without admin privileges.

There is a way to kill the installer and restart it with admin privileges, and this is fine for copying necessary files, but in order to create shortcuts that point to the network share, I would then need to downgrade my privileges again, in the middle of the Inno Setup step where it copies file, a step which I can't do anything in the middle of.

Any other options for a workaround? The only one that I found was this, which requires a registry edit (fine) and a restart (not as fine).

Nils Guillermin
  • 1,867
  • 3
  • 21
  • 51

1 Answers1

0

You can create the shortcut using some command and run it from [Run] section with runasoriginaluser flag.

See How do I create a shortcut via command-line in Windows?


Or do not kill the unelevated installer. Run it only to copy the files. And continue with the unelevated installer.

Also note that you can create a shortcut pointing to a nonexisting file.

Community
  • 1
  • 1
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
  • The problem is mklink requires admin privileges, which means it won't be able to see the network share, and it does in fact complain about not being to see it. – Nils Guillermin Aug 08 '16 at 20:57
  • Ah, so it turns out mklink works with the UNC path but not the mapped network drive name (i.e. '\\Server\share', not 'O:\') – Nils Guillermin Aug 08 '16 at 21:05
  • The `mklink` creates symlinks/hardlinks/junctions, not shortcuts. If you want to create symlink, not shortcut, your question is just wrong. – Martin Prikryl Aug 09 '16 at 05:46
  • I wasn't trying to make symlinks, but this question was indeed useless. It resolved itself when [this](http://stackoverflow.com/questions/38837565/you-must-enter-a-full-path-with-driver-or-a-unc-path-in-the-form-inn) was fixed. – Nils Guillermin Aug 09 '16 at 13:43