NigelShaw
Posts: 58
Joined: Wed Apr 01, 2015 12:45 am

A few questions :)

Thu Sep 01, 2022 2:31 am

Hi there!

I dont want to swamp your board with a bunch of threads, i feel that i have done that already... I have some questions that i cannot find an answer for, maybe you can respond in context and keep everything to this single thread?

Registry
I want to add keys for existing users & future users. I originally used HKCU but thats not correct. What i need to so is 2 things
1. Add the keys for each existing user in HKU in the relative SID
2. Add a set of the same keys into HKU Default so that windows can use it as a template for any future logins.
I have a batch script that i can use to do this, my question on this is-
Is there anything built in that will allow me to this without using a batch or van i enter a batch code directly without a vbs?
alternatively
What is the right method to use that will allow me to fire the batch?
Im happy to share the batch file if it means it will help others and maybe some sort of integration unless there is already an existing way to do this?

Dialog
It looks like there is an option for me to prompt users to enter a username. This would be really helpful during the install. I can do this. My question on this is -
Is there a way to prompt the user on a first time install but ignore the prompt on a update?

Files & Folders
I have set my installer to be 'Per User Only'. What i have found is that i can only update by using the same user. If a different user on the machine tries to update, i get an error on no permissions. My question on this is-
What settings do i need to use that would allow any user to update . uininstall?

Update builds
It looks like the preferred method is to do a 'SaveAs' for every update iteration. Is this correct? I would like my workflow to be

first time install = full dialog for the installation
update = a simple progress bar showing the update

can this be done in the same installer or would it be better to make a separate update project? What i dont want is to manage a bunch of files between a full install & an update. I wont be using a patch unless there is a fix i need to do between version updates. in that case i would make a patch until the next release.


Thanks so much

NigelShaw
Posts: 58
Joined: Wed Apr 01, 2015 12:45 am

Re: A few questions :)

Thu Sep 01, 2022 6:29 am

Hey

a bit of info regarding the registry to see if there is a way to do it within Advanced Installer

Registry values for users that are existing users on the machine.
Per User registry keys are typically edited in HKCU but in order to successfully apply any new registry keys on a new install to all users, the keys MUST be placed within their SID in HKU instead. HKCU is per user and looks into HKU per user. If the new registry keys are not placed in HKU, then each user when logged in will need to run the installer to add the registry keys.

Because there is an undisclosed amount of users, the HKU would need to search and find all users that not built in and the registry keys per user.
HKU.jpg
HKU.jpg (47.53KiB)Viewed 17687 times
Registry values for users that are future users on the machine, not yet logged in are added
Obviously new or future users dont yet have an SID in HKU so we cant add any registry keys to them but, we can add the keys to the .Default hive. Windows uses this a template for new users. Can we access this in the Advanced Installer editor? The default hive would need to be loaded and the registry files added to it. Once aded, close the default hive. The default hive can be found at 'C:\users\default\ntuser.dat'

What needs to happen is a search of the SIDs in HKU that are not S-1-5-18, S-1-5-19, S-1-5-20 or .Default, and the registry values inside HKU .Default copied / added to them. Here is a batch code example that adds keys and values but id prefer if possible to all of this inside Advanced Installer.

Code: Select all

strComputer = "."
strRegPathSuffix = "\Software\Manufacturer\Product"

Const HKEY_USERS = &H80000003
 
Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = ""
oReg.EnumKey HKEY_USERS, strKeyPath, arrSubKeys
 
For Each subkey In arrSubKeys
    'wscript.echo subkey
    'We only want to do something if the subkey does not contain any of the following: .DEFAULT or S-1-5-18 or S-1-5-19 or S-1-5-20 or _Classes
    If NOT ((InStr(1,subkey,".DEFAULT",1) > 0) OR (InStr(1,subkey,"S-1-5-18",1) > 0) OR (InStr(1,subkey,"S-1-5-19",1) > 0) OR (InStr(1,subkey,"S-1-5-20",1) > 0) OR (InStr(1,subkey,"_Classes",1) > 0)) Then
      
      'Create desired registry key/value
      strKeyPath = subkey & strRegPathSuffix
      
      'create the key
      oReg.CreateKey HKEY_USERS, strKeyPath
      
      'create the values
      oReg.SetDWORDValue HKEY_USERS, strKeyPath, "install_date", DateAdd("m",-1,"31-Jan-10")
      oReg.SetDWORDValue HKEY_USERS, strKeyPath, "Key1", "Value1"
      oReg.SetDWORDValue HKEY_USERS, strKeyPath, "Key2", "Value2"
      oReg.SetDWORDValue HKEY_USERS, strKeyPath, "Key3", "Value3"
      oReg.SetDWORDValue HKEY_USERS, strKeyPath, "Key4", "Value4"

      
  End If
