levitation / vwkvasdopager

Automatically exported from code.google.com/p/vwkvasdopager
1 stars 0 forks source link

install-dll.bat doesn't work when selecting "Run as Administrator" from the explorer context menu #29

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Right-click on install-dll.bat
2. Select "Run as Administrator"

What is the expected output? What do you see instead?

I expect the dll to be registered but see a regsvr error instead. That error 
tells me that "The specified module could not be found."

What version of the product are you using? On what operating system?

vwKvasdoPager-0.5a on Windows 7

Please provide any additional information below.

The problem is that running a batch file as administrator sets the default 
directory to "C:\Windows\System32" so that you can't easily refer to local 
files.

This is important in Windows Vista and Windows 7 since the "User Account 
Control" on these system prevent users from running regsvr32 directly and you 
have to use that "Run As" command.

Original issue reported on code.google.com by alexandre.jasmin on 25 Jul 2010 at 12:54

GoogleCodeExporter commented 9 years ago
To fix the bug add this lines at the top of the batch files (right after "@echo 
off"):
CD /D "%~dp0"

That will change the current directory to that of the batch file.

Although Issue 28 suggests that install-dll.bat may be replaced by something 
else in the future.

Another feature I'd like is to display the elevation dialog automatically. This 
requires running regsvr32.exe by passing the "RunAs" verb to ShellExecute(). 
Not possible using a batch file AFAIK.

Original comment by alexandre.jasmin on 25 Jul 2010 at 1:05

GoogleCodeExporter commented 9 years ago
Another option is to change the DLL path to "%~dp0\vwKvasdoPagerBandwin32.dll".

This method has the advantage of working with UNC paths since you can't CHDIR 
to an UNC path.
Not sure anyone would want to install vwkvasdopager on a network path though.

Original comment by alexandre.jasmin on 25 Jul 2010 at 5:02

GoogleCodeExporter commented 9 years ago
Alexandre, great thanks for the solution!
Patch in svn, zipfile updated.
Closing this issue.

Original comment by kvasdo...@gmail.com on 26 Jul 2010 at 7:07

GoogleCodeExporter commented 9 years ago
You probably will want to update your install.txt file as well to indicate that 
Vista/7 users will want to Run As Administrator.  The BAT will fail and it will 
not be obvious why to most users.

Original comment by jamesi...@gmail.com on 16 Sep 2010 at 1:42