Skip to content
⌘ NSIS Forum Archive

Error in path

10 posts

Gluck#

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.
Anders#
Probably related to 64-bit Windows and filesystem redirection but it is hard to tell without further information.
Gluck#
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#
Now works correctly, but everytime the launcher show the window to acquire admin rights...

Is possible avoid this? (giving implicit answer)?
Anders#
No, of course not. The whole point of UAC is to stop random applications from writing to system locations.
Gluck#
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?
Anders#
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.