I try to portabilize an app developement in 32 & 64bit architecture.
The versions of program are stored in:
%PAL:AppDir%\program32
%PAL:AppDir%\program64
In %PAL:DataDir% there's a folder:
SETUP
and a file
program.ini.
Execute the right version of the program is simply:
[Launch]
ProgramExecutable64=program64\program.exe
ProgramExecutable=program\program.exe
My goal is move the folder SETUP and the program.ini file in the folder content the right 32/64 version of program.
I've created a custom.nsh file put in %PAL:AppDir%\AppInfo\Launcher folder:
${SegmentFile}
${SegmentInit}
${If} $Bits = 64
${SetEnvironmentVariablesPath} FullAppDir $EXEDIR\App\program64
${Else}
${SetEnvironmentVariablesPath} FullAppDir $EXEDIR\App\program
${EndIf}
!macroend
It's not flour on my sack.
I found it somewhere and tried to adapt it to my needs.
If I did not understand, create the FullAppDir variable containing the path I need
Then
[FilesMove]
program.ini=%FullAppDir%
[DirectoriesMove]
SETUP=%FullAppDir%
But not working...
A little bit of help will be appreciated
Your DirectoriesMove is not correct. Should be:
[DirectoriesMove]
SETUP=%FullAppDir%\SETUP
Thank you for your interest
With the change suggested by you the situation is as follows:
http://pikky.net/Dny
A folder %FullAppData% was created in %PAL:AppDir%.
IMHO
Something does not go in custom.nsh or I put it in a wrong folder
The picture showed that %FullAppData% is not defind.
Add the following to the custom code see will it solve the problem. The code is taken from the official 7 zip portble.
${Segment.OnInit}
; Borrowed the following from PAL 2.2, Remove on release of PAL 2.2
; Work out if it's 64-bit or 32-bit
System::Call kernel32::GetCurrentProcess()i.s
System::Call kernel32::IsWow64Process(is,*i.r0)
${If} $0 == 0
StrCpy $Bits 32
${Else}
StrCpy $Bits 64
${EndIf}
!macroend
Thanks.
Work fine!
Add the following to your .ini in App\AppInfo\Launcher:
And then you should be able to have your custom.nsh as the following:
If you set the environment variable in custom code, why also set it in the [Environment] section?
~3D1T0R
On top of that, the Environment section would only set FullAppDir for x86, rather than for both x86 and x64.
@Gord Caswell,
It is seems that the build-in $Bits variable in PAL not work.
I just did a test using 7-zip (removing the custom $Bits setting, since that's been included by default since PAL 2.1), and the $Bits variable is working perfectly.
Some posts that fan afoul of the PortableApps.com Forum Guidelines' "Play Nice" rule have been removed. We apologize for the interruption. Please continue portable app-ing.
Sometimes, the impossible can become possible, if you're awesome!