Next

Is this achievable?



Thanks
Attachments
HKU Default.jpg
HKU Default.jpg (18.03KiB)Viewed 17687 times

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: A few questions :)

Fri Sep 02, 2022 1:04 pm

Hello,
I want to add keys for existing users & future users. I originally used HKCU but thats not correct. What i need to so is 2 things
1. Add the keys for each existing user in HKU in the relative SID
2. Add a set of the same keys into HKU Default so that windows can use it as a template for any future logins.
Regarding this, I believe you already implemented your scenario as you mentioned in another thread.
I have a batch script that i can use to do this, my question on this is-
Is there anything built in that will allow me to this without using a batch or van i enter a batch code directly without a vbs?
alternatively
What is the right method to use that will allow me to fire the batch?
Yes, you can easily achieve this (launch a .bat file). Please check our How to launch a CMD or BAT file article.
Dialog
It looks like there is an option for me to prompt users to enter a username. This would be really helpful during the install. I can do this. My question on this is -
Is there a way to prompt the user on a first time install but ignore the prompt on a update?
You can skip a specific dialog during update. Right click on the dialog you want to skip and select Show only if.. option. On Expression add NOT OLDPRODUCTS.

You can find a screenshot regarding this on my reply on another forum thread here.
Files & Folders
I have set my installer to be 'Per User Only'. What i have found is that i can only update by using the same user. If a different user on the machine tries to update, i get an error on no permissions. My question on this is-
What settings do i need to use that would allow any user to update . uininstall?
A per-user installation is available only for the user who installed the package.

Also, a per-user installation cannot upgrade a per-machine installation, and a per-machine installation cannot upgrade a per-user installation. This is the normal behavior. This is a limitation of Windows Installer technology itself. The Windows installer does not support upgrading "across contexts".

Per-user only installation type - the application will be available only for the user who installed it.

Per-machine only (fails if the user is not administrator) - the application will be available for all the users of that machine.
update = a simple progress bar showing the update
You can achieve this by launching the Updater with -reducedgui command-line switch - The Updater is launched with basic user interface (simple progress and error handling). Please check our Advanced Installer Updater tutorial.

You can also pass parameters to your update setup in the Updates Configuration Project:
update.png
update.png (50.84KiB)Viewed 17674 times

For example, if you have an .EXE package you can use the /exebasicui switch which launches the EXE setup with basic UI.
For MSI package you can use the /passive command line - unattended mode (the installation shows only a progress bar).

Msiexec.exe Command Line

Proprietary command-line switches for the EXE Setup
What i dont want is to manage a bunch of files between a full install & an update.
As my colleague Catalin already explained to you, an update is also a "full install". The old version will be removed and the new version will be installed.
Registry values for users that are existing users on the machine.
Per User registry keys are typically edited in HKCU but in order to successfully apply any new registry keys on a new install to all users, the keys MUST be placed within their SID in HKU instead. HKCU is per user and looks into HKU per user. If the new registry keys are not placed in HKU, then each user when logged in will need to run the installer to add the registry keys.

Because there is an undisclosed amount of users, the HKU would need to search and find all users that not built in and the registry keys per user.
When performing a Per User installation, the package must respect some rules:
  • it creates registry entries only under HKEY_CURRENT_USER
  • it creates shortcuts only in the user's profile (not in per-machine locations)
  • it writes information only in Per User locations (for example a normal user cannot write in the "Windows" or "Program Files" folders)
You can add registry keys for all users only when performing a Per-Machine installation. This is the default behavior of Windows Installer.

Note that HKEY_CURRENT_USER is used only for the user that installs the application.

If you want your application to be available for multiple users then you can add your registry entries under HKEY_LOCAL_MACHINE.

Registry Table


Hope this helps!

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

NigelShaw
Posts: 58
Joined: Wed Apr 01, 2015 12:45 am

Re: A few questions :)

Sun Sep 04, 2022 7:59 am

Hi

Thanks for taking to the time to respond, i know ive messaged a lot lately and its really appreciated that you are being patient with me. I do have a couple of final questions / comments that still remain a little unclear

exe vs msi
Exe works better. The dialog in exe looks as expected vs the same dialog in msi which looks awful
dialogs.jpg
dialogs.jpg (121.74KiB)Viewed 17657 times
exe can uninstall previous versions before installing the latest the version
msi cannot uninstall previous version before installing the latest version and instead, prompts the user to remove the previous version first
msi can receive a patch update
exe cannot receive a patch update

questions:
  • If i used msi instead of exe, how can make it that the previous install is removed without needing to do it manually?
    if i changed to msi and installed a full version, can i use the updater to install a patch? Im guessing i would leave the product code the same instead of generating a new one.
    If wanted to install a minor or major upgrade, can use the updater as normal
    If i used a patch, can i ignore most of the files from the original install and only install the updated / revised files? For example, i install about 30 reference dlls but these never change so in a patch, id like to update the exe and dll launcher only to make a much smaller update file. How would i set about ignoring the files i dont want to include?
    'Application running' dialog; How can i suppress this? The files im changing do not relate to anything that requires to the parent app to close so im not even sure why im getting this? I have a dll that is loaded by the parent app and this dll does the update/ Once successful, it runs an exe with Process.Start(). The dll is not being updated. only the unrelated exe so how can i suppress this message?

In regard to user only vs administrator, i need everything to operate outside of admin. Our IT company have a system in place for support and it takes hours, sometimes days to get things done. Across 20 users, i can get all updates done in 2 mins simultaneously vs IT taking a week... So, i have decided to move my files from the C:/Programdata/Autodesk/ApplicationAddins/MyCompany/MyApp to C:/Users/Public Documents/MyCompany/MyApp. Its not a traditional install location but it avoids the Admin reqs for other folders. The problem i was having was that i couldnt edit the files that someone else had installed. I feel that this is resolved now, we'll see.

Thanks again for being patient. Its a shame we bought this product too early which was over a yr ago because i havent even used it until these past too weeks and now the maintenance has expired :( My company wont pay for it until i can demonstrate a successful problem free install)



Best

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: A few questions :)

Wed Sep 07, 2022 7:42 am

Hello,
Exe works better. The dialog in exe looks as expected vs the same dialog in msi which looks awful
Please keep in mind that the Surface theme that you are using requires Enhanced User Interface which is handled by our EXE Bootstrapper.

In order to enable the Enhanced User Interface, you can go in the Themes -> Settings tab and select Always (install, uninstall and maintenance) option.
Enhanced UI will be used when installing the application as well as when performing "Modify" or "Uninstall" from Control Panel.

Also, when you choose a theme that requires Enhanced User Interface from the Themes page, the package type is automatically turned to EXE in the Builds page. Then, when the project is built it creates an EXE setup file and the MSI file next to it (the MSI file can also be included in the EXE file). When you run your package, you should run the EXE file for the bootstrapper to handle correctly all the dialogs and controls.

This is happening because Windows Installer is not able to manage our Enhanced User Interface.
If i used msi instead of exe, how can make it that the previous install is removed without needing to do it manually?
You don't need to do anything manually. The old version will be automatically uninstalled. In the Upgrades page the Uninstall old version first and then install new version option is selected by default. In this case, the installer removes the old applications entirely before installing the new applications.

You can also test this by creating a sample project. Just create a v1 project file, then create the v2 and change the product version. When you install the second MSI the application installed before will be automatically uninstalled.

You can check our Upgrades article.
if i changed to msi and installed a full version, can i use the updater to install a patch? Im guessing i would leave the product code the same instead of generating a new one.
Yes, for patches you need to select the Keep existing option for the Product Code.
If wanted to install a minor or major upgrade, can use the updater as normal
Yes, you can use our Updater for that.
If i used a patch, can i ignore most of the files from the original install and only install the updated / revised files? For example, i install about 30 reference dlls but these never change so in a patch, id like to update the exe and dll launcher only to make a much smaller update file. How would i set about ignoring the files i dont want to include?
It is not necessary to delete anything from the project. The patch will compare the two projects (installers) and contain only the difference between them.

A patch is usually much smaller in size and it consists of the diffs between two packages (an MSI is basically a database). After diffing two MSIs (e.g. version 1.0.0 and 1.0.1) the changes will be saved into the patch file (MSP). At install time, the patch basically attaches to the already installed MSI, i.e.: version 1.0.0 is installed --> we apply the patch --> we obtain version 2.0.0.

More details about this in our articles:

1. Authoring a Windows Installer patch

2. Creating Patches

'Application running' dialog; How can i suppress this? The files im changing do not relate to anything that requires to the parent app to close so im not even sure why im getting this? I have a dll that is loaded by the parent app and this dll does the update/ Once successful, it runs an exe with Process.Start(). The dll is not being updated. only the unrelated exe so how can i suppress this message?
I'm not sure I understand. Are you referring to the FileInUse dialog? Please note that this dialog ("FilesInUse" on XP and "MsiRMFilesInUse" on Vista) is shown automatically by Windows Installer during the InstallValidate standard action when the installer checks if any file is in use and if so, it displays that dialog.

In order to detect which file is in use and which process keeps that a file in use, you can check our How to detect which applications keep files in use at install time? tutorial.

A possible solution is described in a similar forum thread. You can check it here. Otherwise, please forward to us a screenshot with this dialog.

Hope this helps! If you have any other questions, please let us know.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

NigelShaw
Posts: 58
Joined: Wed Apr 01, 2015 12:45 am

Re: A few questions :)

Tue Dec 13, 2022 11:33 pm

Hi

Back to basics. Been a while since ive been around, some family personal matters overseas.

could you please refresh me in a summary?
I have changed my installer to an msi

1. i would like to release periodic patches to fix very minor bugs
How do i create a patch and can i use the updater to automatically install them?

2. i would like to release periodic updates when i add or enhance features
Can i use the same update project for updates, upgrades & patches?

3. i would like to release milestone upgrades to a new version.
As above question 2


I would like to maintain a single update project that has all of the patches & updates for continuity.
How do i create a patch?
Can i select specific files to update? There is only 1 usually which is the exe project file

Thanks

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: A few questions :)

Thu Dec 15, 2022 10:19 am

Hello,

1. i would like to release periodic patches to fix very minor bugs
How do i create a patch and can i use the updater to automatically install them?
Patches can also be applied through the Auto Updater. Simply configure the patch as update, just like you configure a new version of the package. For the Updater it doesn't matter if the update is an MSI, EXE or MSP file.

More details about this in our articles:

1. Authoring a Windows Installer patch

In this article you also have a video tutorial.

2. Creating Patches

2. i would like to release periodic updates when i add or enhance features
Can i use the same update project for updates, upgrades & patches?
I would like to maintain a single update project that has all of the patches & updates for continuity.
Advanced Installer supports two ways of updating an already installed application:
  • Upgrades
  • Patches
Unfortunately you can not use a single project for Upgrades and Patches. Each one has a different project type with different configurations:
updates.png
updates.png (50.57KiB)Viewed 14110 times
Can i select specific files to update? There is only 1 usually which is the exe project file
A Windows patch package is an .MSP file that contains only the changes between the previous and the updated version of an application. It is used to install updated information such as files, registry, and configurations of an application that's already installed on a Windows operating system.

A patch is usually much smaller in size and it consists of the diffs between two packages (an MSI is basically a database). After diffing two MSIs (e.g. version 1.0.0 and 1.0.1) the changes will be saved into the patch file (MSP). At install time, the patch basically attaches to the already installed MSI, i.e.: version 1.0.0 is installed --> we apply the patch --> we obtain version 2.0.0. The Upgraded image is the new package that contains the additional files while the Target image is the original one.

If one of your packages is EXE and not MSI, you can use the "/extract" command to extract the MSI package from it and use it to create the patch.

You also need to make sure that your patch fulfills all the Patch Rules.

You can also check our What are .MSP files, how to create and extract them? article.

I hope this gives you some guidance!

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

