jgamalinda
05-20-2010, 12:09 PM
Before letting the install run I am checking to see if my .exe is running (anywhere on the network). The function - check in use file will return true if the user does not have permission. At an actual user site in windows explorer any action against my .exe was an error 5 Access Denied due to permissions, I know my .exe was not running there. I was not installing on the server.
Is there any way to spot the user running the setup.exe does not have permission to replace my .exe file (or any folder files) so I can provide a better error message for them?
E.g.
Set Variable %NoPerm% Check File Permissions "%_SB_INSTALLDIR%\myapp.exe"
IF %NoPerm% > 0 THEN
Display Message "You Do Not Have Permissions to Install. Login as admin"
Exit_Installation()
END
Set Variable %IsRunning% Check File InUse "%_SB_INSTALLDIR%\myapp.exe"
IF %IsRunning% > 0 THEN
Display Message "All Users must exit, someone is running myapp.exe"
Cycle Loop
END
Do you know of some good example code on how to figure out the cause of an error 5. I can think of 3 causes:
1. File is in use
2. File is marked Read Only
3. User does not have Permissions
D. The User Account that Owned the file has been deleted
Is there any way to spot the user running the setup.exe does not have permission to replace my .exe file (or any folder files) so I can provide a better error message for them?
E.g.
Set Variable %NoPerm% Check File Permissions "%_SB_INSTALLDIR%\myapp.exe"
IF %NoPerm% > 0 THEN
Display Message "You Do Not Have Permissions to Install. Login as admin"
Exit_Installation()
END
Set Variable %IsRunning% Check File InUse "%_SB_INSTALLDIR%\myapp.exe"
IF %IsRunning% > 0 THEN
Display Message "All Users must exit, someone is running myapp.exe"
Cycle Loop
END
Do you know of some good example code on how to figure out the cause of an error 5. I can think of 3 causes:
1. File is in use
2. File is marked Read Only
3. User does not have Permissions
D. The User Account that Owned the file has been deleted