In Inno Setup, I need to set the AppId after the user has selected the destination directory of the install. How can this be done? The documentation leads me to believe this can be done from this quote here, «If you use a {code:..} constant to allow your user to customize AppId, you do not need to return the real value until just before the installation starts:…»
What I am trying to accomplish is to set the AppId based on the user selected destination directory so that multiple copies of the application can be installed and displayed in the Add/Remove programs.
When I use something like
AppId={code:GetAppId}
the constant {app} has not yet been set in my «GetAppId» function.
asked Jan 22, 2014 at 23:43
1
Since the AppId directive value can be evaluated at early initialization of the setup, you cannot safely expand in its assigned scripted function {app} constant nor even call the WizardDirValue function because the {app} constant requires to pass the directory selection page and the WizardDirValue function requires a wizard form instance.
The only way then is to declare a flag variable which will indicate that the wizard form has been created for calling the WizardDirValue function, or that the directory selection page has been passed if you decide to expand {app} constant in your scripted constant function.
A script which uses the WizardDirValue function for getting the selected directory may look like:
[Setup]
AppId={code:GetAppId}
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}My Program
UsePreviousLanguage=no
OutputDir=userdocs:Inno Setup Examples Output
[Code]
var
CanGetDir: Boolean;
function InitializeSetup: Boolean;
begin
Result := True;
CanGetDir := False;
end;
procedure InitializeWizard;
begin
CanGetDir := True;
end;
function GetAppId(Value: string): string;
begin
Result := '';
if CanGetDir then
Result := ExtractFileName(WizardDirValue) + '123';
end;
A script which expands the {app} constant to get the selected directory may look like:
[Setup]
AppId={code:GetAppId}
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}My Program
UsePreviousLanguage=no
OutputDir=userdocs:Inno Setup Examples Output
[Code]
var
CanGetDir: Boolean;
function InitializeSetup: Boolean;
begin
Result := True;
CanGetDir := False;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpSelectDir then
CanGetDir := True;
end;
function GetAppId(Value: string): string;
begin
Result := '';
if CanGetDir then
Result := ExtractFileName(ExpandConstant('{app}')) + '123';
end;
answered Jan 23, 2014 at 0:06
TLamaTLama
75k17 gold badges213 silver badges387 bronze badges
7
Перейти к контенту
Thanks for helping, the problem got solved!
Before the user reaches the ‘Select Destination Location’ the {app} variable is not set.
My DeInitialize-Procedure looked like this:
procedure DeinitializeSetup();
var
SettingsPath: String;
begin
SettingsPath := ExpandConstant('{app}')
DelTree(SettingsPath + 'bin', True, True, True);
end;
What I did is I created a Boolean variable at the beginning:
[Code]
var appIsSet: Boolean;
I set it to false at initializing:
function InitializeSetup(): Boolean;
begin
// interesting code
appIsSet := False;
end;
… and set it to ‘true’ after the user has reached ‘wpSelectDir’ in nextButtonClick (see code snippet below:)
begin
if CurPageID = wpSelectDir then
begin
appIsSet := True;
The last step is to check in the Deinitialize-Procedure if the boolean variable is set. If so, he can access on it, if not — do nothing:
procedure DeinitializeSetup();
var
SettingsPath: String;
begin
if appIsSet then begin
SettingsPath := ExpandConstant('{app}')
DelTree(SettingsPath + 'bin', True, True, True);
end;
end;
|
1st November 2009, 04:06 AM |
|
Hi NexusDB_V3.02_DCU_Only_for_Delphi_2006.exe Fails with Internal error: An attempt was made to expand the «app» constant before — |
|
1st November 2009, 10:18 AM |
|
> Internal error: An attempt was made to expand the «app» constant Strange, I can’t reproduce here; perhaps its a dud download? — |
|
1st November 2009, 07:51 PM |
|
Eivind Bakkestuen [NDD] wrote: Hi Eivind Do you really think so? NexusDB_3.0101_(DCU_Only)_for_D2006.zip 6,602 KB Compressed I use 7-zip to extract the exe from the zip and it worked for To me it seems that the only reason for zipping is attaching a password NexusDB_V3.02_DCU_Only_for_Delphi_2006.exe 6,837 KB Application — |
|
3rd November 2009, 01:02 AM |
|
dan wrote: Hi Eivind I have now downloaded it at least 10 times. Also NexusDB_3.0101_(DCU_Only)_for_D2006.zip worked fine on the XP The irony is that you need some manual tricks to make BDS2006 register — |
|
3rd November 2009, 09:44 AM |
|
> On XP SP3 on both a desktop AMD3200+ and an HP Laptop Intel T7400 I That is indeed strange. Is there anything common to the machines, eg, — |
|
3rd November 2009, 02:36 PM |
|
> On XP SP3 on both a desktop AMD3200+ and an HP Laptop Intel T7400 I Is there a chance, that on the above machines, you have not yet The installer expects certain things to be present in the windows — |
|
4th November 2009, 11:31 PM |
|
Eivind Bakkestuen [NDD] wrote: A) To get over this impasse: B) In Answer to your question: Home Desktop 1: AMD 3200 +2GB RAMXP SP3 : Home Desktop 2: AMD 6600 +4GB RAM Vista Business SP2: Thx — |
|
5th November 2009, 08:21 AM |
|
> If I have NexusDB_V3.02_DCU_Only_for_Delphi_2006 installed somewhere Yes, that should work. — |
|
6th November 2009, 04:09 PM |
|
Clean winXP install on a new laptop, updated with current XP patches, Only other software installed is OpenOffice 3.1, Firefox 3.5.4, CBuilder So far the 2010 DCU has failed on 2 out of 3 systems for me. Any update as to getting the DCU edition to work properly with the Eivind Bakkestuen [NDD] wrote:
|
|
6th November 2009, 09:45 PM |
|
> Any update as to getting the DCU edition to work properly with the Can you please email to support at nexusdb dot com, include your — |

CD runtime error — Windows ME — EarMaster Community
CD runtime error — Windows ME
Moderator: Quentin
-
Guest
CD runtime error — Windows ME
Hi, I have puchased earmaster 5 pro from a music shop on CD. When installing, I have the runtime error at 8:836… Internal error: An attempt was made to expand the app constant before it was initialized.
I note that Gus has posted this problem before but as I have not purchased through download, I don’t know what to do. I am running Windows ME
Regards
Paul Smith
-
Hans
- EarMaster.com
- Posts: 278
- Joined: May 24, 2005 12:54 am
- Location: Denmark
Post
by Hans » Jun 09, 2005 1:55 am
Unfortunately this Windows 98/ME problem was also on the first CD’s we shipped. Please send an email with your serial number and mailing address to Sales (find the email address here: http://www.earmaster.com/about_us.htm), then we will ship a replacement CD for you.
To begin using EarMaster now, just download the installation program from this website.
Best regards,
Hans Jakobsen
EarMaster
-
Guest
Re: CD runtime error — Windows ME
Post
by Guest » Apr 01, 2006 12:46 pm
Anonymous wrote:Hi, I have puchased earmaster 5 pro from a music shop on CD. When installing, I have the runtime error at 8:836… Internal error: An attempt was made to expand the app constant before it was initialized.
I note that Gus has posted this problem before but as I have not purchased thrgh download, I don’t know what to do. I am running Windows MERegards
Paul Smith
-
Hans
- EarMaster.com
- Posts: 278
- Joined: May 24, 2005 12:54 am
- Location: Denmark
Post
by Hans » Apr 02, 2006 11:36 pm
We will replace the CD no matter if you have purchased EarMaster online or through a store. Please send an email with your serial number and mailing address to Sales (find the email address here: http://www.earmaster.com/about_us.htm), then we will ship a replacement CD for you.
Best regards,
Hans Jakobsen
EarMaster
Again, you are looking into the wrong folder.
Also, I believe you are confusing about what this thread is about, because you posted in a thread from January, and it probably doesn’t have anything to do with your problem.
This thread was about a specific issue, which is the «Internal Error. An attempt was made to expand the ‘App’ constant before it was initialized» error message happening while installing.
You said:
I have the same problem with windows 7 apart from KLAX keeps crashing and then telling me to update to the latest version of couatl…
Are you SURE you are having the SAME problem ?
Your sentence is not very clear:
are you saying that you are BOTH getting the error in the installer AND KLAX is crashing telling to update the Addon Manager ?
OR
are you saying you just have KLAX is crashing telling to update the Addon Manager ? If this is the case, your problem doesn’t have anything to do with this thread, and there wasn’t any need to create an INSTALLATION LOG, which was needed in case you had an INSTALLER error.
If you are getting that «Crash» (which is not a crash, it’s a diagnostic indicating there was some kind of problem on the Couatl scripting engine), the message is not only saying you should update the Stand-Alone Addon Manager, it ALSO says to check the following folder:
%APPDATA%VirtualiCouatl.ERR
If you are seeing that message, it’s SURE that Couatl.ERR HAS been created. Fact you are posting the installation log instead, seems to indicate you are still looking in the wrong folder, because the previous instructions about how to create a INSTALLATION log file (that you don’t seem to need, since I don’t see any errors in your installer), explained how to create a .LOG file in your DESKTOP or in any place where you downloaded the scenery installer .exe so, if you followed those instructions, and you are seeing just the INSTALLATION log, it’s fairly sure you are looking in the wrong folder.
Again, the folder where the Couatl.ERR file has been created (and it has, otherwise you wouldn’t see that message) is:
%APPDATA%VirtualiCouatl.ERR
Type this exactly as above on the Windows blank search area that is accessed after pressing the Start button, then press Enter. The correct folder should open and I’m sure your Couatl.ERR file is there.
|
«Альтернатива» — техническая поддержка |
|
Дата: Понедельник, 04.03.2013, 19:36 Сообщение #1
Еще пока ни один мод не обходился без вылетов и багов — помогаем решать проблемы технического плана друг другу
Задаёте вопрос — не забывайте указывать версию игры! У кого пропала миникарта или бардак в главном меню делаем так: Если при игре за военного освободили Картографа, а потом Лоцмана и у вас резко упала репутация у сталкеров, то делаем так ( правка от Джи-Ай):
IMAGINE
Такой как есть Хабар сталкера
|
|
Дата: Вторник, 12.11.2013, 21:46 Сообщение #141 вылет при походе к анархисту, одет в экзу монолита, может из-за неё? Expression : fatal error
tarakan_v_kaske
Уважение: 0 Хабар сталкера |
|
Дата: Вторник, 12.11.2013, 21:57 Сообщение #142 tarakan_v_kaske, ставь фикс от 08.11.13. Он тута: http://stalker-gamers.ru/forum/139-1225-33128-16-1382859618
IMAGINE
Такой как есть Хабар сталкера
|
|
Дата: Четверг, 14.11.2013, 18:24 Сообщение #143 Вот такие беляши при запуске инсталятора: Внутренняя ошибка:An attempt was made to expand the «app» «Ничто не истинно.И если это высказывание истинно, то оно ложное».@Древний парадокс.
CHEBURECHEK
Уважение: 6 Хабар сталкера |
|
Дата: Четверг, 14.11.2013, 19:42 Сообщение #144 CHEBURECHEK скорее всего с железом что то…напиши параметры железа и версию ТЧ.Хотя не исключено что битый инсталятор скачал. Умирать не страшно…страшно не жить!
Шквал
Уважение: 23 Хабар сталкера |
|
Дата: Четверг, 14.11.2013, 20:57 Сообщение #145 CHEBURECHEK,
IGOR™
Вольный Сталкер Хабар сталкера
|
|
Дата: Четверг, 14.11.2013, 22:22 Сообщение #146 Спасибо Игорь!всё о-кей! Добавлено (14.11.2013, 22:21) Добавлено (14.11.2013, 22:22) «Ничто не истинно.И если это высказывание истинно, то оно ложное».@Древний парадокс.
CHEBURECHEK
Уважение: 6 Хабар сталкера |
|
Дата: Четверг, 14.11.2013, 23:39 Сообщение #147 Скачал Альтернативу 1.2 с ***.org, полноценная игра. Возможно после вылета по XR_3DA.exe, «Windows пытается решить проблему» потом «закрытие программы», пропал телепорт с Затона в Предзонье. Забор есть, солдата, телепорта и халявного Калаша нет. Перенёс сейв на другой комп, игра та же, устанавливал сразу на два, большой и ноут. На ноуте не было ни одного сейва, пошло всё хорошо, но телепорт не появился. Снёс с ноута всю игру вместе с сейвами, почистил «мои документы». Удалял uninstallerom. Установил всё заново, начал с нуля, дошёл до Затона — телепорта нет! Где то, видимо прописалась ошибка, своё имя я по новой не вписывал, а оно оказалось в новой игре. Не думаю, что проблема с железом, но если надо напишу. На большом компе было всего пара вылетов, которые я описал выше, стоит семёрка, на ноуте вообще ни одного, на нём восьмёрка. Слегка подтормаживает при передвижении, но это, насколько я помню, было во всех версиях Сталкера. Старый сталкер
petryx@
Уважение: 0 Хабар сталкера |
|
Дата: Пятница, 15.11.2013, 00:21 Сообщение #148
Цитата petryx@ ( с ***.org Скачал бы с данного форума. Цитата petryx@ ( Установил всё заново Тогда бы не было Цитата petryx@ ( имя я по новой не вписывал, а оно оказалось в новой игре А играешь кстати за кого? Цитата petryx@ ( Слегка подтормаживает при передвижении, но это, насколько я помню, было во всех версиях Сталкера. А это зависит от железа. Допустим у меня вообще все, как по маслу, идет. Любые моды и на любых платформах.
IGOR™
Вольный Сталкер Хабар сталкера
|
|
Дата: Пятница, 15.11.2013, 11:04 Сообщение #149
Цитата IGOR™ ( Тогда бы не было Я тоже так думал, но оно есть. Вот меня и интересует ПОЧЕМУ? Хоть какие- ни будь мысли есть, кроме как » такого не бывает». Старый сталкер
petryx@
Уважение: 0 Хабар сталкера |
|
Дата: Суббота, 16.11.2013, 14:07 Сообщение #150 Та же ерунда , что и в бета версии . Пришел на Свалку ТК , в домике компа нет , переиграл с автосейва , переиграл с ЗП , ни чего не помогло . Я не помню , что он дает и спавнит , может идти дальше , прошел почти все , ломает , как проходить ПМ знаю . Основное , что понял , после взлома компа в домике от мэра , квест ПМ надо выполнять сразу Добавлено (16.11.2013, 14:07) Чем дальше в лес , тем толще партизаны
slavastii
Уважение: 1 Хабар сталкера
|
|
Дата: Понедельник, 18.11.2013, 16:47 Сообщение #151 А то что не отображается ТТХ оружия, не видно в инвентаре детектора (который в самом начале, Отклик вроде), невидно в инвентаре ножа (когда покупаешь), невидео фонарик в инвентаре — это так и должно быть? Или я мож что то не то скачал (наврядли) и есть ли «таблетка»?
Hell_d
Уважение: 6 Хабар сталкера |
|
Дата: Понедельник, 18.11.2013, 17:14 Сообщение #152 Hell_d, Все так и должно быть.
akva
Хабар сталкера
|
|
Дата: Понедельник, 18.11.2013, 17:45 Сообщение #153 akva сурово…даже для реальности
Hell_d
Уважение: 6 Хабар сталкера |
|
Дата: Среда, 20.11.2013, 19:36 Сообщение #154 После начала игры пропала миникарта,вообще вверху в квадратике ни чего не показывается,экран прозрачный…
Stalker_Neo
Хабар сталкера |
|
Дата: Среда, 20.11.2013, 20:05 Сообщение #155
Цитата neo122334 ( После начала игры Так лучше начни игру заново.
IGOR™
Вольный Сталкер Хабар сталкера
|
|
Дата: Среда, 20.11.2013, 20:07 Сообщение #156 IGOR™, думаешь поможет?может в файлах надо что-то править?
Stalker_Neo
Хабар сталкера |
|
Дата: Среда, 20.11.2013, 20:09 Сообщение #157 neo122334, Открывай файл user.ltx (он там же где логи и сейвы) . Вторая строчка снизу должна быть такой : Код texture_lod 0 Если вместо цифры «0» у тебя любая другая цифра , то исправляй на » 0 » и сохраняй изменения.
akva
Хабар сталкера
|
|
Дата: Среда, 20.11.2013, 20:13 Сообщение #158 akva, стоит 0))
Stalker_Neo
Хабар сталкера |
|
Дата: Среда, 20.11.2013, 20:16 Сообщение #159 neo122334, Значит начинай НИ . Как вариант -кривая установка .
akva
Хабар сталкера
|
|
Дата: Четверг, 21.11.2013, 11:55 Сообщение #160 Господа , подскажите пожалуйста , кто в курсе , скачал допу от Федота V-2.0 , новая игра нужна ? Чем дальше в лес , тем толще партизаны
slavastii
Уважение: 1 Хабар сталкера
|
Hello
I get this Error Message after I tried to install «typeDNA» latest Version 2.2.0:
«It seems like Adobe Air is not installed. Please install it!»
If I press OK Button «Setup» says:
«Runtime Error (at 17:233):
Runtime Error (at 1:46):
Internal Error: An Attempt was made to expand the «app» constant before it was initialized»
Befor that I updated Adobe AIR to latest Version (3?) with no Problems.
Log:
[2011-11-04:02:19:36] Runtime Installer begin with version 3.0.0.4080 on Windows 7 x86
[2011-11-04:02:19:36] Commandline is:
[2011-11-04:02:19:36] No installed runtime detected
[2011-11-04:02:19:39] Relaunching with elevation
[2011-11-04:02:19:39] Launching subprocess with commandline c:usersjulian~1appdatalocaltempair1ff0.tmpadobe air installer.exe -ei
[2011-11-04:02:19:42] Runtime Installer begin with version 3.0.0.4080 on Windows 7 x86
[2011-11-04:02:19:42] Commandline is: -stdio \.pipeAIR_1984_0 -ei
[2011-11-04:02:19:42] No installed runtime detected
[2011-11-04:02:19:42] Starting silent runtime install. Installing runtime version 3.0.0.4080
[2011-11-04:02:19:42] Installing msi at c:usersjulian~1appdatalocaltempair1ff0.tmpsetup.msi with guid {ACEB2BAF-96DF-48FD-ADD5-43842D4C443D}
[2011-11-04:02:19:42] Runtime Installer end with exit code 0
[2011-11-04:02:19:43] Elevated install completed
[2011-11-04:02:19:46] Launching subprocess with commandline c:Program Files (x86)Common FilesAdobe AIRVersions1.0ResourcesAdobe AIR Updater -installupdatecheck
[2011-11-04:02:19:46] Runtime Installer end with exit code 0
[2011-11-04:02:19:46] Runtime Installer begin with version 3.0.0.4080 on Windows 7 x86
[2011-11-04:02:19:46] Commandline is: -installupdatecheck
[2011-11-04:02:19:46] Installed runtime (3.0.0.4080) located at c:Program Files (x86)Common FilesAdobe AIR
[2011-11-04:02:19:47] Performing pingback request
[2011-11-04:02:19:47] Starting runtime background update check
[2011-11-04:02:19:47] Begin Background update download from http://airdownload.adobe.com/air/3/background/windows/x86/patch/3.0.0.4080/update
[2011-11-04:02:19:47] Unpackaging http://airdownload.adobe.com/air/3/background/windows/x86/patch/3.0.0.4080/update to C:UsersJulian FriedrichAppDataRoamingAdobeAIRUpdaterBackground
[2011-11-04:02:19:47] Runtime update not available
[2011-11-04:02:19:47] Unpackaging cancelled
[2011-11-04:02:19:47] Runtime Installer end with exit code 0
After unsintall and Installation same thing. thx for youre help.

