NigelShaw
Posts: 58
Joined: Wed Apr 01, 2015 12:45 am

Re: A few questions :)

Thu Jan 05, 2023 8:10 am

Hey

Im having a small issue creating a patch. Here is what i did-

in visual Studio
- I increment my project output to compile as V1.0.2 from V1.0.1

In my installer project
- i increased the product version from V1.0.1 to V1.0.2
- I kept the product code as the existing code
- I built the project
- Now i have 2 msi files, the V2.0.1 & V2.0.2

In the patch project
- I went to Images / New upgraded and selected V2.0.2.msi
- I went to Images / New Upgraded / New Target and selected V2.0.1.msi
- The difference between to the 2 builds exist as code changes in the V1.0.2.exe compiled from Visual Studio
- i went to build but got an error-
WARNING: Major patch. Providing a major upgrade as a patch package is not recommended because a major upgrade patch package cannot be sequenced with other updates
Question: Do the msi builds need to be different projects? I used a single build project with the updated product version.

and also
External tool "msimsp.exe" from Windows SDK not found

What am i doing wrong with the patch build and where can i find the missing file?

Most of my patches will be an update to the compiled project output file. I anticipate-

any code / minor update to the VS project would be a patch
any product release / major feature addition would be an update.

im struggling with the patch


Thanks

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: A few questions :)

Fri Jan 06, 2023 1:53 pm

Hello,
WARNING: Major patch. Providing a major upgrade as a patch package is not recommended because a major upgrade patch package cannot be sequenced with other updates
Question: Do the msi builds need to be different projects? I used a single build project with the updated product version.
Usually, this error appears when you change the product code. This may also happen if you have different product names and component GUIDs.

I've already linked in the previous replies the articles you need to follow.

Please analyze carefully the patching rules.

If you still can't get this to work, please forward to me all your project files (the old/new .AIP projects and the Patch project) by email to support at advancedinstaller dot com.
and also
External tool "msimsp.exe" from Windows SDK not found

What am i doing wrong with the patch build and where can i find the missing file?
Regarding this, it appears that your Windows SDK is not installed or the msimsp.exe file is missing from your computer. MsiMsp.exe is a tool used by Advanced Installer to build Windows Installer Patches. This file is part of Windows SDK.

Can you please open Advanced Installer application and go to "File menu -> Settings -> External Tools" and in the "Patch" section make sure the "MsiMsp.exe" installation path is set? If the Windows SDK is not already installed on your build machine, then please install Windows SDK and then set the "MsiMsp.exe" installed file in the AI External Tools settings.

If Windows SDK is already installed and the path in the AI settings is correct, can you please go to "Control Panel -> Programs and Features" and trigger a repair for "Windows Software Development Kit" and test again the patch build? Maybe something is corrupted within your SDK installation.

Please take a look at the articles I mentioned in my previous replies, they contain all the information needed to create a patch.

Hope this helps!

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

NigelShaw
Posts: 58
Joined: Wed Apr 01, 2015 12:45 am

Re: A few questions :)

Thu Jan 12, 2023 6:41 am

Hey

Ive installed the Windows SDK so that issue should resolve. In terms of the issue of Product code, i didnt change that but it appears to have changed on its own. I changed the version code on the main .exe that is being installed (which is my project) but i didnt get the prompt offering to change or keep the product code. I see this in the notifications
product_code.jpg
product_code.jpg (32.61KiB)Viewed 13404 times
The notification shows the ProductCode was changed as a result of ProductVersion property change.

Is there an automatic that needs to be turned off?

Am i doing the project exe correctly by up versioning the assembly version?


Thanks

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: A few questions :)

Fri Jan 13, 2023 2:03 pm

Hello,

This behavior is caused by using the "File version from an EXE or DLL" option. When using this option to set the Product Version, at build or load time the ProductCode changes automatically, as you could see in the notification panel.

In your case, you should either stop using the version from file option or save the ProductCode and restore it after it has been automatically changed.

I apologize for the inconvenience.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Catalin
Posts: 6537
Joined: Wed Jun 13, 2018 7:49 am

Re: A few questions :)

Mon May 29, 2023 11:30 am

Hello,

This has been fixed in version 20.7 of Advanced Installer, released on May 25th, 2023.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”