Old 26th May 2018, 09:34   #1
Gluck
Member
 
Join Date: Apr 2018
Posts: 80
Error in path

Hi,

I have a folder named MyAppPortable
In this a folder MyApp and another Data.

In Data there is a folder Windows and a folder SysWOW64.
Each have a folder named MyFolder (same name, different content).

I have to copy MyFolder (not the content, the whole folder) in Windows dir and in Windows\SysWOW64 dir.

I have written:

!define SOURCEDIR1 "$EXEDIR\Data\Windows\MyFolder"
!define TARGETDIR1 "$WINDIR"


!define SOURCEDIR2 "$EXEDIR\Data\SysWOW64\MyFolder"
!define TARGETDIR2 "$WINDIR\SysWOW64"

Something is wrong, because I loose files, backup empty folder in wrong places and so on...

Thanks.
Gluck is offline   Reply With Quote
Old 26th May 2018, 14:20   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,888
Probably related to 64-bit Windows and filesystem redirection but it is hard to tell without further information.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 27th May 2018, 09:28   #3
Gluck
Member
 
Join Date: Apr 2018
Posts: 80
I don't understand...

I have simplified the code. That's ALL:

WindowIcon Off
SilentInstall Silent
AutoCloseWindow True
RequestExecutionLevel user

!define APP "Test"

OutFile "${APP}.exe"

Section "LAUNCH"

CopyFiles /SILENT "$EXEDIR\Text.txt" "$WINDIR"
ExecWait "$EXEDIR\notepad.exe"

SectionEnd

The file Text.txt IS NOT copied from the source directory to Windows...

Why???
Gluck is offline   Reply With Quote
Old 27th May 2018, 11:51   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,888
You need RequestExecutionLevel Admin to copy to $windir.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 27th May 2018, 13:04   #5
Gluck
Member
 
Join Date: Apr 2018
Posts: 80
Thanks.
Gluck is offline   Reply With Quote
Old 27th May 2018, 13:11   #6
Gluck
Member
 
Join Date: Apr 2018
Posts: 80
Now works correctly, but everytime the launcher show the window to acquire admin rights...

Is possible avoid this? (giving implicit answer)?
Gluck is offline   Reply With Quote
Old 27th May 2018, 13:32   #7
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,888
No, of course not. The whole point of UAC is to stop random applications from writing to system locations.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 27th May 2018, 14:41   #8
Gluck
Member
 
Join Date: Apr 2018
Posts: 80
But when I install a program, expecially if it is commencial, it writes in registry, Windows and other places, but not always ask for administrative privileges...

Is it possible?
Gluck is offline   Reply With Quote
Old 27th May 2018, 17:00   #9
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,888
You can write a service that does it for you without elevation but I don't recommend that. Even apps with a service require elevation during their first install.

You are not supposed to write to $windir nor $sysdir anyway so it should not be an issue.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 30th May 2018, 16:04   #10
Gluck
Member
 
Join Date: Apr 2018
Posts: 80
OK, Thanks.
Gluck is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump