mirror of
https://github.com/1Remote/1Remote.git
synced 2026-04-25 13:36:03 +03:00
[GH-ISSUE #67] Access to PRemoteM.ini is Denied #1012
Labels
No labels
area-configuration
area-ct-app
area-ct-rdp
area-ct-remoteapp
area-ct-ssh
area-ct-vnc
area-launcher
area-list
area-tags
area-teamwork
bug
chore
dependencies
general-build/ci
general-performance
general-refactor
general-security
general-supportive
general-ux
meta-documentation
meta-enhancement
meta-enhancement
meta-feature
meta-help-wanted
meta-unknown-error
priority-hi
priority-low
pull-request
question
resolution-duplicate
resolution-invalid
resolution-wontfix
stale
task-put-off
task-still-considering
task-working-in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/1Remote#1012
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @valsamis-d on GitHub (Jan 27, 2021).
Original GitHub issue: https://github.com/1Remote/1Remote/issues/67
Originally assigned to: @VShawn on GitHub.
Description
I have enabled "Run automatically at OS startup" and "Start Minimize". Every time I restart my laptop it goes over the cycle of 1st execution and finally displays the following error message:
However, the app is 'installed' on drive [P] rather than [C]:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
After restarting I expect a 'silent' restart of PRemote>
Screenshots
See above
Desktop (please complete the following information):
Additional context
None
@majkinetor commented on GitHub (Jan 27, 2021):
For now I believe you can quickly solve this with:
@VShawn commented on GitHub (Jan 27, 2021):
bug confirm.
In fact You are not the first reportor of this bug. I thought I figured out the reason last week, but now it looks different from what I thought.
https://github.com/VShawn/PRemoteM/blob/dev/PRemoteM/App.xaml.cs#L161-L175
checking the code:
Line 174 should set
iniOnCurrentPath=P:\PApps\PRmoteMPortable\PRmoteM.iniBut it seems like it redirects to
C:\WINDOWS\system32\PRmoteM.iniIt's very strange
I will try to find out what happened.
BTW, can you help to test new fix release latter? I can't reproduce this bug on neither of my PCs(1 laptop, 2 desktops)
@majkinetor commented on GitHub (Jan 27, 2021):
I was bitten by this several times and it relates to working dir, it has nothing to do with drive. Thats the reason I added this line recently to chocolatey package.
Maybe PRM should handle this by trying to access several locations for ini file if all previous attempts fail, including its own directory.
Order could be:
It stops as soon as it finds its ini file.
Other, idea is to allow specification of working dir via command line:
This would allow using one installation with multiple configurations and databases and would allow easy solution to startup problem by adding this param to the registry.
@VShawn commented on GitHub (Jan 27, 2021):
I dont think a specific path would be good. If we do that, PRM will not a real portable app anymore.
I hope it will read the ini file in the app path first, so that the user can be able to carry the app/ini file/database in a USB flash drive, and use it directly on any computer that has not installed PRM.
also it seems like not totally about working dir
C:\WINDOWS\system32, double click to run.C:\WINDOWS\system32and nothing happen, PRM just works fine
find this
https://stackoverflow.com/questions/1321628/environment-currentdirectory-in-c-net
@majkinetor commented on GitHub (Jan 27, 2021):
I meant specific user folder, the one that PRM already uses in AppData
This is OK in portable scenario, not OK in setup.exe scenario where user can't write in ProgramFiles but since we don't have that now (and possible ever) then its OK. You still need to prefer one location over another tho - AppData or PrmInstallDir ? I would go with AppData first if it exists, InstallDir next (allows 1 portable installation of PRM for multiple users). This could be changed via command line (i.e.
-portableflag to not look into AppData)@valsamis-d commented on GitHub (Jan 27, 2021):
This workaround worked just fine! Thanks :)
@valsamis-d commented on GitHub (Jan 27, 2021):
Sure I will, as soon as the new release is posted. Thanks!
@majkinetor commented on GitHub (Jan 27, 2021):
@valsamis-d
You can do that quickly via choco:
$Env:ChocolateyToolsLocation = 'D:\bla'; cinst premotem@valsamis-d commented on GitHub (Jan 27, 2021):
@majkinetor, unfortunately, I'm far from having even the slightest idea what the above means :( I'm sorry :(
@VShawn commented on GitHub (Jan 28, 2021):
@valsamis-d
I fix this by set working dir in code:
https://github.com/VShawn/PRemoteM/blob/dev_fix/PRemoteM/App.xaml.cs#L219
Expecting you to help me test it if you are free
PRemoteM 0.5.8.2101282043.zip
@valsamis-d commented on GitHub (Jan 28, 2021):
@VShawn tested this as following and worked just fine :)
PMRemoteM started just fine, without any error and with respecting my existing 'PRemoteM.ini'
Thank you!